Where's the Difference Between These Two Vlc Codec Identifiers?

Where's the Difference Between These Two Vlc Codec Identifiers?

I converted a .ts file to .mp4 using the following command:

ffmpeg -i hls-360p.ts -codec copy -bsf:a aac_adtstoasc hls-360p.mp4

Altough no reencoding was intended, VLC states a just slightly different video codec string:

  • Input .ts file: H264 - MPEG-4 AVC (part 10)(h264)
  • Output .mp4 file: H264 - MPEG-4 AVC (part 10)(avc1)

What's the difference?


Input file screenshot:


Output file screenshot:

2 Answers

From H.264 Video Types,

avc1 indicates H.264 bitstream without start codes

The MP4 container format stores H.264 data without start codes. Instead, each NALU is prefixed by a length field, which gives the length of the NALU in bytes. The size of the length field can vary, but is typically 1, 2, or 4 bytes.

And h264 indicates H.264 bitstream with start codes.

H.264 bitstreams that are transmitted over the air, or contained in MPEG-2 program or transport streams, or recorded on HD-DVD, are formatted as described in Annex B of ITU-T Rec. H.264. According to this specification, the bitstream consists of a sequence of network abstraction layer units (NALUs), each of which is prefixed with a start code equal to 0x000001 or 0x00000001.

Just to add to @Gyan's answer, the size of the length field is called NALULengthSizeMinusOne and is present in the avCc part of the avc1 box. This answer: Link shows a good difference between them.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.