[Libav-user] RTMP output issue
WilliamKeeling at hotmail.com
Tue May 5 17:42:11 EEST 2020
I have an issue that has me stumped. I have written a program than creates a flash video container (H.264 video and AAC audio streams) and writes it to a URL. If the URL is a file it is and playable and uploadable with no issues. But if the URL is a RTMP then it is stream but with buffering waits. But if the URL is pipe:1 passed to ffmpeg -i - -acodec copy -vcodec copy -f flv rtmp://a.rtmp.youtube.com/live2/<key> works just fine.
Here is the setup code:
// setup format context and io context
// tried with and without avformat_network_init();
if ((status = avio_open(&io_ctx, filename, AVIO_FLAG_WRITE)))
fprintf(stderr, "Could not open output file '%s' (error '%s')\n", filename, av_err2str(status));
avformat_alloc_output_context2(&flv_frmtctx, NULL, "flv", NULL);
fprintf(stderr, "Could not allocate output format context\n");
flv_frmtctx->pb = io_ctx;
if (!(flv_frmtctx->url = av_strdup(filename)))
fprintf(stderr, "Could not copy url.\n");
The I understand the FFMPEG command is just a passthru with just copy of both streams and no changes to either stream or container but it streams just fine.
So any ideas what I am doing wrong or missing in my code that is being done by FFMPEG?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user