Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
FFmpeg - Concatenate all videos with similar file name ?
24 décembre 2017, par Pan HartIs there any way to use ffmpeg to concatenate all video files that have the exact same file name for the specified first few characters?
For example, if I set it to match the first 5 characters, it will match and concatenate video_1.flv, video_2.flv, video_3.flv and so on.
But, at the same time, it can also match and concatenate tests_1.flv, tests_2.flv, tests_3.flv and so on.
Any help will be appreciated!
-
Play video overlay over video not working in ffmpeg
24 décembre 2017, par Sumit MarwhaI am trying to play video over another video using ffmpeg. When i am trying to play video from starting then overlay video plays. But if i try to overlay video from n seconds it doesn't work
ffmpeg -i input.mp4 -i overlay.mp4 -filter_complex [1:v]scale=920:920[out],[out][0]overlay=0:0:enable='between(t\,4\,8)'[out] -map [out] output.mp4
If i change
between(t\,4\,8)
tobetween(t\,0\,4)
then overlay video works normally. It is not working forbetween(t\,4\,8)
. Please help how to solve it -
Concatenate 2 or more gif files with ffmpeg android
24 décembre 2017, par Chathu_smWell, I have spent a great deal of time to find a way of combine gif files using ffmpeg library.But none of them seems to work for me.
What I have tried (I have used ffmpeg android java library):
String gif1=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)+"/gif1.gif"; String gif2=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)+"/gif2.gif"; String commandStr="-i concat:"+gif1+"|"+gif2+" -c copy "+file.getAbsolutePath()+"/output.gif"; String[]command=commandStr.split(" "); ffmpeg.execute(command, new ExecuteBinaryResponseHandler() { @Override public void onStart() {} @Override public void onProgress(String message) { // Toast.makeText(Main.this,"Progress: "+message,Toast.LENGTH_SHORT).show(); Log.e("Progress TAG: ",message); } @Override public void onFailure(String message) { Toast.makeText(Main.this,"Failed: "+message,Toast.LENGTH_SHORT).show(); Log.e("Failure TAG: ",message); } @Override public void onSuccess(String message) { Toast.makeText(Main.this,"Success: "+message,Toast.LENGTH_SHORT).show(); Log.e("Success TAG: ",message); } @Override public void onFinish() {} }); } catch (FFmpegCommandAlreadyRunningException e) { // Handle if FFmpeg is already running }
But above command gives an error like this.
ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8 (GCC) configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --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/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags= libavutil 55. 17.103 / 55. 17.103 libavcodec 57. 24.102 / 57. 24.102 libavformat 57. 25.100 / 57. 25.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 31.100 / 6. 31.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, gif, from 'concat:/storage/emulated/0/Pictures/gif1.gif|/storage/emulated/0/Pictures/gif2.gif': Duration: N/A, bitrate: N/A Stream #0:0: Video: gif, bgra, 500x500, 1.70 fps, 10 tbr, 100 tbn, 100 tbc Assertion video_enc->pix_fmt == AV_PIX_FMT_PAL8 failed at libavformat/gif.c:130
Can anyone please suggest me an efficient command to do this.
P.S: I have a dynamic file list so can't use the demuxing method which uses a text file.
-
Make VP9 encoding faster with the best possible quality without picture freezing
24 décembre 2017, par kostya572I am using this code to combine 2 files together (overlay file over original file):
ffmpeg -r 60 \ -i originalfile.webm -i overlayfile.mov \ -filter_complex " \ [0:v]setpts=PTS-STARTPTS[base]; \ [1:v]setpts=PTS-STARTPTS+0.5/TB, \ format=yuva420p,colorchannelmixer=aa=0.7[overlay]; \ [base][overlay]overlay=x=(W-w)/2:y=0[v]" -map "[v]" -map 0:a -c:a copy -c:v libvpx-vp9 -lossless 1 -threads 4 -quality realtime -speed 8 -tile-columns 6 -frame-parallel 1 -vsync 1 -shortest resultfile.webm
Encoding speed is not bad and quality output also, but after some time video picture could freeze for several seconds, then again it plays ok and then again could freeze.
How could I optimize this code to make fast speed with the highest possible quality as original file without picture freezing?
Thank you
-
Is there an ffmpeg flag to not ask for overwrite but add a number at the end ?
23 décembre 2017, par usbpc102I have a script that converts ~8000 files to mp3. I have some files that have a sielar name, where just the extension is diffrent, and they would create all the same .mp3 file with my script at the moment.
So I just want ffmpeg to add something like (x) at the end of the name befor the extension and not ask me every few files.
Thank you!