Hi I am using your library its really working great :). I want to show a progress bar with processing percentage. So which api I have to call?
Which platform do you use?
@tanersener Android.
I am using com.arthenica:mobile-ffmpeg-full:4.2.2.LTS in build.gradle.
You can implement a progressbar using StatisticsCallback interface. Take a look at Android test-application to see how it is used.
Config.enableStatisticsCallback(new StatisticsCallback() {
public void apply(Statistics newStatistics) {
Log.d(Config.TAG, String.format("frame: %d, time: %d", newStatistics.getVideoFrameNumber(), newStatistics.getTime()));
}
});
You can implement a
progressbarusingStatisticsCallbackinterface. Take a look at Android test-application to see how it is used.Config.enableStatisticsCallback(new StatisticsCallback() { public void apply(Statistics newStatistics) { Log.d(Config.TAG, String.format("frame: %d, time: %d", newStatistics.getVideoFrameNumber(), newStatistics.getTime())); } });
@tanersener thanks for your reply and your library working great :).
Great 馃憤
@tanersener i want to change the audio volume of a video.
I am using input.mp4 -filter:a "volume=0.5" output.mp4 its working and giving result 0 after executing but not changing the volume. please let me know whats the wrong in the command.
I don't know, your command seems correct to me.
I don't know, your command seems correct to me.
@tanersener oh ok no issue :).
I am using your library for converting aduio formats.
String[] cmd = new String[]{"-i",audioPath.aac,"-acodec","libmp3lame",outPathmp3};
giving FFmpeg process exited with rc 1. Any thing wrong with the command ? Please let me know. There is no specific error it has given.
what is the output of FFmpeg.getLastCommandOutput()?
what is the output of
FFmpeg.getLastCommandOutput()?
@tanersener Hi "FFmpeg.getLastCommandOutput()" was giving libmp3lame not found. I was using "min" library. So when I changed it to "full" in the build graddle the above command started to work. One more thing i want to know. when i use "full" version the apk size is becoming 60MB. Is der any way to reduce it ?
Using section shows which libraries are enabled in each package. You can either switch to audio package which is smaller in size or build your own version with android.sh.
Using section shows which libraries are enabled in each package. You can either switch to
audiopackage which is smaller in size or build your own version withandroid.sh.
@tanersener yeah using "audio" package and working fine for almost all formats. Your library , and your reply saving my time thank you so much :).
As I am also working on a video in which I m overlaying image on the video using
cmd2 = new String[]{"-y", "-i", inputvideo, "-i", Imagepath, "-filter_complex", "overlay=10:10", finalOutput};. But 15MB video getting reduced to 1MB, when I use that command. Is der anything i have to add in command ?
@gururajKp I think you need to define a video codec for your output video but I need to see your command output to be % 100 sure
@gururajKp I think you need to define a video codec for your output video but I need to see your command to be % 100 sure
@tanersener HI, yup that command is working for me as per our requirement :).
I am using "-vb","20M" in the above command now quality has been increased up to 60%. But how can I maintain original quality ?
I need to know your current video codec to be able to make a recommendation. Your command output includes that information, this why I asked for it.
@tanersener Hi Sorry for late reply :). I want to support MP4, AVI, MKV, FLV. If user selects "input.mp4" then the output file will be "output.mp4".
mp4 is not a codec, mp4 files can contain video data encoded with one of the mpeg4, xvid, x264, x265 codecs.
If you don't specify a codec, ffmpeg selects the default codec which I think is mpeg4 on your case. If you want to increase the quality of your video, please use x264 or x265. They are not available in the audio package. So you need to switch your mobile-ffmpeg package.
Oh ok thank you :). Will work on that :).
Hi,
I was hoping someone can help me with implementing the progression.
I thought of using the frame count to calculate the current progress or at least to give a fair estimate.
The problem I am having is that I cannot get the following to be called.
Code 1
`
Config.enableStatisticsCallback(new StatisticsCallback() {
public void apply(Statistics newStatistics) {
Log.d(Config.TAG, String.format("frame: %d, time: %d", newStatistics.getVideoFrameNumber(), newStatistics.getTime()));
}
});`
I am currently executing FFMpeg in an AsyncTask like so:
Code 2
`
protected Boolean doInBackground(String... strings) {
String[] cmd = strings[0].split(" ");
if (cmd.length != 0) {
FFmpeg.execute(cmd);
return true;
}
return false;
}`
At first I tried putting Code 1 inside of Code 2 right after FFmpeg.execute(cmd); but it did not work.
I took a look at the test app for android and tried to implement it in the same way by creating a runnable and adding it to my activity inside the statistics callback right before I call the execute of the AsyncTask, but that also didn't work.
Ao any help would be greatly appreciated
@CBRZY Can you share your console output please?
Attaching logs of ffmpeg out below. Executing ffmpeg works fine, the problem I'm having is getting the statistics callback to be called. Clearly I am not understanding how to do or where exactly to do it.
Before I created an AsyncTask class it was working, but I am struggling to get it to work with an AsyncTask class
2019-09-17 22:51:49.311 13041-13377/com.digitalcapitan.vedette I/mobile-ffmpeg: Loading mobile-ffmpeg.
2019-09-17 22:51:49.483 13041-13377/com.digitalcapitan.vedette I/mobile-ffmpeg: Loaded mobile-ffmpeg-min-gpl-x86-4.2-lts.
2019-09-17 22:51:49.491 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: ffmpeg version v4.2-dev-480
2019-09-17 22:51:49.491 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Copyright (c) 2000-2018 the FFmpeg developers
2019-09-17 22:51:49.492 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: built with Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
2019-09-17 22:51:49.494 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: configuration: --cross-prefix=i686-linux-android- --sysroot=/files/android-sdk/ndk-bundle/toolchains/mobile-ffmpeg-api-21-i686/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-x86/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=i686 --cpu=i686 --target-os=android --disable-neon --disable-asm --disable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-lto --enable-optimizations --enable-swscale --enable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --disable-sdl2 --enable-zlib --enable-mediacodec
2019-09-17 22:51:49.495 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavutil 56. 25.100 / 56. 25.100
2019-09-17 22:51:49.495 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavcodec 58. 42.104 / 58. 42.104
2019-09-17 22:51:49.496 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavformat 58. 25.100 / 58. 25.100
2019-09-17 22:51:49.496 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavdevice 58. 6.101 / 58. 6.101
2019-09-17 22:51:49.496 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavfilter 7. 46.101 / 7. 46.101
2019-09-17 22:51:49.496 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libswscale 5. 4.100 / 5. 4.100
2019-09-17 22:51:49.496 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libswresample 3. 4.100 / 3. 4.100
2019-09-17 22:52:08.687 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: ffmpeg version v4.2-dev-480
2019-09-17 22:52:08.687 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Copyright (c) 2000-2018 the FFmpeg developers
2019-09-17 22:52:08.694 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: built with Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
2019-09-17 22:52:08.694 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: configuration: --cross-prefix=i686-linux-android- --sysroot=/files/android-sdk/ndk-bundle/toolchains/mobile-ffmpeg-api-21-i686/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-x86/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=i686 --cpu=i686 --target-os=android --disable-neon --disable-asm --disable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-lto --enable-optimizations --enable-swscale --enable-shared --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --disable-sdl2 --enable-zlib --enable-mediacodec
2019-09-17 22:52:08.694 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavutil 56. 25.100 / 56. 25.100
2019-09-17 22:52:08.702 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavcodec 58. 42.104 / 58. 42.104
2019-09-17 22:52:08.705 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavformat 58. 25.100 / 58. 25.100
2019-09-17 22:52:08.705 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavdevice 58. 6.101 / 58. 6.101
2019-09-17 22:52:08.705 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libavfilter 7. 46.101 / 7. 46.101
2019-09-17 22:52:08.706 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libswscale 5. 4.100 / 5. 4.100
2019-09-17 22:52:08.706 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: libswresample 3. 4.100 / 3. 4.100
2019-09-17 22:52:08.724 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.digitalcapitan.vedette/cache/demovideo.mp4':
2019-09-17 22:52:08.725 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Metadata:
2019-09-17 22:52:08.725 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: major_brand :
2019-09-17 22:52:08.725 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: M4V
2019-09-17 22:52:08.727 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: minor_version :
2019-09-17 22:52:08.731 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 1
2019-09-17 22:52:08.731 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: compatible_brands:
2019-09-17 22:52:08.731 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: M4V mp42isom
2019-09-17 22:52:08.732 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: creation_time :
2019-09-17 22:52:08.732 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 2015-06-08T17:01:35.000000Z
2019-09-17 22:52:08.732 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Duration:
2019-09-17 22:52:08.732 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 00:00:19.67
2019-09-17 22:52:08.732 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: , start:
2019-09-17 22:52:08.732 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 0.000000
2019-09-17 22:52:08.732 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: , bitrate:
2019-09-17 22:52:08.733 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 4489 kb/s
2019-09-17 22:52:08.733 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Stream #0:0
2019-09-17 22:52:08.733 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (eng)
2019-09-17 22:52:08.733 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: : Video: h264 (avc1 / 0x31637661), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 4400 kb/s
2019-09-17 22:52:08.737 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: ,
2019-09-17 22:52:08.737 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 30 fps,
2019-09-17 22:52:08.737 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 30 tbr,
2019-09-17 22:52:08.737 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 30k tbn,
2019-09-17 22:52:08.737 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 60 tbc
2019-09-17 22:52:08.737 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (default)
2019-09-17 22:52:08.738 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Metadata:
2019-09-17 22:52:08.738 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: creation_time :
2019-09-17 22:52:08.738 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 2015-06-08T17:01:36.000000Z
2019-09-17 22:52:08.739 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: handler_name :
2019-09-17 22:52:08.739 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Mainconcept MP4 Video Media Handler
2019-09-17 22:52:08.740 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: encoder :
2019-09-17 22:52:08.741 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: AVC Coding
2019-09-17 22:52:08.741 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Stream #0:1
2019-09-17 22:52:08.741 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (eng)
2019-09-17 22:52:08.741 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 81 kb/s
2019-09-17 22:52:08.742 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (default)
2019-09-17 22:52:08.742 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Metadata:
2019-09-17 22:52:08.742 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: creation_time :
2019-09-17 22:52:08.742 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 2015-06-08T17:01:36.000000Z
2019-09-17 22:52:08.748 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: handler_name :
2019-09-17 22:52:08.748 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Mainconcept MP4 Sound Media Handler
2019-09-17 22:52:08.749 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Stream mapping:
2019-09-17 22:52:08.753 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Stream #0:0 -> #0:0
2019-09-17 22:52:08.755 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (h264 (native) -> h264 (libx264))
2019-09-17 22:52:08.757 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Stream #0:1 -> #0:1
2019-09-17 22:52:08.758 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (aac (native) -> aac (native))
2019-09-17 22:52:08.759 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Press [q] to stop, [?] for help
2019-09-17 22:52:08.804 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:08.804 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: using SAR=1/1
2019-09-17 22:52:08.806 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:08.806 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: using cpu capabilities: none!
2019-09-17 22:52:08.929 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:08.929 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: profile High, level 3.1
2019-09-17 22:52:08.929 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:08.931 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 264 - core 155 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=24.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
2019-09-17 22:52:08.931 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Output #0, mp4, to '/data/user/0/com.digitalcapitan.vedette/files/videos/vdComp_demovideo.mp4':
2019-09-17 22:52:08.936 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Metadata:
2019-09-17 22:52:08.936 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: major_brand :
2019-09-17 22:52:08.936 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: M4V
2019-09-17 22:52:08.937 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: minor_version :
2019-09-17 22:52:08.937 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 1
2019-09-17 22:52:08.937 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: compatible_brands:
2019-09-17 22:52:08.937 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: M4V mp42isom
2019-09-17 22:52:08.937 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: creation_time :
2019-09-17 22:52:08.938 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 2015-06-08T17:01:35.000000Z
2019-09-17 22:52:08.939 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: encoder :
2019-09-17 22:52:08.939 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Lavf58.25.100
2019-09-17 22:52:08.940 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Stream #0:0
2019-09-17 22:52:08.940 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (eng)
2019-09-17 22:52:08.948 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: : Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1
2019-09-17 22:52:08.949 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: ,
2019-09-17 22:52:08.949 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 30 fps,
2019-09-17 22:52:08.949 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 15360 tbn,
2019-09-17 22:52:08.949 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 30 tbc
2019-09-17 22:52:08.949 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (default)
2019-09-17 22:52:08.950 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Metadata:
2019-09-17 22:52:08.950 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: creation_time :
2019-09-17 22:52:08.951 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 2015-06-08T17:01:36.000000Z
2019-09-17 22:52:08.951 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: handler_name :
2019-09-17 22:52:08.951 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Mainconcept MP4 Video Media Handler
2019-09-17 22:52:08.954 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: encoder :
2019-09-17 22:52:08.954 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Lavc58.42.104 libx264
2019-09-17 22:52:08.954 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Side data:
2019-09-17 22:52:08.954 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg:
2019-09-17 22:52:08.954 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: cpb:
2019-09-17 22:52:08.957 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
2019-09-17 22:52:08.958 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Stream #0:1
2019-09-17 22:52:08.958 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (eng)
2019-09-17 22:52:08.958 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
2019-09-17 22:52:08.958 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: (default)
2019-09-17 22:52:08.959 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Metadata:
2019-09-17 22:52:08.959 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: creation_time :
2019-09-17 22:52:08.959 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 2015-06-08T17:01:36.000000Z
2019-09-17 22:52:08.959 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: handler_name :
2019-09-17 22:52:08.959 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Mainconcept MP4 Sound Media Handler
2019-09-17 22:52:08.960 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: encoder :
2019-09-17 22:52:08.961 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Lavc58.42.104 aac
2019-09-17 22:52:09.263 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 15 fps=0.0 q=0.0 size= 0kB time=00:00:00.58 bitrate= 0.7kbits/s speed=1.15x
2019-09-17 22:52:09.992 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 36 fps= 31 q=0.0 size= 0kB time=00:00:01.27 bitrate= 0.3kbits/s speed= 1.1x
2019-09-17 22:52:10.409 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 47 fps= 28 q=30.0 size= 0kB time=00:00:01.64 bitrate= 0.2kbits/s speed=0.983x
2019-09-17 22:52:10.916 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 58 fps= 27 q=30.0 size= 0kB time=00:00:02.02 bitrate= 0.2kbits/s speed=0.925x
2019-09-17 22:52:11.465 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 71 fps= 26 q=30.0 size= 0kB time=00:00:02.46 bitrate= 0.2kbits/s speed=0.901x
2019-09-17 22:52:11.975 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 90 fps= 28 q=30.0 size= 0kB time=00:00:03.08 bitrate= 0.1kbits/s speed=0.953x
2019-09-17 22:52:12.489 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 102 fps= 27 q=30.0 size= 0kB time=00:00:03.48 bitrate= 0.1kbits/s speed=0.926x
2019-09-17 22:52:13.044 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 122 fps= 28 q=30.0 size= 0kB time=00:00:04.15 bitrate= 0.1kbits/s speed=0.963x
2019-09-17 22:52:13.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 131 fps= 27 q=30.0 size= 0kB time=00:00:04.45 bitrate= 0.1kbits/s speed=0.925x
2019-09-17 22:52:14.250 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 139 fps= 25 q=30.0 size= 0kB time=00:00:04.71 bitrate= 0.1kbits/s speed=0.854x
2019-09-17 22:52:14.944 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 151 fps= 24 q=30.0 size= 0kB time=00:00:05.13 bitrate= 0.1kbits/s speed=0.826x
2019-09-17 22:52:15.756 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 160 fps= 23 q=30.0 size= 0kB time=00:00:05.41 bitrate= 0.1kbits/s speed=0.77x
2019-09-17 22:52:16.271 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 166 fps= 22 q=30.0 size= 0kB time=00:00:05.61 bitrate= 0.1kbits/s speed=0.745x
2019-09-17 22:52:16.821 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 170 fps= 21 q=30.0 size= 256kB time=00:00:05.75 bitrate= 364.2kbits/s speed=0.712x
2019-09-17 22:52:17.409 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 175 fps= 20 q=30.0 size= 256kB time=00:00:05.92 bitrate= 354.2kbits/s speed=0.683x
2019-09-17 22:52:17.967 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 180 fps= 19 q=30.0 size= 256kB time=00:00:06.08 bitrate= 344.8kbits/s speed=0.659x
2019-09-17 22:52:18.508 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 188 fps= 19 q=30.0 size= 256kB time=00:00:06.36 bitrate= 329.7kbits/s speed=0.651x
2019-09-17 22:52:19.018 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 203 fps= 20 q=30.0 size= 512kB time=00:00:06.84 bitrate= 612.4kbits/s speed=0.666x
2019-09-17 22:52:19.517 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 222 fps= 21 q=30.0 size= 512kB time=00:00:07.47 bitrate= 561.0kbits/s speed=0.693x
2019-09-17 22:52:20.020 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 238 fps= 21 q=30.0 size= 512kB time=00:00:08.01 bitrate= 523.6kbits/s speed=0.71x
2019-09-17 22:52:20.598 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 255 fps= 21 q=30.0 size= 512kB time=00:00:08.59 bitrate= 488.2kbits/s speed=0.724x
2019-09-17 22:52:21.124 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 273 fps= 22 q=30.0 size= 512kB time=00:00:09.19 bitrate= 456.2kbits/s speed=0.742x
2019-09-17 22:52:21.649 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 291 fps= 23 q=30.0 size= 512kB time=00:00:09.79 bitrate= 428.1kbits/s speed=0.758x
2019-09-17 22:52:22.153 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 308 fps= 23 q=30.0 size= 512kB time=00:00:10.35 bitrate= 405.0kbits/s speed=0.772x
2019-09-17 22:52:22.661 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 328 fps= 24 q=30.0 size= 512kB time=00:00:11.02 bitrate= 380.3kbits/s speed=0.792x
2019-09-17 22:52:23.163 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 345 fps= 24 q=30.0 size= 512kB time=00:00:11.58 bitrate= 362.0kbits/s speed=0.803x
2019-09-17 22:52:23.678 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 364 fps= 24 q=30.0 size= 512kB time=00:00:12.21 bitrate= 343.4kbits/s speed=0.817x
2019-09-17 22:52:24.203 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 382 fps= 25 q=30.0 size= 512kB time=00:00:12.81 bitrate= 327.3kbits/s speed=0.828x
2019-09-17 22:52:24.705 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 400 fps= 25 q=30.0 size= 512kB time=00:00:13.39 bitrate= 313.1kbits/s speed=0.839x
2019-09-17 22:52:25.223 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 417 fps= 25 q=30.0 size= 512kB time=00:00:13.97 bitrate= 300.1kbits/s speed=0.848x
2019-09-17 22:52:25.760 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 435 fps= 26 q=30.0 size= 512kB time=00:00:14.58 bitrate= 287.7kbits/s speed=0.856x
2019-09-17 22:52:26.300 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 452 fps= 26 q=30.0 size= 512kB time=00:00:15.16 bitrate= 276.6kbits/s speed=0.863x
2019-09-17 22:52:26.818 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 472 fps= 26 q=30.0 size= 512kB time=00:00:15.81 bitrate= 265.3kbits/s speed=0.875x
2019-09-17 22:52:27.319 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 487 fps= 26 q=30.0 size= 768kB time=00:00:16.32 bitrate= 385.4kbits/s speed=0.878x
2019-09-17 22:52:27.835 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 506 fps= 26 q=30.0 size= 768kB time=00:00:16.95 bitrate= 371.2kbits/s speed=0.887x
2019-09-17 22:52:28.409 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 523 fps= 27 q=30.0 size= 768kB time=00:00:17.53 bitrate= 358.9kbits/s speed=0.891x
2019-09-17 22:52:28.908 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 542 fps= 27 q=30.0 size= 768kB time=00:00:18.15 bitrate= 346.5kbits/s speed= 0.9x
2019-09-17 22:52:29.485 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 559 fps= 27 q=30.0 size= 768kB time=00:00:18.71 bitrate= 336.2kbits/s speed=0.902x
2019-09-17 22:52:30.003 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 574 fps= 27 q=30.0 size= 768kB time=00:00:19.20 bitrate= 327.7kbits/s speed=0.903x
2019-09-17 22:52:30.568 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 585 fps= 27 q=30.0 size= 768kB time=00:00:19.59 bitrate= 321.1kbits/s speed=0.897x
2019-09-17 22:52:33.538 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame= 590 fps= 24 q=-1.0 Lsize= 940kB time=00:00:19.64 bitrate= 391.9kbits/s speed=0.792x
2019-09-17 22:52:33.539 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: video:684kB audio:233kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
2019-09-17 22:52:33.539 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 2.408828%
2019-09-17 22:52:33.546 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.546 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame I:3 Avg QP:16.74 size: 50776
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame P:163 Avg QP:16.60 size: 2431
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: frame B:424 Avg QP:18.25 size: 357
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: consecutive B-frames: 3.2% 1.4% 4.6% 90.8%
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: mb I I16..4: 31.1% 42.0% 26.8%
2019-09-17 22:52:33.547 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: mb P I16..4: 3.7% 3.7% 0.6% P16..4: 4.7% 0.5% 0.5% 0.0% 0.0% skip:86.3%
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: mb B I16..4: 1.4% 0.2% 0.0% B16..8: 0.7% 0.1% 0.0% direct: 2.2% skip:95.3% L0:43.9% L1:43.3% BI:12.9%
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: 8x8 transform intra:35.5% inter:56.5%
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: coded y,uvDC,uvAC intra: 8.9% 21.9% 6.5% inter: 1.0% 2.8% 0.1%
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: i16 v,h,dc,p: 61% 30% 6% 3%
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 14% 51% 1% 1% 1% 2% 0% 2%
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 24% 22% 2% 3% 3% 4% 3% 3%
2019-09-17 22:52:33.548 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: i8c dc,h,v,p: 65% 18% 16% 1%
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Weighted P-Frames: Y:16.6% UV:16.6%
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: ref P L0: 92.1% 7.9%
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: ref B L0: 76.5% 23.5%
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: ref B L1: 96.0% 4.0%
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [libx264 @ 0xaafba000]
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: kb/s:284.73
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: [aac @ 0xaafbaa80]
2019-09-17 22:52:33.549 13041-13630/com.digitalcapitan.vedette I/mobile-ffmpeg: Qavg: 16872.047
Well, your logs don't show any errors.
Are you sure that Config.enableStatisticsCallback is called before FFmpeg.execute?
Can you put some logs to make sure of it?
Ooooohhh
called before FFmpeg.execute?
Wow, can't believe I missed that. At first, I called it right after FFmpeg.execute
Then I moved to before, but that was with the whole runnable implementation.
Such a simple fix, thank you so much
Hi @tanersener Thanks for your awesome work. I've one question/suggestion Is it possible to include the progress percentage for the current command in Statistics. Or is there any other to get the progress of Audio/Video Muxing? Please let me know. Thanks
@nitinmishra27 I'd like to have it too. The problem is I need to know total duration, total size or total frame count to calculate the percentage but I don't know them.
@nitinmishra27 I'd like to have it too. The problem is I need to know total duration, total size or total frame count to calculate the percentage but I don't know them.
Did you get any solutions to display progressbar value?
How do you get remaining duration?
@tanersener
Here is the solution with progress value.
Get duration of video:
int videoLength = MediaPlayer.create(mContext, selectedUri).getDuration();
Config enableStatisticsCallback method:
Config.enableStatisticsCallback(new StatisticsCallback() {
public void apply(Statistics newStatistics) {
float progress = Float.parseFloat(String.valueOf(newStatistics.getTime())) / videoLength;
float progressFinal = progress * 100;
Log.d(TAG, "Video Length: " + progressFinal);
Log.d(Config.TAG, String.format("frame: %d, time: %d", newStatistics.getVideoFrameNumber(), newStatistics.getTime()));
Log.d(Config.TAG, String.format("Quality: %f, time: %f", newStatistics.getVideoQuality(), newStatistics.getVideoFps()));
progressDialog.setProgress((int) progressFinal);
}
});
com.arthenica.mobileffmpeg.FFmpeg.executeAsync(command, (executionId, returnCode) -> {
progressDialog.dismiss();
if (returnCode == RETURN_CODE_SUCCESS) {
Toast.makeText(mContext, "Video Saved in Folder : " + getString(R.string.app_name), Toast.LENGTH_SHORT).show();
Log.i(Config.TAG, "Async command execution completed successfully.");
} else if (returnCode == RETURN_CODE_CANCEL) {
Log.i(Config.TAG, "Async command execution cancelled by user.");
} else {
Toast.makeText(mContext, "Something Went Wrong", Toast.LENGTH_SHORT).show();
Log.i(Config.TAG, String.format("Async command execution failed with rc=%d.", returnCode));
}
});
Hope it will be helpful.
Most helpful comment
You can implement a
progressbarusingStatisticsCallbackinterface. Take a look at Android test-application to see how it is used.