I am trying to write a client/consumer of live mpegts encapsulated
mpeg4 rtp streams. Currently, I can use either VLC or my own written
server to capture camera frames, encode the stream and send it to a
specified target. Streams sent from both VLC and my server are
compatible and can be consumed by VLC (I can see what the camera sees
through VLC).

av_open_input_file seems to be API call I need to use to access an rtp
stream. I can find no samples for use with an rtp url; all examples
provided (like drangers) are for parsing files. However all the
information I've been able to to find for this issue indicate that
simply calling av_open_input_file on a valid rtp url should be
sufficient to initialize the context properly...that it should work
equally well for an rtp stream as it would for a file. And it does
seem to work properly, because I get a valid context, and when I check
the structures contents, information on the stream's frame rate,
codecs, etc. are correct.

However, when I call av_read_frame and pass on the frame I get to
avcodec_decode_video2, I get a homogenous flat gray picture. When I
switch from mpeg4 to mpeg2, I get a wall of green with blotches
instead. Throughout this all, I'm not getting any errors from any of
the libav functions I'm using.

When I change the url I pass to av_open_input_file from an rtp url to
a file path to an mp4 video, my client successfully parses and decodes
the contents of the file (a movie trailer).

I seem to be missing information on proper usage of this function for
rtp streams. It doesn't seem to be as simple as just feeding it an rtp
url... Is there anything else I need to do during or after
initialization? Do I need to pipe the packet data I get into another
AVFormatContext to strip out mpegts headers for example? Is there
anyone who's done anything similar that can offer some advice on the
matter?
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to