New answers tagged

0

FFmpeg uses functions, rather than operators, for conditional execution and comparisons, so t<2 is not a valid syntax. The syntax for your given command would be ffmpeg -i input.mp4 -i overlay.mov -filter_complex \ "[0][1]overlay=x=if(lt(t\,2)\,t*3\,t*5)[out]" \ -map '[out]' -c:v qtrle -y output.mp4 where lt(var,value) is the less than ...


0

What you can do is add a blank 30 second segment in front of the camera stream, and then use the method in the ffmpeg wiki. Basic template is ffmpeg -f lavfi -i color=black:WxH:r=FPS:d=30 -i camera_input \ -filter_complex "[0][1]concat[v]" -map "[v]" StreamingOutput WxH should be set to the camera's resolution and FPS to its framerate. And the ...


0

I am able to get the hw-acceleration working through ffmpeg using Nvidia graphics card. I just thoroughly followed the steps described here. Hw Acceleratoin guide


0

I found this method on serverfault.com and it seems to restart ffmpeg on error: cmd=ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i ${source_url} \ -acodec libmp3lame -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 \ -i /dev/zero -vcodec libx264 -preset medium -s 1280x720 -g 6 -r 3 \ -f flv ...


3

Your audio is PCM, but you're trying to streamcopy to AAC, which won't work. To extract the audio to WAV, use ffmpeg -i DSCN5008.AVI -acodec copy -y a.wav To transcode the audio to AAC, use ffmpeg -i DSCN5008.AVI -acodec aac -y a.aac Note that AAC isn't lossless. But FLAC is a lossless and compressed codec. ffmpeg -i DSCN5008.AVI -acodec flac -y ...


2

It's rather a powershell-specific question than FFmpeg, but here you go: ffmpeg -i <input> <some_encoding_options> -f mp4 "my_filename_"$(get-date).ToString("yyyy-MM-dd_HH-mm")".mp4" Change the parameter of ToString to whatever you want, you can find more info about PS date formatting syntax here. A little cheatsheet (all of these have ...


2

Use ffmpeg -i video.mp4 -filter_complex \ "[0]scale=iw*sar:ih,setsar=1,scale=-1:960,crop=960:960,split[left][right]; \ [left][right]hstack[sbs]" -map "[sbs]" -map 0:a? out.mp4


3

You can use ffmpeg, a free command-line tool, to do this. The basic command is ffmpeg -i input.mov -vf "setpts=(PTS-STARTPTS)/30" -crf 18 output.mov The 30 indicates the factor by which the video will be sped up.


1

Streaming formats maintain timestamps for each frame, whether audio or video, which govern when the player ought to present them. Those non-zero big start times usually occur when a snippet is cut out from a longer video and the tool used does not reset the timestamps. Although if this FLV was recorded on its own, then it's strange. In any case, running the ...


1

Using the mask image below, you can use ffmpeg to crop and output a MP4 with the visual content bounded in the same elliptical shape as the mask ffmpeg -i input.mp4 -loop 1 -i 360mask.png \ -filter_complex "[0]split[a][b]; \ [a]crop=iw/2:1522:0:300,crop=iw*0.8:ih*0.8,scale=960:-1,pad=960:960:0:150[l]; \ ...


2

First, setup a color filter of the same height, and then add it to the hstack -filter_complex "color=black:5x240[c];[v1][c][v2]hstack=inputs=3:shortest=1[videoout]" See the options for the color filter here. Alternate method is -filter_complex "[0]pad=iw+5:ih:color=black[0v];[0v][v2]hstack[videoout]"


3

Use [0:v]scale='if(gt(a,4/3),-1,320)':'if(gt(a,4/3),240,-1)',setsar=1,crop=320:240[v0c] The scale filter expressions for x and y check the aspect ratio of the input and if greater than 4:3, set the value to the 2nd argument, and if not, to the third argument. The -1 means that the original aspect ratio should be preserved e.g. scale=-1:400 applied to a ...


2

MKV does not store a frame rate in its container. So ffmpeg/vlc looks at the default duration of a frame instead. It sees 33.333ms and does the math, which is where your weird number comes from. Source: https://github.com/mbunkus/mkvtoolnix/wiki/Wrong-frame-rate-displayed To test this out, you can run ffprobe with -show_frames. I think you'll find the ...


4

Use ffmpeg -i file1.avi -i file2.avi -filter_complex "[0][1]vstack" -t 10 joined.avi This will stack the videos vertically and play the first 10 seconds of each. Remove the -t option if the videos are longer and you wish to extend the output. This command also uses the default parameters to encode the video i.e. codec will be MPEG4 Part 2 (Xvid..). If ...


1

Use -vf loop=parameters filter, see fine documentation. Note that this currently will put all video frames in memory.


0

It's an artifact of the player, not the encoder. I used the command below to generate a RGB format capture in HuffYUV ffmpeg -f dshow -video_size 1920x1080 -framerate 30 -i video="screen-capture-recorder" -c:v huffyuv -t 5 cap.mkv Then transcoded the file to x264 lossless RGB ffmpeg -i cap.mkv -c:v libx264rgb -crf 0 -preset ultrafast h264rgb.mkv ...


0

As mentioned by @Mulvya, I think the issue is the "slow" preset. One option is encoding a compressed stream that is also lossless. For example, the x264 encoder can do this using "-preset ultrafast -qp 0". This will probably result in failing your 3rd requirement (compatibility), but since it's lossless, you can transcode later onto cheap spinning disks. ...


1

Use ffmpeg -re -stream_loop -1 -i file.flv -c copy -f flv rtmp://x.y.z This option is buggy when the input it is applied to is filtered with another input, like in an overlay. For a single input - output chain, it works fine.


3

Short answer is No. Longer answer is, it depends. If you're encoding a file, then generally the output is the duration of the input, unless there's speed change or trim filters or -ss, -to, -t options applied. For a live input, FFmpeg will stop the encode when it encounters EOF on the input, so unless you know that, you won't know the output duration. For ...


2

Private options are switches/flags only applicable to specific encoders or decoders, and ignored by anything else. To see the available private options for an encoder, use avconv -h encoder=name e.g. avconv -h encoder=flv For LibAV, these are the private options available for the MPEG-1 & 2 encoders. { "mpv_flags", "Flags common for all ...


0

Use this: ffmpeg -i input.mp4 -filter_complex \ "[0:v]crop='if(gte(iw,ih),ih,iw):if(gte(ih,iw),iw,ih)',scale=720x720,split=3[1v][2v][3v]; \ [1v]trim=0:4.95,setpts=PTS-STARTPTS[v1]; \ [2v]trim=4.95:6.75,setpts=(PTS-STARTPTS)/0.1[v2]; \ [3v]trim=6.75:8,setpts=PTS-STARTPTS[v3]; \ [v1][v2][v3]concat=n=3:v=1:a=0[out]" \ -map [out] -an -c:v libx264 ...


2

It's possible. Use ffmpeg -loop 1 -i image.png -f lavfi -t 5 -i anullsrc -i video.mp4 -i music.wav \ -filter_complex "[0]trim=duration=5,fps=N[pre];[3]showwaves=WxH:r=N[b]; \ [b][0]overlay=shortest=1[post]; \ [pre][1:a][2:v][2:a][post][3]concat=n=3:v=1:a=1[v][a]" \ -map [v] -map [a] out.mp4 The image and video have to be ...


0

I further analyzed this issue and found that, it exists even with 2.8.1 version of ffmpeg. But surprisingly first frame is duplicated only while transcoding input video with 23.976 fps!!! When I transcode video with any other fps (24, 25, 29.976, 30) initials frames seems fine.


1

Most videos use codecs which perform temporal compression, so a specified cutpoint may rely on frames before (and after) that cutpoint to be correctly decoded. So, when you use ffmpeg to trim videos and use copy mode, ffmpeg has to include all frames before and after the trimmed segment which are needed to decode the segment correctly. So, you have two ...



Top 50 recent answers are included