[Icecast] Need help with streaming to Icecast

Marvin Scholz epirat07 at gmail.com
Thu Jul 11 20:12:10 UTC 2019


On 11 Jul 2019, at 22:04, Pedro Constantino wrote:

> Hi Martin,
>
> Yes, I am using ffmpeg icecast protocol

As already stated in my last email it would help if you
share the code for that.
Very likely you forgot to set the content_type option.

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



More information about the Icecast mailing list