[FFmpeg-user] PTS from raw input

Martin Scherer m.scherer at fu-berlin.de
Sun Jul 2 14:13:51 EEST 2023


Hi everybody,

I'd like to set the PTS of each frame originating from a RAW format 
storing the physical caputure time. The framerate could be varying.

Currently I do a 2-pass encoding to ensure maximum quality. I wonder if 
I could use the setpts filter in the second pass to correct the 
presentation time.

The ffmpeg invocation looks like this:

ffmpeg -f rawvideo -vcodec rawvideo -pix_fmt gray -s 1024x1280 -an -i - 
-threads 16 -vcodec vp9 -pix_fmt yuv420p -b:v 10M -pass 1 -y out.webm


I have the possibility to generate a simple text file where each line 
contains the timestamp per frame. How would I pass this into the setpts 
filter?

Or is there any chance to pass the timestamp during the first pass 
encoding already as the information is also available there.


Thank you very much for any advice,

Best,
Martin


More information about the ffmpeg-user mailing list