bramp / ffmpeg-cli-wrapper

Java wrapper around the FFmpeg command line tool
BSD 2-Clause "Simplified" License
1.7k stars 410 forks source link

compressed mp4 video is taking too much time to play in android #165

Closed adarshhm closed 7 months ago

adarshhm commented 6 years ago

I used cli-wrapper to compress 44mb MP4 video to 5.7mb video, it compressed well but taking too long time to play in android(exoplayer from google).

FFmpegBuilder builder = new FFmpegBuilder() .setInput("D:/dummyVideos/AWS video/myvideo.mp4") // Filename, or a FFmpegProbeResult .overrideOutputFiles(true) // Override the output if it exists .addOutput("D:/dummyVideos/AWS video/myvideo_ffmpeg.mp4") // Filename for the destination .setFormat("mp4") // Format is inferred from filename, or can be set
.disableSubtitle() // No subtiles .setAudioChannels(1) // Mono audio .setAudioCodec("aac") // using the aac codec .setAudioSampleRate(48_000) // at 48KHz .setAudioBitRate(32768) // at 32 kbit/s .setVideoCodec("libx264") // Video using x264 .setVideoFrameRate(24, 1) // at 24 frames per second .setVideoResolution(1280, 720) // at 640x480 resolution .setVideoBitRate(762800) .setStrict(FFmpegBuilder.Strict.EXPERIMENTAL) // Allow FFmpeg to use experimental specs .done();

[above is the details] I am not able to find why the video is taking too long time. Please anybody help me out of this.

Euklios commented 7 months ago

I'm sorry for the very late response on this issue. This isn't related to this library. Your command seems fine, but that is one aspect of why the video might play slowly.

Think about the following aspects:

Trying to play the original file (or similar) would be a good idea. If it's proportionally slower, the device will most likely limit you.

I'll close this issue for now, as it has been inactive for six years. Feel free to reopen or create a new issue.