How do I play a stream that has variable framerate video?

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
Videogamer555
Blank Cone
Blank Cone
Posts: 66
Joined: 07 Feb 2012 01:14

How do I play a stream that has variable framerate video?

Postby Videogamer555 » 25 Nov 2017 05:09

I'm not talking about variable bitrate, I'm talking about a video source that has variable frame rate. I need a way to make VLC player play video on an "as available" basis. This means that instead of seeing a lack of frames coming over the network as an indication of a slowdown of the network (which forces video buffering), I need it to simply play whatever frame it receives as soon as it gets it. If it doesn't get the next frame when it expects it, it should just keep the previous displayed while waiting for the next frame. Then as soon as it gets the next frame, it should display it without delay.

What's happening now is this. If it doesn't get the next frame when it expects it, it completely stops playing the video while it buffers like 4 seconds worth of frames, and then it plays those frames back at a constant frame rate (whatever frame rate it believes the video stream is supposed to be). I need it to ignore the frame rate specified by the stream, and even ignore the time stamps in the stream (as I'm not completely sure that they are encoded correctly). I need it to simply play the video frames as it gets them.

Is it possible to configure VLC Player to do this? If not, this post should be considered a feature request, that hopefully the VLC developers will read, and add this feature to VLC Player.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How do I play a stream that has variable framerate video?

Postby Jean-Baptiste Kempf » 26 Nov 2017 23:26

So far, not possible.

Do you have a sample?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Videogamer555
Blank Cone
Blank Cone
Posts: 66
Joined: 07 Feb 2012 01:14

Re: How do I play a stream that has variable framerate video?

Postby Videogamer555 » 27 Nov 2017 01:13

So far, not possible.

Do you have a sample?
My source is an FFMPEG encoded MPEGTS stream, and FFMPEG's source is an 8bit grayscale raw video stream piped from software I wrote that controls a thermal imaging camera. The output of FFMPEG is done via TCP, so FFMPEG acts as the server, and then VLC connects to it and receives the live MPEGTS stream. The problem is the camera doesn't have a fixed frame rate. These cameras have self calibration that stops them from sending video for about 1/4 of a second (this procedure is needed to adapt to the thermal imaging camera's own change in temperature as its electronics warm up so that this temperature can be subtracted from the thermal video stream), and this self calibration is performed about once every 2 seconds immediately after the camera is activated, and it has a frame rate of about 15fps or lower for the first 30 seconds after being activate. In fact, for like the first 2 or 3 seconds the frame rate is about 14fps. After about 30 seconds the self calibration process is not activated as often so the overall frame rate climbs to about 16fps after the first 30seconds. It continues to slowly climb, topping out at about 17fps after about 5 hours of running continuously. That's why my source has a variable frame rate, and it ranges between about 14 an 17 fps.

My FFMPEG command line is as follows.

Code: Select all

"thermalcam.exe"|ffmpeg -r 16 -f rawvideo -pix_fmt gray -s 324x254 -i - -f mpegts -b:v 1000k -listen 1 tcp://0.0.0.0:1234
Then in the VLC player GUI, I just go ctrl+n and type in the URL http://127.0.0.1:1234 and click play. At first the stream is coming slower than expected, and this causes VLC player to have to buffer once every 10 seconds or so. Later, when the frame rate is higher than expected, the video slowly drifts out of sync. It starts out with about a 3 second delay (delay between an event taking place, and you seeing it in VLC player), but after a couple minutes you are up to like a 15 second delay. As long as the frame rate is faster than VLC expects (based on timing and frame rate data in the MPEGTS stream), the delay increases without bound.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How do I play a stream that has variable framerate video?

Postby Jean-Baptiste Kempf » 28 Nov 2017 09:42

14 or 17 fps should play fine in VLC. Just increase the input buffer.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Videogamer555
Blank Cone
Blank Cone
Posts: 66
Joined: 07 Feb 2012 01:14

Re: How do I play a stream that has variable framerate video?

Postby Videogamer555 » 01 Jan 2020 00:37

14 or 17 fps should play fine in VLC. Just increase the input buffer.
How do I change the input buffer of VLC?
However, I don't think changing the buffer will work. The problem isn't it being 14 or 17 fps (fixed framerate). The real problem is that it's not a FIXED framerate. During the course of the video, it VARIES BETWEEN 14 and 17 fps. It starts at about 14fps, and increases to about 17fps, over the course of the video stream. It's 14 fps when the video starts, and it increases slowly over time, such that after about 5 hours it's at 17fps (and then remains at this frame rate). But the problem is that if it's at 14fps, then VLC expects it to STAY at at 14fps, and maybe only momentarily change framerate a little due to network speed changes (which can be compensated for by buffering the video). But buffering won't fix long-period changes in framerate, where the supplied video's framerate actually changes over time. That's why I don't think that VLC player, with its current features will work. And hopefully this is something that could be added in a future version.

So this should really now be seen as a feature request, and hopefully the VLC developers can add this feature in a future version.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 69 guests