New answers tagged

0

Is there any way to automate position for crossfade (last second of the video)? Not with ffmpeg alone (yet at least–there is a patch that never got applied that would simplify this). You can use ffprobe to get the duration of each input and use that to determine the values for setpts and fade. Example ffprobe command: ffprobe -v error -show_entries ...


1

You could do this by looping over the videos in a subshell, and piping to another copy of ffmpeg to generate the RTMP stream. For example: (for j in *.mp4; do ffmpeg -threads 2 -re -fflags +genpts -i $j \ -i '/c/Users/user/Desktop/ffmpeg_logo/mylogo.png' -filter_complex 'overlay=W-w-50:H-h-25' \ -vcodec libx264 -profile:v baseline -b:v ...


1

You can do either method. Short clips Take up less file space. Files are already cut. Long continuous shot Easier method when shooting, but more work in post. Easier to sync a continuous audio stream such as from an external mic.


1

Was not too far! ffmpeg -i input -vf "scale=1920:886:force_original_aspect_ratio=decrease,pad=1920:886:(ow-iw)/2:(oh-ih)/2:#CFD3DA@1" output.mp4


0

This is the Gyan's solution, and it works: ffmpeg -ignore_editlist 1 -i input.mp4 -map_metadata -1 -c copy output.mp4 The important part here is the -ignore_editlist 1 option (yet undocumented). The reason is that the original video contains for its video stream an edit list (elst box) with entryCount value set to 2 (which is ignored by some media ...


0

This might be a bit late but if it helps I've got a working PowerShell script that I use to create chapterized m4b files which I am assuming you are trying to do since you list m4b. I use the following command for mp3 format files ffmpeg -f concat -safe 0 -i list.txt -vn -y -b:a 64k -acodec aac -ac 2 temp.m4a If its already in AAC format (MP4) it's even ...


1

If all you need to do is superscale an image, going through the trouble of training neural networks is re-inventing the wheel. By all means, if you're studying computer science and are interested in AI/ML, I'd encourage you to look into it, but to just superscale an image, you don't need to train a neural network. There are tools available. In DaVinci ...


0

Sequential series 1.png %d.png 01.png %02d.png 001.png %03d.png 0001.png %04d.png image0001.png image%04d.png Non sequential series If they image inputs are not sequential then use the glob wildcard: ffmpeg -framerate 5 -pattern_type glob -i "*.png" output.mp4 The glob pattern may not be supported by Windows. In that case rename your images or ...


2

Thanks to @Gyan, I was able to fix it. ffmpeg -i input.mp4 -vf "geq=p(mod(X+Y*2\,W)\, Y)" output.mp4


0

Use the concat filter: ffmpeg -y -i a.mp4 -ss 2 -t 22 -i x.wma -ss 00:01:22 -t 19 -i y.mp3 -ss 29 -t 124 -i z.mp3 -filter_complex "[1:a][2:a][3:a]concat=n=3:v=0:a=1[a]" -map 0:v -map "[a]" -shortest output.mp4 Alternatively, instead of -ss/-t you can use the atrim and asetpts filters.


0

CABAC will give a small compression but increases the encoding time a bit.


0

Commands are instructions sent from an interface external to the filter, usually an external program using a ZMQ protocol. There is a filter that can execute commands which is what I'll use here. Base syntax is ffmpeg -i in -af "asendcmd=c='0.0 afftdn@n sn start; 1.0 afftdn@n sn stop',afftdn@n" noiseout.wav To use another source for noise profile, you'll ...


0

pts_time=6.506000 means an absolute presentation timestamp of 6.506 seconds. It's relative presentation time depends on the start_time of the file, for which use -show_entries format=start_time. ffprobe seeks to keyframes, so it will seek to the nearest KF at or before the specified time and then print info for the stated number of packets.


2

Use ffmpeg -i input.mkv -map_metadata 0 -map 0 -c copy -c:a:0 ac3 -vbr 3 output.mkv See https://superuser.com/a/1219824 for an illustrated guide to how stream options are parsed.


2

Basic syntax is ffmpeg -i in -vf "split=2[pip][full];[pip]crop=W:H:X:Y[pip];[full][pip]overlay=W-w:H-h,crop=iw-M:ih:M:0" -c:a copy out where W,H,X,Y are as per your diagram. M is the margin from the left edge which needs to be cropped out. Select M so that iw-M results in an even number.


2

Use -benchmark. You will see something like bench: utime=11.969s stime=0.315s rtime=1.908s, the rtime is what you want.


0

Use the overlay video filter: find "/video path" -name "*.mp4" | xargs -I $ "/ffmpeg path" -y -re -i $ -i watermark.png -filter_complex overlay -c:a copy -f flv rtmp://xxx.xxx.xx/live/ You can't filter video (-filter_complex or -vf) and stream copy (-vcodec copy) the same stream. If you try you'll get an error: Streamcopy requested for output stream 0:0,...


2

ffmpeg -y -i inputStream \ -row-mt 1 -s 1280x720 -b:v 1024k -minrate 512k -maxrate 1485k -tile-columns 2 -g 240 -threads 8 -quality good -crf 32 -c:v libvpx-vp9 -c:a libvorbis hd \ -row-mt 1 -s 640x480 -b:v 750k -minrate 375k -maxrate 1088k \ -tile-columns 1 -g 240 -threads 4 -quality good -crf 33 -c:v libvpx-vp9 -c:a libvorbis fsd \ -row-mt 1 -s ...


1

According to FFmpeg it supports multiple outputs created out of the same input(s) in the same process. The usual way to accomplish this is: ffmpeg -i input1 -i input2 \ -acodec … -vcodec … output1 \ -acodec … -vcodec … output2 \ -acodec … -vcodec … output3 This way ffmpeg can create several different outputs out of the same input(s). For ...


0

It's a bug in ffmpeg. When you explicitly specify a type of the HW acceleration (i.e. cuvid), ffmpeg assigns 0 to CUVIDDECODECREATEINFO::ulNumDecodeSurfaces and to CUVIDDECODECREATEINFO::ulNumOutputSurfaces. Consequently, a call to cuvidCreateDecoder fails, since NVDEC doesn't have surfaces to output decoded pictures.


0

The main reason lays in selecting an appropriate stream (audio or video) for filterchains with no input labels, for example -filter_complex "[0:v]hue=s=0,split=2[outv1][outv2];fade;afade The first filterchain [0:v]hue=s=0,split=2[outv1][outv2] has specified input label ([1:v]) but two others not. So: for the fade filter will be selected the first unused ...


0

ffmpeg -i "source.mov" -map_metadata 0 -pix_fmt yuv422p10le -c:v prores_ks -profile:v 4 -c:a pcm_s24le -movflags write_colr "out.mov" this will create ProRES (10bit) MOV file (map_metadata allows to keep recording dates). Audio will be PCM 24bit. Timecode will be also copied by default. If you want to flag ProRES as full range you add: -color_range pc. By ...


1

Similar to Gyan's overlay answer, a slightly simpler version can use a basic -filter_script with the "swaprect" and "crop" filters. Move the crop target to 0,0 and then crop the target area at 0,0. The target has to be swapped to 0,0 as otherwise the other swapped rect can overlap. This worked with ffmpeg version 3.4.6-0ubuntu0.18.04.1 Make sure the ...


0

According to the wiki, you are likely to get worse results with the default AAC encoder when using VBR. See: https://trac.ffmpeg.org/wiki/Encode/AAC One suggestion would be to use libfdk_aac. The other would be to demux the audio, re-encode it using a different encoder, and then remux that file back in to the video using ffmpeg.


Top 50 recent answers are included