<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
all URLs are output; my program (rcam <URL>) uses pi cameras and I2S microphones to create FLV container:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
this creates a working local file:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">/userland/build/bin/rcam file:test.flv </span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">this works but results in a stream that is <span style="font-family: Calibri, sans-serif; font-size: 11pt;">constantly </span>buffering:</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><span style="font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">/userland/build/bin/rcam
rtmp://a.rtmp.youtube.com/live2/<streamkey></span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
and this works without issue:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/userland/build/bin/rcam pipe:1 | ffmpeg -i - -acodec copy -vcodec copy -f flv rtmp://a.rtmp.youtube.com/live2/<streamkey><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The code below is the format context setup from rcam.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I hope this answers your questions</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Libav-user <libav-user-bounces@ffmpeg.org> on behalf of Jack Waller <ffmpeg@gmail.com><br>
<b>Sent:</b> Wednesday, May 6, 2020 12:53 AM<br>
<b>To:</b> This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. <libav-user@ffmpeg.org><br>
<b>Subject:</b> Re: [Libav-user] RTMP output issue</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, May 5, 2020 at 10:42 PM william keeling <<a href="mailto:WilliamKeeling@hotmail.com">WilliamKeeling@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<p style="margin:0in 0in 8pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
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 href="http://a.rtmp.youtube.com/live2/" target="_blank">a.rtmp.youtube.com/live2/</a><key> works just fine.</p>
<p style="margin:0in 0in 8pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
Here is the setup code:</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span><br>
</span></p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>int status=0;</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<u></u> <u></u><span style="font-family:Calibri,sans-serif; font-size:11pt; color:rgb(0,0,0)">//</span><span style="font-family:Calibri,sans-serif; font-size:11pt; color:rgb(0,0,0)">
</span><span style="font-family:Calibri,sans-serif; font-size:11pt; color:rgb(0,0,0)">setup format context and io context</span></p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
//<span> </span>tried with and without avformat_network_init();</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
//<span> </span>avformat_network_init();</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>if ((status = avio_open(&io_ctx, filename, AVIO_FLAG_WRITE)))</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>{</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>fprintf(stderr, "Could not open output file '%s' (error '%s')\n", filename, av_err2str(status));</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>return -1;</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>}</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>avformat_alloc_output_context2(&flv_frmtctx, NULL, "flv", NULL);</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>if (!flv_frmtctx) </p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>{</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>fprintf(stderr, "Could not allocate output format context\n");</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>return -1;</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>}</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>flv_frmtctx->pb = io_ctx;</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>if (!(flv_frmtctx->url = av_strdup(filename))) </p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>{</p>
<p style="line-height:107%; font-size:11pt; font-family:Calibri,sans-serif; margin:0in 0in 0.0001pt 0.5in; text-indent:0.5in">
fprintf(stderr, "Could not copy url.\n");</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span><span> </span>return -1;</p>
<p style="margin:0in 0in 0.0001pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<span> </span>}</p>
<p style="margin:0in 0in 8pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<u></u> <u></u></p>
<p style="margin:0in 0in 8pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
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.</p>
<p style="margin:0in 0in 8pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
So any ideas what I am doing wrong or missing in my code that is being done by FFMPEG?</p>
<p style="margin:0in 0in 8pt; line-height:107%; font-size:11pt; font-family:Calibri,sans-serif">
<br>
</p>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Please show the full example ffmpeg options to reproduce your issue,</div>
<div><br>
</div>
<div>You mentioned many URLs in your question. Which URL is input url,, and which URL is output url?</div>
<div><br>
</div>
<div> </div>
</div>
</div>
</div>
</div>
</body>
</html>