<div dir="ltr">Hi,<div><br></div><div>I am new to FFMPEG and video streaming, and I am stuck in a problem for a couple of weeks now. I will describe the problem that I am having hoping that someone could help.</div><div><br></div><div><b>Context:</b></div><div>I want to stream a video from VLC (RTSP and MP4) to my C# application where I want to reencode the video frames to OGG and forward the stream to an Icecast Server.</div><div><br></div><div><b>Problem:</b></div><div>I am getting the error  "<b>[ogg @ 0000020ff60ac100] Extradata corrupted</b>" and I have no idea on how to fix this. I have the following code </div><div><br></div><div> private bool openOutput()<br></div>        {<br>            <br>            int ret;<br>            _pOutputFormatContext = ffmpeg.avformat_alloc_context();<br>            fixed (AVFormatContext** ppOutputFormatContext = &_pOutputFormatContext)<br>            {<br>                ret = ffmpeg.avformat_alloc_output_context2(ppOutputFormatContext, null, "ogg", configuration.Destination);<br>                //ret = ffmpeg.avformat_alloc_output_context2(ppOutputFormatContext, null, "webm", configuration.Destination);<br>                if (ret < 0)<br>                {<br>                    return false;<br>                }<br>            }<br><br>            AVOutputFormat* out_format = ffmpeg.av_guess_format(null, configuration.Destination, null);<br>            <br>            // Configure output video stream<br>            _pOutputStream = 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 (_pInputFormatContext->streams[i]->codec->codec_type == AVMediaType.AVMEDIA_TYPE_VIDEO)<br>                {<br>                    pInputVideoStream = _pInputFormatContext->streams[i];<br>                }<br>            }<br><br>            _pOutputStream->avg_frame_rate = pInputVideoStream->avg_frame_rate;<br>            _pOutputStream->time_base = pInputVideoStream->time_base;<br>            _pOutputStream->sample_aspect_ratio = pInputVideoStream->sample_aspect_ratio;<br>            ffmpeg.avcodec_parameters_copy(_pOutputStream->codecpar, pInputVideoStream->codecpar);<br>          <br>            _pOutputStream->codecpar->codec_type = AVMediaType.AVMEDIA_TYPE_VIDEO;<br>            _pOutputStream->codecpar->codec_id = AVCodecID.AV_CODEC_ID_THEORA;<br><br>            AVDictionary* opt_dict;<br><br>            ffmpeg.av_dict_set(&opt_dict, "content_type", "application/ogg", 0);<br>            ffmpeg.av_dict_set(&opt_dict, "user_agent", "GCS", 0);<br><br>            fixed (AVFormatContext** ppOutputFormatContext = &_pOutputFormatContext)<br>            {<br>                ret = ffmpeg.avio_open2(&_pOutputFormatContext->pb, configuration.Destination, ffmpeg.AVIO_FLAG_WRITE, null, &opt_dict);<br>                if (ret < 0)<br>                {<br>                    return false;<br>                }<br>            }<br><br>            ret = ffmpeg.avformat_write_header(_pOutputFormatContext, null);<br><br>            if (ret < 0)<br>            {<br>                return false;<br>            }<br><br>            ffmpeg.av_dump_format(_pOutputFormatContext, 0, configuration.Destination, 1);<br><br>            return true;<br>        }<div><br></div><div><br></div><div>What am I doing wrong? Or what am I missing?</div><div><br></div><div>Best regards,</div><div>Pedro</div></div>