Differences between revisions 1 and 2
Revision 1 as of 2006-10-06 13:31:38
Size: 1206
Editor: kysucix
Comment:
Revision 2 as of 2008-06-26 09:48:02
Size: 1206
Editor: anonymous
Comment: converted to 1.6 markup
No differences found!

If you want to use an url protocol to output your encoded media (e.g. tcp://hostname:port) follow these instructions:

  • open your favourite media format as you would open it with a file:

AVOutputformat *aof = guess_format ("avi", NULL, NULL);
  • Use url_open () instead of url_fopen () and pass it an URLContext pointer and your url :

url_open (url_context, "tcp://hostname:port", URL_WRONLY);
  • Use url_open_dyn_buf on ByteIOContext of your AVFormatContext

        url_open_dyn_buf (&format_context -> pb)
  • Write your header:

        av_write_header( ... )
  • Send it to your url:

guchar *pb_buffer;
int len = url_close_dyn_buf(format_context -> pb, (unsigned char **)(&pb_buffer));
url_write (url_context, (guchar *)pb_buffer, len);

Do the same with av_write_frame:

  • Use url_open_dyn_buf() on ByteIOContext of your AVFormatContext

        url_open_dyn_buf (&format_context -> pb)
  • write your header:

        av_write_frame( ... )
  • Send it to your url:

guchar *pb_buffer;
int len = url_close_dyn_buf(format_context -> pb, (unsigned char **)(&pb_buffer));
url_write (url_context, (guchar *)pb_buffer, len);

Ffmpeg/UseUrlProtocol (last edited 2008-06-26 09:48:02 by anonymous)