Server for rtp storing video.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Server for rtp storing video.

Vasya V. Veremeenko
Hi.

I creating server for storing video on server. User connect to server using rtp protocol.
For store one inciming video I use sdp input format. But for opening more then one connect av_read_frame() may be need not blocking thread.

My program create sdp file in memory and use url_open_buf() for send this data to sdp format.

static const char* _S_SDPHeader =
    "s=No Name\r\n"
    "m=video 5000 RTP/MVP 32\r\n"
    "c=IN IP4 127.0.0.1\r\n";

[....]

  AVInputFormat *fmt = av_find_input_format("sdp");
  AVFormatContext *ctx = av_alloc_format_context();

  AVCodecContext *c = ctx->streams[0]->codec;
  AVCodec *pCodec = avcodec_find_decoder(c->codec_id);
  avcodec_open(c, pCodec);

  url_open_buf(ctx->pb, (uint8_t *)_S_SDPHeader, strlen(_S_SDP_Header), 0);

  param->prealloced_context = 1;
  av_open_input_stream(&ctx, ctx->pb, "", fmt, param));

 while(av_read_frame(.....
[...]

Can I put data and for RTP open in av_open_input_stream?

Vasiliy.

-- реклама -----------------------------------------------------------
http://FREEhost.com.ua - доступный хостинг, домен в подарок
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user