0

I downloaded a 1080p video from YouTube, which only contains one track (the video one, no audio track). I am trying to write an Android app as a practice to play the video in my smartphone using MediaCodec and MediaExtractor.

When I extract the video information, it shows vide:avc1 in the type field. What I am not sure about is that, is the Android MediaCodec able to decode it? What I found on the MediaCodec webpage is that it supports "video/avc" - H.264/AVC video, not vide:avc1.

Anyone can help?

--------------------------update--------------------------

I tried it using some sample code found online and the video plays perfectly. It is interesting that the video format is video/avc when I parse it using MediaExtractor, which is a supported format as stated on Android's webpage.

I got the 'vide/avc1' type using GPAC's MP4Box -info <media file> command. I found avc1 in the ftyp box but didn't find anything related to vide. So I guess it might be some typo in the GPAC? I am not really sure.

David Shi
  • 71
  • 1
  • 8

1 Answers1

1

In mp4 container video is packed without start codes, generally muxers just cut out start codes substituting them by frame length. You can find more details in MP4 file standard. Such video type is called avc1. Normal h.264 type is called avc and i assume MediaExtractor adds start codes to avc1 video frames, so you get normal h.264 from extractor.

Marlon
  • 1,473
  • 11
  • 13