Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffplay - change playback speed without re-encoding

I have some .264 video files that I would like to view at half playback speed, without encoding them into a new file. I remember using ffplay to do this in the past, but it was some time ago, and I can't seem to be able to do it now. From lots of searching, this is what is supposed to work:

ffplay -f h264 -vf "setpts=2.0*PTS" filename.264

However this does not seem to change the playback speed at all. If I try:

ffplay -f h264 -filter:v "setpts=2.0*PTS" filename.264

I get an error message saying 'Failed to set value 'setpts=2.0*PTS' for option 'filter:v': Option not found'.

I specifically remember being able to do this before but cannot find any information about this now. Converting the videos is not really an option because the files are finicky and often cause an error halfway through converting, corrupting the whole file.

Is there a simple solution to this problem? Am I typing one of the commands wrongly?

like image 851
Timothy Tan Avatar asked Nov 02 '16 00:11

Timothy Tan


2 Answers

Just managed to do this with the not-very-well-documented -framerate option for an MJPEG stream, for anyone else who finds this post but isn't necessarily using H264.

ffplay udp://224.0.1.2:5004 -f mjpeg -framerate 30
like image 108
Malvineous Avatar answered Nov 25 '22 21:11

Malvineous


Raw H.264 streams do not have PTS values. They do have a framerate, so use

ffplay -f h264 file.264 -vf "setpts=2.0*N/FRAME_RATE/TB"
like image 24
Gyan Avatar answered Nov 25 '22 19:11

Gyan