FFmpeg is not using all frames for video output - ffmpeg

I am trying to use FFmpeg to make 1457 frames into a video, and it's not working.
I am using this command:
ffmpeg -i "frame%6d.png" -framerate 24 -c:v libx265 -preset slow -crf 17 -vf "scale=4096x4096" -pix_fmt yuv420p -an -movflags faststart -r 24 "video.mp4"
The problem is that it stops collecting frames after 1399, and I have no idea why. I have tried changing to fps=24 instead of -r 24 for the output but that didn't work. I have also tried adding one more frame at the end of the image sequence and then the command stopped after frame 1400. I also tried changing the name of the last frame to a bigger number but then the command stopped at frame 1399 again. Why is this happening?

Related

ffmpeg error: Unable to find a suitable output format for 'scale=1500:1000'

I am trying to convert a bunch of images into a video. The original image resolution is 6000x4000, but if I use ffmpeg to create a video with that resolution, no player can even play it because it's way to huge.
I tried to set the output resolution as such, dividing the input resolution by 4:
ffmpeg -r 60 -s 1500x1000 -start_number 3790 -i DSC_%04d.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p ../video_lowres.mp4
This had no effect and still produced 6000x4000 video. So instead, I tried this parameter: scale=1500:1000 The full command I ran:
ffmpeg -r 60 scale=1500:1000 -start_number 3790 -i DSC_%04d.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p ../video_lowres.mp4
But I got this error:
[NULL # 000002ad897bd9c0] Unable to find a suitable output format for 'scale=1500:1000'
scale=1500:1000: Invalid argument
How can I create a downscaled video from photos using ffmpeg?
You need to enter -vf before scale to tell FFmpeg that you want to use a video filter. Also, it should be specified after the filename of the image as it's an output option, not an input option. You can put it just before the output name:
ffmpeg -r 60 -start_number 3790 -i DSC_%04d.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p -vf scale=1500:1000 ../video_lowres.mp4

FFMPEG not getting a smooth video

I am trying to record my screen using ffmpeg but i am not getting a smooth video. Below is the command line code used. I am using windows 10;
ffmpeg -f gdigrab -framerate 30 -i desktop output.mp4
is there is any extra setting to get a good video
Currently output video is playing like missing frames
I myself found the answer, I changed the code like below
ffmpeg -f gdigrab -framerate 24 -probesize 42M -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
Actual i had a warning "Stream #0: not enough frames to estimate rate; consider increasing probesize" so i increased the probesize and added the ultrafast preset.
Now it is recording with good quality...

FFMPEG is zoompan works on first and last only

I want to convert images to video which works fine with ffmpeg but i need to add ken burns effect to every images.
the code i was to get only only works on the last and first images (the effect i mean).
ffmpeg -y -i %d.jpg -t 25 -pix_fmt yuv420p -vf zoompan=z='zoom+0.001':s=1280x800,scale=hd1080 -c:v libx264 -preset fast -crf 22 -t 300 -threads 2 zoomout.mp4
SOLVED
the problem is from the images, so i used new set of images

Fade out in ffmpeg when creating a video from a still image is wonky?

I'm creating a video that:
uses a still image as a source
has a text overlay
fades in and out
has a silent stereo audio track.
So far, I have this, and it (almost) works correctly:
ffmpeg -f lavfi -i "aevalsrc=0|0" -loop 1 -i turtle-2.jpg -c:v libx264 -t 5 -r 30 -s 1920x1080 -aspect 16:9 -pix_fmt yuv420p -filter:v drawtext="fontsize=130:fontfile=comic.ttf:text='hello world':x=(w-text_w)*.25:y=(h-text_h)*.75",fade=in:0:60,fade=out:90:60 -acodec aac turtle11.mp4
The only problem is that the fade out doesn't seem to be going to black, even tho this is a 150 frame video and I believe I am following the ffmpeg documentation correctly.
The resulting video is here:
http://video.blivenyc.com/vid-from-image/turtle11.mp4
Any thoughts?
Well, I'm not sure why but this works, even tho it appears to be equivalent:
ffmpeg -f lavfi -i "aevalsrc=0|0" -loop 1 -i turtle-2.jpg -c:v libx264 -t 5 -r 30 -s 1920x1080 -aspect 16:9 -pix_fmt yuv420p -filter:v drawtext="fontsize=130:fontfile=comic.ttf:text='hello world':x=(w-text_w)*.25:y=(h-text_h)*.75",fade=t=in:st=0:d=1,fade=t=out:st=4:d=1 -acodec aac turtle12.mp4
Basically, frame-based syntax:
fade=in:0:60,fade=out:90:60
gets substitued with time-based:
fade=t=in:st=0:d=1,fade=t=out:st=4:d=1
And somehow it works. Not sure why this is.
The video stream on which the fade filter operates is not 150 frames long. Input and output framerates are different here. The use of -r to set output rate happens after all filtering is done. At that stage, ffmpeg will drop or duplicate frames to obtain the output rate.
The input rate for an image or image sequence is 25, unless expressly set otherwise. In your command, since there is no override, it's 25. So fade out of 60 frames starting at frame 90, will end at frame 125 (5 seconds x 25). ffmpeg will duplicate 5 frames of each input second to get it to 30.
To get the desired result, use
ffmpeg -f lavfi -i "aevalsrc=0|0" -loop 1 -framerate 30 -i turtle-2.jpg -c:v libx264 -t 5 -s 1920x1080 -aspect 16:9 -pix_fmt yuv420p -filter:v drawtext="fontsize=130:fontfile=comic.ttf:text='hello world':x=(w-text_w)*.25:y=(h-text_h)*.75",fade=in:0:60,fade=out:90:60 -acodec aac turtle11.mp4

Image sequence of 1500 frames to loop 30 times in a 30 min video FFMPEG

Really struggling to get this to work, I just need to loop an image sequence. It is 25fps and exactly one second in duration (1500) I need this to basically loop for 30 mins, so it will loop 30 times. Using FFMPEG, here is the working 1500 frames being converted to MP4, like i said it has to be 30 mins in length:
ffmpeg -i "input_%04d.jpg" -c:v libx264 -b:v 1M -s 1080x810 -crf 28 -r 25 -pix_fmt yuv420p out.mp4
Use -loop 1 as an input option for an infinite loop, and then use -t 00:30:00 as an output option to cut off the video at thirty minutes. I would also suggest that you have a look at the H.264 Encoding Guide, and the FFmpeg wiki in general.
ffmpeg -loop 1 -i "input_%04d.jpg" -c:v libx264 -s 1080x810 -preset veryfast -crf 28 -r 25 -pix_fmt yuv420p -t 00:30:00 out.mp4

Resources