[FFmpeg-devel] UDP constant bitrate feature (cbr)

Zach Swena zcybercomputing at gmail.com
Wed Nov 18 00:06:27 CET 2015


Hi Pavel,

I can confirm that there is a problem with the UDP packet engine in
FFmpeg.  FFmpeg has excessive jitter in it's UDP streaming output to the
point where hardware decoders can't handle it.  My solution was to buffer
to disk and have my own program read and send the datagrams via a very
tight event loop.  While increasing the PCR period is not a bad thing,
FFmpeg really should stream at a more consistant rate.  Can someone explain
the theory behind how the UDP rate control is currently implemented in
FFmpeg?  PCR sounds like a good way to tell when to send a packet, except
not every packet contains one.  If FFmpeg uses PCR to tell how long to wait
to send a packet, then do the packets in between go at line speed?  I plan
on taking a look at the code that does this, but I would really appreciate
it if someone who knows the code could explain the theory as I usually deal
with a slightly different dev setup.

Zach



On Mon, Nov 16, 2015 at 2:55 AM, Pavel Meshkov <pmeshkov at kwikflixtv.com>
wrote:

> Good day.
> We still need this feature. Can someone implement above functionality on
> bounty base (up to $2000)?
>
> 12.11.2015 12:28, Pavel Meshkov пишет:
>
> Thanks for explanation.
>> We will try to rewrite it with new knowledge.
>>
>> I need your suggestion.
>> We are try to send constant udp stream from rtmp live stream with only
>> repack it.
>>
>> I found "mpegts_write_packet_internal" function
>> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/mpegtsenc.c#L1402
>> is it right place to make changes?
>>
>>
>>
>> 2015-11-12 1:47 GMT+03:00 Kieran Kunhya <kierank at obe.tv>:
>>
>> On 11 November 2015 at 22:41, Kieran Kunhya <kierank at obe.tv> wrote:
>>>
>>>> On 11 Nov 2015 7:08 p.m., "Pavel Meshkov" <pmeshkov at kwikflixtv.com>
>>>>
>>> wrote:
>>>
>>>> Trying to reattach patch
>>>>>
>>>>> 11.11.2015 22:01, Pavel Meshkov пишет:
>>>>>
>>>>>> We added UDP output constant bitrate functionality.
>>>>>> Please review patch.
>>>>>>
>>>>>> P.S.: It's first patch we send. Please notify me if something made
>>>>>>
>>>>> wrong.
>>>
>>>> This an awful hack.
>>>> Kieran
>>>>
>>> I have been asked to explain why this is bad.
>>> You want to use FFmpeg to stream an mpegts - the only correct way to
>>> do this is to index the ts like "multicat" does and then use the PCR
>>> to schedule the output timing.
>>>
>>> Kieran
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list