[FFmpeg-devel] mpeg2ts/udp --> broken display by set-top-box

Alexandre FERRIEUX - FT/RD/SIRP/ASF/SOFTL alexandre.ferrieux
Thu Jan 22 09:49:25 CET 2009


Hi Luca,

Luca Abeni wrote:
> Hi,
> 
> On Thu, 2009-01-22 at 00:55 +0000, M?ns Rullg?rd wrote:
> [...]
>>>> Of course I first thought about a problem in the bitstream or TS muxer, 
>>>> but... if I receive the same UDP flow and concatenate the contents in a 
>>>> .ts file, that file is played perfectly by mplayer/ffplay/vlc.
>>> Well, if the generated TS plays fine, this might indicate the TS is
>>> somehow correct.
>> The TS playing on a PC means very little.  It could still be
>> overflowing buffers on the STB.  I've been down that road.
> 
> Me too ;-)
> While I agree with Baptiste that in this specific case the problem might
> just be the missing "-re" option, I also experienced buffer overflow
> problems in the past (I mean, overflows in the receiving buffers of the
> client). These were mainly due to bad interleaving of audio and video:
> hardly noticeable with a software player, but very problematic with
> STBs.
> 
> Anyway, this night I took some time to look at the current situation. I
> have no access to STBs anymore (I changed my job), but I tried to have a
> look at the generated TSs. So, my conclusions might be wrong... In any
> case, my impression is that the TS muxer generates a quite bad TS for
> the first 20 or 30 seconds, then things start to be more reasonable. I
> suspect the muxer currently relies on receiving constant bitrate video
> (or, video without many variations in the bitrate)? At the beginning,
> the codec's rate control is "not very stable", so the muxer seems to
> have problems in correctly interleaving the video; but after the rate
> control starts to work properly, the TS muxer seems to be able to
> interleave the two ESs in a reasonable way.
> I am not sure if this is completely correct, but various experiments I
> repeated seem to confirm this theory...
> 
> Maybe setting a maxrate in the codec can help?

Thanks for all these hints, I will dig further.

A few "metalevel" questions though:

How would you rate FFmpeg's TS muxer wrt vlc's (libdvbpsi) ? Is it "just 
as good" ? Is it widely used ? In case of a negative answer, would it 
make sense to switch to libdvbpsi (no idea of licensing issues though) ?

Do you know of an existing tool that would take an existing .ts file and 
stream it over UDP (by chunks of 7 TS packets) at the proper speed 
without touching the mux ? ("ffmpeg -i file.ts -vcodec copy -f mpegts" 
still demuxes and remuxes).

TIA,

-Alex






More information about the ffmpeg-devel mailing list