



Where I used the ac3 audio codec at a bitrate of 640K and the expression "24/25" which is allowed here :NOTE: the 24/25 is the inverse of the itsscale value of 25/24(=1.FFmpeg is a free and open-source command line-based tool to handle video, audio, and other multimedia files. If you have audio you would include an audio filter to rescale the audio without a pitch change by changing the tempo using the atempo settings, you should include a compressor and bit rate as well.įor subtitles, you just need to include the -codec:sįfmpeg -itsscale 1.0416667 -i "input file" -filter:a atempo="24/25" -codec:a ac3 -b:a 640k -vcodec copy -codec:s copy "output file"

Going from 23.976 to 24 or going from 29.97 to 30 this value would be 0.999) This will scale the frame rate times from 25 to 24 fps, keeping the same number of frames, but lengthening the video by 1.0416667. The itsscale value of 1.0416667 is 25/24 as a float variable for ffmpeg (0.1234567 is the float values format - don't use 1.04166666666666666667 or a double value : note that you can't use the expression/formula "25/24" here) You can try for example (to convert from 25 fps to 24 fps)įfmpeg -itsscale 1.0416667 -i "your input file" -vcodec copy "output file" Be aware that your file size will increase by a rather large factor when you decompress into raw streams. #unsigned 8-bit and place the output #in an avi container to ease frame accurate editing.įfmpeg -i "$f" -c:v huffyuv -c:a pcm_u8 "$f".aviĬlearly this script expects all files in the current directory to be media files but can easily be changed to restrict processing to a specific extension of your choosing. #This script will decompress all files in the current directory, video to huffyuv and audio to PCM I use a script for this as reproduced below: #!/bin/bash If this doesn't fit your requirements I suggest that you try this answer although my experience has been that it still re-encodes the output file.įor the best frame accuracy you are still better off decoding to raw streams as previously suggested. You can accomplish the same thing at 6fps but as you noted the duration will not change (which in most cases is a good thing as otherwise you will lose audio sync). I used the command ffmpeg -i inputfile -r 25 outputfile which worked perfectly with a webm,matroska input and resulted in an h264, matroska output utilizing encoder: Lavc56.60.100 I had a 24fps file I wanted at 25fps to match some other material I was working with. To the best of my knowledge you can't do this with ffmpeg without re-encoding.
