how does one loop a video using ffmpeg on android? -
i'm using hiteshsondhi88's "ffmpeg android java" library , works fine scaling, trans-coding, , overlaying. however, when try loop video same un-looped video on output.
my code:
string internalpath = getfilesdir().getpath(); //get internal directory string command = "-y -f concat -i "+internalpath+"/mylist.txt -c copy "+internalpath+"/final.mp4"; ffmpeg.execute(command, ffmpegresponsehandler);
the text in "mylist.txt" generated programmatically looks this:
file 'final_unlooped.mp4' file 'final_unlooped.mp4' file 'final_unlooped.mp4' file 'final_unlooped.mp4' file 'final_unlooped.mp4'
finally, log:
ffmpeg version n2.4.2 copyright (c) 2000-2014 ffmpeg developers built on oct 7 2014 15:11:41 gcc 4.8 (gcc) configuration: --target-os=linux --cross-prefix=/home/sb/source-code/ffmpeg-android/toolchain-android/bin/i686-linux-android- --arch=x86 --cpu=i686 --enable-runtime-cpudetect --sysroot=/home/sb/source-code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/source-code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/source-code/ffmpeg-android/build/x86 --extra-cflags='-i/home/sb/source-code/ffmpeg-android/toolchain-android/include -u_fortify_source -d_fortify_source=2 -fno-strict-overflow -fstack-protector-all -march=i686' --extra-ldflags='-l/home/sb/source-code/ffmpeg-android/toolchain-android/lib -wl,-z,relro -wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags= libavutil 54. 7.100 / 54. 7.100 libavcodec 56. 1.100 / 56. 1.100 libavformat 56. 4.101 / 56. 4.101 libavdevice 56. 0.100 / 56. 0.100 libavfilter 5. 1.100 / 5. 1.100 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 0.100 / 53. 0.100 input #0, concat, '/data/data/com.testapp/files/mylist.txt': duration: n/a, start: 0.000000, bitrate: 744 kb/s stream #0:0: video: h264 (high) (avc1 / 0x31637661), yuv420p, 640x640, 744 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc output #0, mp4, '/data/data/com.testapp/files/final.mp4': metadata: encoder : lavf56.4.101 stream #0:0: video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x640, q=2-31, 744 kb/s, 25 fps, 12800 tbn, 12800 tbc stream mapping: stream #0:0 -> #0:0 (copy) press [q] stop, [?] frame= 115 fps=0.0 q=-1.0 lsize= 420kb time=00:00:04.48 bitrate= 768.1kbits/s video:418kb audio:0kb subtitle:0kb other streams:0kb global headers:0kb muxing overhead: 0.509634%
the onsuccess() method in response handler launches indicating execution successful output still unlooped.
this command works fine on windows reason wont work on android. ideas of be, or doing wrong?
i managed find problem.
turns out had add line "/n" after each file name in "mylist.txt" this:
file 'final_unlooped.mp4' file 'final_unlooped.mp4' file 'final_unlooped.mp4' ...
instead of this:
file 'final_unlooped.mp4' file 'final_unlooped.mp4' file 'final_unlooped.mp4' ...
i hope finds useful.
Comments
Post a Comment