<div><div dir="auto">Hi Martin,</div></div><div dir="auto"><br></div><div dir="auto">Yes, I am using ffmpeg icecast protocol</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Marvin Scholz <<a href="mailto:epirat07@gmail.com">epirat07@gmail.com</a>> escreveu em qui, 11/07/2019 às 20:53 :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11 Jul 2019, at 20:50, Pedro Constantino wrote:<br>
<br>
> Hi,<br>
><br>
> I am having problems with sending a video stream to Icecast server. On <br>
> the<br>
> icecast management platform my stream is being considered as an audio<br>
> stream?? and I am unable to play it<br>
><br>
> I am with no ideas on how to solve this. Am I doing something wrong? <br>
> Please<br>
> take a look on the code bellow<br>
><br>
> Thanks in advance<br>
><br>
> genre various<br>
> listener_peak 0<br>
> listeners 0<br>
> listenurl <a href="http://192.168.11.61:8000/gcs.ogg" rel="noreferrer" target="_blank">http://192.168.11.61:8000/gcs.ogg</a><br>
> max_listeners unlimited<br>
> public 0<br>
> server_description Unspecified description<br>
> server_name Unspecified name<br>
> server_type audio/mpeg<br>
> slow_listeners 0<br>
> source_ip 192.168.11.61<br>
> stream_start Thu, 11 Jul 2019 15:56:46 +0100<br>
> stream_start_iso8601 2019-07-11T15:56:46+0100<br>
> total_bytes_read 877800<br>
> total_bytes_sent 0<br>
> user_agent Lavf/58.20.100<br>
><br>
<br>
Hi,<br>
<br>
how do you actually send the stream to Icecast? I can't find that in <br>
your<br>
code below? Do you use the ffmpeg icecast protocol?<br>
<br>
><br>
> *Code:*<br>
> int ret;<br>
> _pOutputFormatContext = ffmpeg.avformat_alloc_context();<br>
> fixed (AVFormatContext** ppOutputFormatContext =<br>
> &_pOutputFormatContext)<br>
> {<br>
> ret =<br>
> ffmpeg.avformat_alloc_output_context2(ppOutputFormatContext, null, <br>
> "webm",<br>
> configuration.Destination);<br>
> if (ret < 0)<br>
> {<br>
> return false;<br>
> }<br>
> }<br>
><br>
> // Configure output video stream<br>
> _pOutputStream =<br>
> ffmpeg.avformat_new_stream(_pOutputFormatContext, null);<br>
><br>
> AVStream* pInputVideoStream = null;<br>
><br>
> for (var i = 0; i < _pInputFormatContext->nb_streams; i++)<br>
> {<br>
> if <br>
> (_pInputFormatContext->streams[i]->codec->codec_type ==<br>
> AVMediaType.AVMEDIA_TYPE_VIDEO)<br>
> {<br>
> pInputVideoStream = <br>
> _pInputFormatContext->streams[i];<br>
> }<br>
> }<br>
><br>
> _pOutputStream->avg_frame_rate =<br>
> pInputVideoStream->avg_frame_rate;<br>
> _pOutputStream->time_base = pInputVideoStream->time_base;<br>
> _pOutputStream->sample_aspect_ratio =<br>
> pInputVideoStream->sample_aspect_ratio;<br>
> ffmpeg.avcodec_parameters_copy(_pOutputStream->codecpar,<br>
> pInputVideoStream->codecpar);<br>
> _pOutputStream->codecpar->codec_type =<br>
> AVMediaType.AVMEDIA_TYPE_VIDEO;<br>
> _pOutputStream->codecpar->codec_id =<br>
> AVCodecID.AV_CODEC_ID_THEORA;<br>
><br>
> fixed (AVFormatContext** ppOutputFormatContext =<br>
> &_pOutputFormatContext)<br>
> {<br>
> ret = ffmpeg.avio_open(&_pOutputFormatContext->pb,<br>
> configuration.Destination, ffmpeg.AVIO_FLAG_WRITE);<br>
> if (ret < 0)<br>
> {<br>
> return false;<br>
> }<br>
> }<br>
><br>
> ret = ffmpeg.avformat_write_header(_pOutputFormatContext, <br>
> null);<br>
><br>
> if (ret < 0)<br>
> {<br>
> return false;<br>
> }<br>
><br>
> ffmpeg.av_dump_format(_pOutputFormatContext, 0,<br>
> configuration.Destination, 1);<br>
><br>
> return true;<br>
><br>
><br>
><br>
> -- <br>
> Pedro Constantino<br>
> _______________________________________________<br>
> Icecast mailing list<br>
> <a href="mailto:Icecast@xiph.org" target="_blank">Icecast@xiph.org</a><br>
> <a href="http://lists.xiph.org/mailman/listinfo/icecast" rel="noreferrer" target="_blank">http://lists.xiph.org/mailman/listinfo/icecast</a><br>
_______________________________________________<br>
Icecast mailing list<br>
<a href="mailto:Icecast@xiph.org" target="_blank">Icecast@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/icecast" rel="noreferrer" target="_blank">http://lists.xiph.org/mailman/listinfo/icecast</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Pedro Constantino</div>