Decode audio and video and process both streams — ffmpeg, sdl, opencv

前端 未结 2 544
半阙折子戏
半阙折子戏 2021-01-03 06:31

My goal is to proceed on audio and video of mpeg-2 file independently, and to keep synchronicity on both flows. Duration of video is about 1 or 2 minutes maximum.

2条回答
  •  悲哀的现实
    2021-01-03 07:07

    I solved the "Unsupported codec" error. Remplace AVMEDIA_TYPE_VIDEO with AVMEDIA_TYPE_AUDIO in the following line :

    if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO && audioStream < 0){
              audioStream = i;
    }
    

    Grayscale conversion is not true due to uchar opencv pixel format. I still have the synchro not working ... any help ?

    Thanks

提交回复
热议问题