--- On Tue, 13/5/08, Luca Abeni <[EMAIL PROTECTED]> wrote:

> From: Luca Abeni <[EMAIL PROTECTED]>
> Subject: Re: [libav-user] (no subject)
> To: "Libav* user questions and discussions" <[email protected]>
> Date: Tuesday, 13 May, 2008, 7:10 PM
> Hi Gavin,

Thanks for your help thus far.

> Gavin Smith wrote:
> [...]]
>  > My goal is to now packetize the H264 data into an RTP
> packet and stream
>  > it over a network to another node.
> > 
> > From what I read, it appears that FFMPEG already has
> the facilities to
>  > do what I want, is that correct?
> 
> Yes, it is. You just need to write the H.264 ES to an
> rtp://... URL (using
> the rtp output format).
> 

I was able to edit the output_example.c with some mixed success.  I was able to 
submit MPEG-2 (video) over rtp to a VLC client.

What I actually did was I "tricked" the AVOutputFormat *fmt variable by parsing 

fmt = guess_format("mpeg2video", NULL, NULL ) 

instead of:

fmt = guess_format("mpeg2video", filename, NULL );


This was a quick, easy hack, and I knew it would work because I was sure of the 
type of input source.  The above worked for "mpeg" (which I presume is mpeg1 
format - I couldn't exactly determine this from the VLC client).

All is well, but if I try and submit an h264 ES  (video-only) file over rtp and 
call:

fmt = guess_format("h264", NULL, NULL )

it appears to find the correct codec, but when I call the open_video function, 
it exits because it cannot find the h264 codec when calling 
avcodec_find_decoder.  I know for a fact that the AVOutputFormat is what I 
expect because fmt->video_codec == CODEC_ID_H264.

This isn't the end of the world, because I don't plan on using FFMPEG to 
encode...


> > 
> > In all honesty, I'm a bit unsure of where to
> start.
>  > I've been looking at some doxygen generated
> documentation (in the link below),
>  > and cannot quite determine which functions ought to
> be called.
> 
> Look at output_example.c to learn how to write a video ES
> into an output
> file. You can start with an avi file, for example. Once you
> have some code
> that successfully writes your H.264 ES in an avi, just
> change the output
> file name to "rtp://<dest addr>:<dest
> port>", and change the output format
> from avi to rtp.
> 
> You might want to call avf_sdp_create() to get an SDP
> describing the stream
> (needed to receive it). See ffmpeg.c for details.

Again, I successfully submitted the test clip over the network using RTP.  In 
addition, I managed to successfully create a valid SDP file using the 
avf_sdp_create function.

All that I have transmitted thus far has been the test clip.  Now, my end goal 
is to use my own encoder and my own h264 encoded data.  

I found the AVPacket struct which encapsulate the h264 data to be transmitted.  
I understand how to add data to the packet and the rest, but I'm unsure on how 
I can parse my h264 data (such that it recognizes NALs and the like) and add it 
to the packet.

All I get out of my own encoder is a byte array which is populated every now 
and then which [I suspect] contains a couple of h264 es frames.

Suggestions would be appreciated...

Gavin




      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to