If you have something like:

 ret = avcodec_decode_video2(cc, frame, &gotFrame, &packet);


then:

 switch (cc->codec_type) {
    case AVMEDIA_TYPE_VIDEO:
        // is video
       break;
    case AVMEDIA_TYPE_AUDIO:
       // is audio
       break;

   default:
      // other (e.g subtitle)
      break;
  }



Cheers,
Salsaman.





http://lives-video.com
https://www.openhub.net/accounts/salsaman

On Wed, Apr 20, 2016 at 7:34 AM, qw <[email protected]> wrote:

> Hi,
>
> how to know whether AVFrame is audio frame or video frame?
>
> Thanks!
>
> B.R.
>
> Andrew
>
>
>
>
> _______________________________________________
> Libav-user mailing list
> [email protected]
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to