mp4 file changes size during playback

Mathieu Duponchelle mathieu at centricular.com
Wed Dec 4 18:55:33 UTC 2019


Sorry, replied to the earlier mail, didn't notice you had found a link. As far as I know,
the problem relates to the specification of how H264 is to be contained in MP4, I think
you'll need to look at ISO/IEC 14496-15 for more information :)

On 12/4/19 7:26 PM, David Ing wrote:
> Here is the AVC1 standard:   https://www.itu.int/ITU-T/recommendations/rec.aspx?rec=7825  (the link was right there as a reference in the wikipedia article,  https://en.wikipedia.org/wiki/Advanced_Video_Coding#Versions).
>
> Page 31 / section 7.3.2.1 defines the Sequence parameter set RBSP syntax, which includes:
>
>   * pic_width_in_mbs_minus1
>   * pic_height_in_map_units_minus_1
>
> Therefore (unless I am mistaken), it looks like sequence parameter sets (which contain width / height settings) are allowed in avc1.
>
> On Wed, Dec 4, 2019 at 10:11 AM David Ing <ding at panopto.com <mailto:ding at panopto.com>> wrote:
>
>     Okay ... I think this is where the versions are defined:   https://en.wikipedia.org/wiki/Advanced_Video_Coding#Versions
>
>     (Still trying to figure out how to view the standards for free.)
>
>     On Wed, Dec 4, 2019 at 10:03 AM David Ing <ding at panopto.com <mailto:ding at panopto.com>> wrote:
>
>         Mathieu --
>
>         Please excuse the inadequacy of my google-fu.  I am having trouble finding any kind of authoritative reference document which describes avc1, 2, 3, 4, ... (and the subtle differences between them)
>
>           * My best guess is that avc1 refers to the first amendment:  https://www.iso.org/standard/67318.html
>           * My best guess is that avc3 refers to the third amendment:  https://www.iso.org/standard/69728.html
>
>         Also -- I am a bit surprised that we need to pay in order to view documents like this.  Does anyone know if there is a way to view this stuff for free?
>
>         On Wed, Dec 4, 2019 at 9:14 AM Mathieu Duponchelle <mathieu at centricular.com <mailto:mathieu at centricular.com>> wrote:
>
>             That's an interesting file, but I'm not sure it is a a compliant one:  the resolution change is
>             advertised through SPS in the bitstream, but the MP4 header says "avc1", which as far as I remembe
>             means the H264 bitstream should not contain any SPS (please double check this, haven't looked at the spec).
>
>             Ideally, the tool you produced this file with would use an "avc3" stream format, and not hold
>             any parameter sets in its MP4 header. That way, you could detect resolution changes by simply
>             plugging a demuxer and a parser together and looking for new caps. Currently you can only do that
>             either by also plugging a decoder afterwards and looking for caps changes, or analysing the SPS
>             manually :)
>
>             Best,
>
>             -- 
>             Mathieu Duponchelle · https://www.centricular.com
>
>
>             On 12/3/19 10:50 PM, David Ing wrote:
>>             I have an mp4 file which changes size during playback.  But I noticed that gst-discoverer-1.0 does not report the fact that the size changes.
>>
>>             I have two questions.
>>
>>              1. In theory, what is the fastest way to scan the file to determine where the size changes?
>>              2. In practice, what is the easiest way (given the current state of gstreamer) to scan the file and determine where the size changes?
>>
>>             Here is the file which changes size during playback:
>>
>>                 https://drive.google.com/drive/folders/1f4pGNDhzCvsg1xXWj4y9DS3vXkaglOvZ?usp=sharing
>>
>>             Here is the gst-discoverer-1.0 output:
>>
>>                 $ *gst-discoverer-1.0 -v screencap.m4v *
>>                 Analyzing file:///home/ding/mess/repro/screencap.m4v
>>                 Done discovering file:///home/ding/mess/repro/screencap.m4v
>>
>>                 Topology:
>>                   container: video/quicktime, variant=(string)iso
>>                     video: video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4.2, profile=(string)main, codec_data=(buffer)014d402affe1002b674d402a965402a835f35602d40404050000030001000003003ce060007d0000030177009a9503b4244d4001000468ce3520, width=(int)996, height=(int)632, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
>>                       Tags:
>>                         video codec: H.264 / AVC
>>                         bitrate: 309812
>>                         datetime: 2019-11-01T17:40:33Z
>>                         title: n/a
>>                         container format: ISO MP4/M4A
>>                      
>>                       Codec:
>>                         video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4.2, profile=(string)main, codec_data=(buffer)014d402affe1002b674d402a965402a835f35602d40404050000030001000003003ce060007d0000030177009a9503b4244d4001000468ce3520, width=(int)996, height=(int)632, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
>>                       Additional info:
>>                         None
>>                       Stream ID: 14c5bd3783191c8af25f30b00a879f8f7bdaa4367c8ecbd954b38e5367507175/001
>>                       Width: 1350
>>                       Height: 846
>>                       Depth: 24
>>                       Frame rate: 30/1
>>                       Pixel aspect ratio: 1/1
>>                       Interlaced: false
>>                       Bitrate: 309812
>>                       Max bitrate: 0
>>
>>                 Properties:
>>                   Duration: 0:00:34.861322222
>>                   Seekable: yes
>>                   Live: no
>>                   Tags:
>>                       video codec: H.264 / AVC
>>                       bitrate: 309812
>>                       datetime: 2019-11-01T17:40:33Z
>>                       title: n/a
>>                       container format: ISO MP4/M4A
>>
>>
>>             _______________________________________________
>>             gstreamer-devel mailing list
>>             gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>
>>             https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191204/18015122/attachment.html>


More information about the gstreamer-devel mailing list