Skip to content
Advertisement

How to use this library it has only .java files in it

I don’t want to use any building tools or IDE i want to know how this all works and if anyone has any source where i can learn how to use the compiler and stuff like this pleas link them i thought of using class path but there are so many folders and i have seen it been used only in jars files not in .java files or should i compile them all

├── convertVidToAudio.java <= this is my file 
└── velvet-video
    ├── build.gradle
    ├── gradle
    │   └── wrapper
    │       ├── gradle-wrapper.jar
    │       └── gradle-wrapper.properties
    ├── gradlew
    ├── gradlew.bat
    ├── LICENSE
    ├── LICENSE.Apache-2.0
    ├── LICENSE.GPL-3.0
    ├── README.md
    └── src
        ├── example
        │   └── java
        │       └── com
        │           └── zakgof
        │               └── velvetvideo
        │                   └── example
        │                       ├── AudioPlayback.java
        │                       ├── ExtractAndTranscodeAudio.java
        │                       ├── ImagesToVideoAndBack.java
        │                       ├── RemuxVideo.java
        │                       ├── ScreenCaptureToVideo.java
        │                       ├── TranscodeVideoWithTimingEffects.java
        │                       └── Util.java
        ├── main
        │   └── java
        │       └── com
        │           └── zakgof
        │               └── velvetvideo
        │                   ├── Direction.java
        │                   ├── IAudioDecoderStream.java
        │                   ├── IAudioEncoderBuilder.java
        │                   ├── IAudioEncoderStream.java
        │                   ├── IAudioFrame.java
        │                   ├── IAudioStreamProperties.java
        │                   ├── IContainerProperties.java
        │                   ├── IDecodedPacket.java
        │                   ├── IDecoderStream.java
        │                   ├── IDemuxer.java
        │                   ├── IEncoderBuilder.java
        │                   ├── impl
        │                   │   ├── AbstractEncoderBuilderImpl.java
        │                   │   ├── AudioEncoderBuilderImpl.java
        │                   │   ├── AudioStreamPropertiesImpl.java
        │                   │   ├── Dummy.java
        │                   │   ├── FileSeekableInput.java
        │                   │   ├── FileSeekableOutput.java
        │                   │   ├── jnr
        │                   │   │   ├── AVCodecContext.java
        │                   │   │   ├── AVCodec.java
        │                   │   │   ├── AVCodecParameters.java
        │                   │   │   ├── AVDictionaryEntry.java
        │                   │   │   ├── AVFormatContext.java
        │                   │   │   ├── AVFrame.java
        │                   │   │   ├── AVInputFormat.java
        │                   │   │   ├── AVIOContext.java
        │                   │   │   ├── AVOption.java
        │                   │   │   ├── AVOutputFormat.java
        │                   │   │   ├── AVPacket.java
        │                   │   │   ├── AVPixelFormat.java
        │                   │   │   ├── AVRational.java
        │                   │   │   ├── AVSampleFormat.java
        │                   │   │   ├── AVStream.java
        │                   │   │   ├── LibAVCodec.java
        │                   │   │   ├── LibAVFilter.java
        │                   │   │   ├── LibAVFormat.java
        │                   │   │   ├── LibAVUtil.java
        │                   │   │   ├── LibSwResample.java
        │                   │   │   ├── LibSwScale.java
        │                   │   │   └── SwsContext.java
        │                   │   ├── JNRHelper.java
        │                   │   ├── middle
        │                   │   │   ├── AudioFrameHolder.java
        │                   │   │   ├── AudioFrameImpl.java
        │                   │   │   ├── BestMatchingAudioFormatConvertor.java
        │                   │   │   ├── Feeder.java
        │                   │   │   ├── Filters.java
        │                   │   │   ├── IFrameHolder.java
        │                   │   │   ├── VideoFrameHolder.java
        │                   │   │   └── VideoFrameImpl.java
        │                   │   ├── RemuxerBuilderImpl.java
        │                   │   ├── VelvetVideoLib.java
        │                   │   └── VideoEncoderBuilderImpl.java
        │                   ├── IMuxerBuilder.java
        │                   ├── IMuxer.java
        │                   ├── IRawPacket.java
        │                   ├── IRemuxerBuilder.java
        │                   ├── IRemuxerStream.java
        │                   ├── ISeekableInput.java
        │                   ├── ISeekableOutput.java
        │                   ├── IVelvetVideoLib.java
        │                   ├── IVideoDecoderStream.java
        │                   ├── IVideoEncoderBuilder.java
        │                   ├── IVideoEncoderStream.java
        │                   ├── IVideoFrame.java
        │                   ├── IVideoStreamProperties.java
        │                   ├── MediaType.java
        │                   ├── MemSeekableFile.java
        │                   └── VelvetVideoException.java
        └── test
            └── java
                └── com
                    └── zakgof
                        └── velvetvideo
                            ├── AudioTest.java
                            ├── AudioUtil.java
                            ├── FilterTest.java
                            ├── FreeCodecSuite.java
                            ├── FreeEncodeDecodeTest.java
                            ├── FullEncodeDecodeTest.java
                            ├── GenericEncodeDecodeTest.java
                            ├── MetadataTest.java
                            ├── RawTest.java
                            ├── SeekableOutputTest.java
                            ├── SeekTest.java
                            ├── VarTimingTest.java
                            └── VelvetVideoTest.java

Advertisement

Answer

There’s two very different things to do depending on what your goal is:

  1. if your goal is just to use the library, then use the build system they use (in this case gradle) to build a jar file and use that. The build system exists precisely with this goal in mind and trying to avoid using it for this goal is like insisting on screwing in a screw without using a screwdriver.

  2. if you want to learn how the library is supposed to be compiled, then learn the build system that they use and read its configurations files (in this case build.gradle) and interpret it accordingly.

As you see in both cases you’ll have to get at least some familiarity with the build system, because sufficiently complex software is more than just a bunch of source files.

First of all almost all software will have some dependencies. The build system usually takes care of grabbing the appropriate dependencies. And the dependencies of dependencies (called transitive dependencies).

Second, some (but definitely not all) software will require some auxiliary steps for building, such as converting some DSL files into generated code (parsers/lexers are a common sample, but protobuf is another example).

Third, as Dave Newton suggested in the comments, some software further complicates matters by changing the actual compilation steps themselves in a way that’s not easily reproduced using just the JDK command-line tools (specifically things like the Lombok Gradle Plugin).

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement