Wednesday, 15 April 2015

c++ - Using FFMPEG libs to UDP stream mpeg2 ts video delay / initial connection problems -


Currently some MPEG 2 tex (H.264 encoded) videos are using Lib F with FFPMEG. Streaming is done through UDP multicast.

The issue I am currently having is the two main things. I have got a long time to have the initial connection time / video to show (the stream also includes metadata, and this stream is my media Tool is detected instantly)

Once the video runs, it gets cured, but the timing of that initial connection is always delayed.

I am trying to be near streaming live as much as possible.

Currently using av_dict_set (& dict, "tune", "zerolatency", 0) and "profile" -> "base line" option.

GOP size = 12;

First of all I thought that this problem was a frame issue, but the initial delay is if gopsize is 12 or the default is 250. Sometimes the video will be connected quickly, but it is dropped immediately, there is a delay, then it starts back and is good at that point.

According to the documentation, to limit initial synchronization delay, the zero latency option should be sent to multiple frames.

I started thinking about the issue of a buffering type, such as when I close the application and release the media player, it progresses fast till it does not run basically Where file streaming is turned off.

So when I do not fully understand what was wrong, then at least The problem was fixed.

This issue came from av_write_interleaved_frame () versus regular av_write_frame () (this works for a live streaming), when writing video frames. In order to fully understand the sick, you have to slip a bit in the gap, but sometimes it is funny how you understand the whole problem after pushing your face for a few days.

I can streaming a very good live ish video with the tune "Zirollancy" option set.


No comments:

Post a Comment