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

前端 未结 2 542
半阙折子戏
半阙折子戏 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 06:56

    See here for syncing:

    http://dranger.com/ffmpeg/tutorial06.html

    and here:

    http://dranger.com/ffmpeg/tutorial07.html

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题