RT, i have two avi file,
A.avi: fps 30 tbr 30 tbn 30 tbc 30.
B.avi: fps 2 tbr 2 tbn 2 tbc 2.
the problem is how to set the same value 30 on B.avi?
You can re-encode with a specified frame rate:
ffmpeg -i B.avi -codec:v mpeg4 -r 30 -qscale:v 2 -codec:a copy C.avi
What these options mean:
-codec:v mpeg4
- Use the encoder called mpeg4
for MPEG-4 Part 2
video.-r 30
- Set output frame rate as 30.-qscale:v 2
- Set video output quality using a constant quantization parameter. Recommended range is 2-5 for mpeg4
.-codec:a copy
- Copy the audio from input to output to avoid re-encoding.Note that ffmpeg
will simply duplicate frames to achieve your desired output frame rate. If instead you were reducing your frame rate ffmpeg
would drop frames.
You can change timebase or tbn
tbc
by -video_track_timescale
, e. g. to change the tbn
and tbc
to 30:
ffmpeg -i 1.avi -c:v copy -video_track_timescale 30 1.avi
if you want more presice control, not only control fps. but also tbr, tbn, tbc. assume you understand what mean of it. tbc,tbn,tbr
check
ffmpeg -x264opts timebase=???
or
ffmpeg -time_base
or use format factory, default it give you same tbr, tbn, tbc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With