On Wed, Feb 16, 2011 at 4:02 PM, Steffen Ebersbach
<[email protected]> wrote:
> On 16.2.2011 08:42, michael chua wrote:
>>
>> While examples for writing an encoded video stream into a file
>> container are relatively abundant, I'm having trouble transmitting my
>> MPEG4 encoded streams into VLC for viewing. libav isn't giving me any
>> errors for the code I'm running, and using a packet filter, I can tell
>> both that my test app is sending UDP packets, and that VLC is
>> receiving them, but they aren't being processed correctly (nothing is
>> being displayed). I suspect that there's something wrong with the way
>> I'm initializing my libav structures, or how I'm sending them to
>> unicast target, but having gone through all the samples I could find,
>> and going through the libav headers, I've run out of options to try.
>
> Can you tell us, what Messages are in the output of vlc? I remember on the
> fact, that vlc only plays udp-Stream if inside is a mpeg-ts, but not sure.
>

The last 3 lines are:

main debug: TIMER module_need() : 0.904 ms - Total 0.904 ms / 1 intvls
(Avg 0.904 ms)
main debug: `rtp://@:6001' successfully opened
macosx debug: input has changed, refreshing interface

After that, nothing. I can dump the entire log if it would help. This
is the result when I listen to rtp://:6001

I think you might be right about needing to be contained within an
MPEG2TS mux for RTP to work in VLC. Would you happen to know of any
clients without this limitation? And is their a guide for muxing in
MPEG2TS before sending packets to the RTP target? Does ffserver do
this for outgoing RTP streams?

As an experiment, I tried using plain udp instead (udp://:6001), and
the streaming sort of worked. Frames were being received by VLC and
displayed, but the quality was very poor (lots of artefacts, blotchy
colors, and smudging). I was getting lots of errors in VLC's message
log too:

main warning: late picture skipped (8732 > -9382)
avcodec warning: cannot decode one frame (199 bytes)
avcodec warning: cannot decode one frame (378 bytes)
avcodec warning: cannot decode one frame (12 bytes)
avcodec warning: cannot decode one frame (12 bytes)
avcodec warning: cannot decode one frame (35 bytes)
avcodec warning: cannot decode one frame (519 bytes)
avcodec warning: cannot decode one frame (522 bytes)
avcodec warning: cannot decode one frame (378 bytes)
...

I think packets were probably being lost, so VLC couldn't decode some
frames. This is probably the consequence of using plain UDP...

>> I'm particularly unsure about when it would be proper to call
>> av_write_header.
>
> It must be called before the first packet was send, so I think it's in the
> right position at your code.
>
>
> Steffen
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to