FFmpeg merge images to a video [closed] - image

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
How can I create a mpg/mp4 file from let's say 10 images using ffmpeg.
Each image shall stay for 5 minutes, after the 5 minutes are over the next image shall appear and so on....
How can I achieve this?

If your images are numbered in a sequence (img001, img002, img003..), use
ffmpeg -framerate 1/300 -i img%3d.jpg -r 5 video.mp4
(I've set an output framerate of 5 for player compatibility. Each image will still remain for 300 seconds)
If your filenames are irregular, and you are executing in a Unix shell like bash, you can run
ffmpeg -framerate 1/300 -pattern_type glob -i '*.jpg' -r 5 video.mp4
For MPEG-2,
ffmpeg -framerate 1/300 -i img%3d.jpg -c:v mpeg2video -b:v 2000k -r 5 video.mpg
No idea what minimum output framerates are expected of MPEG-2. Experiment.

Related

FFMPEG: get last 10 seconds [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
I'm trying to get the 10 last seconds of a video of which I dont know the length and then save those 10 seconds as a new video. Is this do able with the ffmpeg command prompt? And if so, how?
Thanks for the help
Greets
Use the -sseof input option. From the documentation:
-sseof position (input)
Like the -ss option but relative to the "end of file". That is negative values are earlier in the file, 0 is at EOF.
Example:
ffmpeg -sseof -10 -i input.mp4 output.mp4
Note that in stream copy mode (by using the -c copy output option or equivalent) the cut will occur on the nearest keyframe, so it may cut on your exact desired time. If more accuracy is needed you will have to re-encode instead of stream copy.

FFmpeg command to apply multiple filters and limit the final file size [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I'm using ffmpeg command below to convert video to a format of the defined scale and in order to hardcode the subtitles
Original syntax
ffmpeg -i "Original File.mov" -vf subtitles=Subtitles.srt -vf scale=1920:1080 \
-crf 12 "Final File".mov
Problem
I would like to expand this command further and:
ensure that the produce file is under 2GB
I would like to include additional parameters with advanced subtitle options, like setting the canvas size and fixing the potential delay
Side notes
I reckon that in case of predefining the file size the -crf 12 paramater will be redundant?
You can sort of set an upper limit on file size by defining an average bitrate e.g. -b:v 4000k and maximum bitrate -maxrate 5000k -bufsize 5000k, based on the duration of your video. as explained at FFmpeg wiki. You can use CRF in place of -b:v but you'll need to keep the maxrate and bufsize.
To apply multiple filters, you specify them in one filterchain, separated by commas, so:
-vf subtitles=Subtitles.srt,scale=1920:1080
As far as I know, those advanced subtitle optionsare applicable to subtitles presented as a regular input, not via the hardcoding subtitles filter

ffmpeg: smooth, stable timelapse videos from normal speed videos [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
For a one hour dash cam video in normal speed, is it possible to create a smooth timelapse video from it?
Most tutorials online I found about "timelapse + ffmpeg" are with static jpeg files combined into a timelapse video. These often result jiggle between frames, are the any specific parameters which would make the video looking very smooth & stable?
Should I just setpts=0.5*PTS for the trick? Any must-have or little-known tricks?
Update: this question is asking for specific programmable ffmpeg parameters.
Yes, that's the way specified in the ffmpeg wiki: How to speed up / slow down a video.
ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" output.mkv
setpts also supports expressions if you feel creative and want to speed up/ slow down based on a curve rather than a constant value.
Eg: -filter:v "setpts=gauss(T/100)*PTS"

Extracting more than one Video using ffmpeg? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have multivideo stream and i want to extract that both video that are encapsulated inside the container stream.
Any idea how should i extract two video using ffmpeg?
you are looking for the -map option. you can create multiple output definition like below
ffmpeg -i muxed.mp4 -c:v copy -map 0:0 video1.m4v -c:v copy -map 0:1 video2m4v -c:a copy -map 0:2 audio1.m4a -c:s copy -map 0:3 subtitle1.srt -c:s copy -map 0:4 subtitle2.srt
each output is define by a set of parameters that start with the -c:v option

Asking ffmpeg to extract frames at the original frame rate [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
On the FFmpeg documentation (here, and here) I read that, by default, FFmpeg chooses to extract frames at 25 frames per second (otherwise you can specify a framerate with the -r option)
My problem is that I have a folder with dozens of videos, each of them recorded at different frame rates, so my question is:
Is there a way to ask FFmpeg to extract frames from a video at the "native" frame rate (i.e. the original frame rate at which the video was recorded)?
In case it matters, I am working with MP4 files
To get the original frame rate:
ffmpeg -i file.mp4 2>&1 | grep -o '[0-9]\{1,3\}\sfps'
Example Output:
25 fps
You can futher pipe it to sed ... | sed 's/\sfps//' to keep only the 25, and store it into a variable, so you can use that variable to convert the videos e.g. ffmpeg -r $originalFps.
grep -o will extract the match, instead of the whole line containing the match.
[0-9]\{1,3\} will match one to three digits
\sfps will match a white space followed by 'fps'

Resources