[x264-devel] What is wrong in this frame?

Alexander Bokovikov openworld at uralweb.ru
Thu Oct 31 17:11:33 CET 2013


Hi, All,

I've saved several videos from youtube, and few of them have similar flaw. 
Everything is OK, when the movie is playing online (through flash player) 
but offline FLV is frozen on this keyframe (see the link below). I've 
checked different such "erroneous" videos and all of them have similar 
keyframe. I've save a "good" keyframe from the same video to try to find a 
difference. I'm asking for some help. Is there anybody here, who can parse 
this NAL unit to find its "bug"? All players freeze on this keyframe. I 
tried QT and VLC. Even flash player itself won't play this FLV, when it is 
saved as a file. It plays upto this keyframe and stops.
Here is the archive (~40 K):
http://home.bokovikov.com/etc/flv/keyframes.zip
abnormal-keyframe.bin - a "bad" keyframe.
normal-keyframe.bin - a "good" keyframe sample from the same stream

Abnormal frame is twice bigger. Why?
Both have few junk bytes at the end, because they were got by memory dump, 
so both files are aligned to 16 bytes.

Appreciate any help!

Best regards,
Alexander Bokovikov

----- Original Message ----- 
From: <x264-devel-request at videolan.org>
To: <x264-devel at videolan.org>
Sent: Thursday, October 31, 2013 5:00 PM
Subject: x264-devel Digest, Vol 77, Issue 24


> Send x264-devel mailing list submissions to
> x264-devel at videolan.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mailman.videolan.org/listinfo/x264-devel
> or, via email, send a message with subject or body 'help' to
> x264-devel-request at videolan.org
>
> You can reach the person managing the list at
> x264-devel-owner at videolan.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of x264-devel digest..."
>
>
> Today's Topics:
>
>   1. Add AVC-Intra 1080p50/60 Class 100 parameters (Kieran Kunhya)
>   2. Add L-SMASH support as preferable alternative for MP4-muxing
>      (Anton Mitrofanov)
>   3. Remove --visualize option. (Anton Mitrofanov)
>   4. x264 Development Newsletter: Vol. 40 (Jason Garrett-Glaser)
>   5. configure: include dependency libs in the Libs pkg-config
>      (Martin Storsjo)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 30 Oct 2013 21:18:34 +0100 (CET)
> From: git at videolan.org (Kieran Kunhya)
> To: x264-devel at videolan.org
> Subject: [x264-devel] Add AVC-Intra 1080p50/60 Class 100 parameters
> Message-ID: <20131030201834.36F02150313 at albiero.videolan.org>
> Content-Type: text/plain; charset=UTF-8
>
> x264 | branch: master | Kieran Kunhya <kieran at kunhya.com> | Sat Sep 21 
> 19:16:12 2013 +0100| [bc2c08111daf8664a6b3d379ac708650ef230f9d] | 
> committer: Jason Garrett-Glaser
>
> Add AVC-Intra 1080p50/60 Class 100 parameters
>
> Also add some compatibility fixes.
>
>> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=bc2c08111daf8664a6b3d379ac708650ef230f9d
> ---
>
> encoder/encoder.c |   28 ++++++++++++++--------------
> encoder/set.c     |   29 +++++++++++++++++++++++++++--
> encoder/set.h     |    3 ++-
> 3 files changed, 43 insertions(+), 17 deletions(-)
>
> diff --git a/encoder/encoder.c b/encoder/encoder.c
> index fc43078..2ff4515 100644
> --- a/encoder/encoder.c
> +++ b/encoder/encoder.c
> @@ -631,7 +631,7 @@ static int x264_validate_parameters( x264_t *h, int 
> b_open )
>             uint16_t frame_size;
>             const uint8_t *cqm_4ic;
>             const uint8_t *cqm_8iy;
> -        } avcintra_lut[2][2][5] =
> +        } avcintra_lut[2][2][7] =
>         {
>             {{{ 60000, 1001, 0,  912, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy },
>               {    50,    1, 0, 1100, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy },
> @@ -640,7 +640,9 @@ static int x264_validate_parameters( x264_t *h, int 
> b_open )
>               { 24000, 1001, 0,  912, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy }},
>              {{ 30000, 1001, 1, 1820, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_1080i_8iy },
>               {    25,    1, 1, 2196, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_1080i_8iy },
> +              { 60000, 1001, 0, 1820, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy },
>               { 30000, 1001, 0, 1820, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy },
> +              {    50,    1, 0, 2196, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy },
>               {    25,    1, 0, 2196, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy },
>               { 24000, 1001, 0, 1820, x264_cqm_avci50_4ic, 
> x264_cqm_avci50_p_8iy }}},
>             {{{ 60000, 1001, 0, 1848, x264_cqm_avci100_720p_4ic, 
> x264_cqm_avci100_720p_8iy },
> @@ -650,7 +652,9 @@ static int x264_validate_parameters( x264_t *h, int 
> b_open )
>               { 24000, 1001, 0, 1848, x264_cqm_avci100_720p_4ic, 
> x264_cqm_avci100_720p_8iy }},
>              {{ 30000, 1001, 1, 3692, x264_cqm_avci100_1080_4ic, 
> x264_cqm_avci100_1080i_8iy },
>               {    25,    1, 1, 4444, x264_cqm_avci100_1080_4ic, 
> x264_cqm_avci100_1080i_8iy },
> +              { 60000, 1001, 0, 3692, x264_cqm_avci100_1080_4ic, 
> x264_cqm_avci100_1080p_8iy },
>               { 30000, 1001, 0, 3692, x264_cqm_avci100_1080_4ic, 
> x264_cqm_avci100_1080p_8iy },
> +              {    50,    1, 0, 4444, x264_cqm_avci100_1080_4ic, 
> x264_cqm_avci100_1080p_8iy },
>               {    25,    1, 0, 4444, x264_cqm_avci100_1080_4ic, 
> x264_cqm_avci100_1080p_8iy },
>               { 24000, 1001, 0, 3692, x264_cqm_avci100_1080_4ic, 
> x264_cqm_avci100_1080p_8iy }}}
>         };
> @@ -695,7 +699,7 @@ static int x264_validate_parameters( x264_t *h, int 
> b_open )
>         int i;
>         uint32_t fps_num = h->param.i_fps_num, fps_den = 
> h->param.i_fps_den;
>         x264_reduce_fraction( &fps_num, &fps_den );
> -        for( i = 0; i < 5; i++ )
> +        for( i = 0; i < 7; i++ )
>         {
>             if( avcintra_lut[type][res][i].fps_num == fps_num &&
>                 avcintra_lut[type][res][i].fps_den == fps_den &&
> @@ -704,7 +708,7 @@ static int x264_validate_parameters( x264_t *h, int 
> b_open )
>                 break;
>             }
>         }
> -        if( i == 5 )
> +        if( i == 7 )
>         {
>             x264_log( h, X264_LOG_ERROR, "FPS %d/%d%c not compatible with 
> AVC-Intra\n",
>                       h->param.i_fps_num, h->param.i_fps_den, 
> PARAM_INTERLACED ? 'i' : 'p' );
> @@ -3574,25 +3578,21 @@ int     x264_encoder_encode( x264_t *h,
>     if( h->param.b_avcintra_compat )
>     {
>         /* Write an empty filler NAL to mimic the AUD in the P2 format*/
> -        if( h->param.b_avcintra_compat )
> -        {
> -            x264_nal_start( h, NAL_FILLER, NAL_PRIORITY_DISPOSABLE );
> -            x264_filler_write( h, &h->out.bs, 0 );
> -            if( x264_nal_end( h ) )
> -                return -1;
> -            overhead += h->out.nal[h->out.i_nal-1].i_payload + 
> NALU_OVERHEAD;
> -        }
> +        x264_nal_start( h, NAL_FILLER, NAL_PRIORITY_DISPOSABLE );
> +        x264_filler_write( h, &h->out.bs, 0 );
> +        if( x264_nal_end( h ) )
> +            return -1;
> +        overhead += h->out.nal[h->out.i_nal-1].i_payload + NALU_OVERHEAD;
>
>         /* All lengths are magic lengths that decoders expect to see */
>         /* "UMID" SEI */
>         x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
> -        if( x264_sei_avcintra_write( h, &h->out.bs, 497, "UMID" ) < 0 )
> +        if( x264_sei_avcintra_umid_write( h, &h->out.bs ) < 0 )
>             return -1;
>         if( x264_nal_end( h ) )
>             return -1;
>         overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
>
> -
>         int unpadded_len;
>         int total_len;
>         if( h->param.i_height == 1080 )
> @@ -3607,7 +3607,7 @@ int     x264_encoder_encode( x264_t *h,
>         }
>         /* "VANC" SEI */
>         x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
> -        if( x264_sei_avcintra_write( h, &h->out.bs, unpadded_len, 
> "VANC" ) < 0 )
> +        if( x264_sei_avcintra_vanc_write( h, &h->out.bs, unpadded_len ) < 
> 0 )
>             return -1;
>         if( x264_nal_end( h ) )
>             return -1;
> diff --git a/encoder/set.c b/encoder/set.c
> index bf83a0d..61eb006 100644
> --- a/encoder/set.c
> +++ b/encoder/set.c
> @@ -31,6 +31,7 @@
>
> // Indexed by pic_struct values
> static const uint8_t num_clock_ts[10] = { 0, 1, 1, 1, 2, 2, 3, 3, 2, 3 };
> +const static uint8_t avcintra_uuid[] = {0xF7, 0x49, 0x3E, 0xB3, 0xD4, 
> 0x00, 0x47, 0x96, 0x86, 0x86, 0xC9, 0x70, 0x7B, 0x64, 0x37, 0x2A};
>
> static void transpose( uint8_t *buf, int w )
> {
> @@ -725,10 +726,34 @@ void x264_sei_dec_ref_pic_marking_write( x264_t *h, 
> bs_t *s )
>     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, 
> SEI_DEC_REF_PIC_MARKING );
> }
>
> -int x264_sei_avcintra_write( x264_t *h, bs_t *s, int len, const char 
> *msg )
> +int x264_sei_avcintra_umid_write( x264_t *h, bs_t *s )
> +{
> +    uint8_t data[512];
> +    const char *msg = "UMID";
> +    const int len = 497;
> +
> +    memset( data, 0xff, len );
> +    memcpy( data, avcintra_uuid, sizeof(avcintra_uuid) );
> +    memcpy( data+16, msg, strlen(msg) );
> +
> +    data[20] = 0x13;
> +    /* These bytes appear to be some sort of frame/seconds counter in 
> certain applications,
> +     * but others jump around, so leave them as zero for now */
> +    data[21] = data[22] = 0;
> +
> +    data[28] = 0x14;
> +    data[36] = 0x60;
> +    data[41] = 0x22; /* Believed to be some sort of end of basic UMID 
> identifier */
> +
> +    x264_sei_write( &h->out.bs, data, len, SEI_USER_DATA_UNREGISTERED );
> +
> +    return 0;
> +}
> +
> +int x264_sei_avcintra_vanc_write( x264_t *h, bs_t *s, int len )
> {
> -    const static uint8_t avcintra_uuid[] = {0xF7, 0x49, 0x3E, 0xB3, 0xD4, 
> 0x00, 0x47, 0x96, 0x86, 0x86, 0xC9, 0x70, 0x7B, 0x64, 0x37, 0x2A};
>     uint8_t data[6000];
> +    const char *msg = "VANC";
>     if( len > sizeof(data) )
>     {
>         x264_log( h, X264_LOG_ERROR, "AVC-Intra SEI is too large (%d)\n", 
> len );
> diff --git a/encoder/set.h b/encoder/set.h
> index d6fb60a..d70bec8 100644
> --- a/encoder/set.h
> +++ b/encoder/set.h
> @@ -38,7 +38,8 @@ void x264_sei_buffering_period_write( x264_t *h, bs_t 
> *s );
> void x264_sei_pic_timing_write( x264_t *h, bs_t *s );
> void x264_sei_dec_ref_pic_marking_write( x264_t *h, bs_t *s );
> void x264_sei_frame_packing_write( x264_t *h, bs_t *s );
> -int  x264_sei_avcintra_write( x264_t *h, bs_t *s, int len, const char 
> *msg );
> +int  x264_sei_avcintra_umid_write( x264_t *h, bs_t *s );
> +int  x264_sei_avcintra_vanc_write( x264_t *h, bs_t *s, int len );
> void x264_sei_write( bs_t *s, uint8_t *payload, int payload_size, int 
> payload_type );
> void x264_filler_write( x264_t *h, bs_t *s, int filler );
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 30 Oct 2013 21:18:34 +0100 (CET)
> From: git at videolan.org (Anton Mitrofanov)
> To: x264-devel at videolan.org
> Subject: [x264-devel] Add L-SMASH support as preferable alternative
> for MP4-muxing
> Message-ID: <20131030201834.7C06415045A at albiero.videolan.org>
> Content-Type: text/plain; charset=UTF-8
>
> x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue Oct 15 
> 12:32:25 2013 +0400| [7664b45570e4262c4d22bb89f4d395edcb4a639e] | 
> committer: Jason Garrett-Glaser
>
> Add L-SMASH support as preferable alternative for MP4-muxing
>
>> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=7664b45570e4262c4d22bb89f4d395edcb4a639e
> ---
>
> Makefile            |    4 +
> configure           |   44 +++++-
> output/mp4_lsmash.c |  419 
> +++++++++++++++++++++++++++++++++++++++++++++++++++
> x264.c              |   10 +-
> 4 files changed, 467 insertions(+), 10 deletions(-)
>
> Diff: 
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commitdiff;h=7664b45570e4262c4d22bb89f4d395edcb4a639e
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 30 Oct 2013 21:18:34 +0100 (CET)
> From: git at videolan.org (Anton Mitrofanov)
> To: x264-devel at videolan.org
> Subject: [x264-devel] Remove --visualize option.
> Message-ID: <20131030201834.CA1BA150423 at albiero.videolan.org>
> Content-Type: text/plain; charset=UTF-8
>
> x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sun Oct 27 
> 19:27:23 2013 +0400| [1ca7bb943d15165a4b9631002a655587d923be63] | 
> committer: Jason Garrett-Glaser
>
> Remove --visualize option.
>
> It probably wasn't used or maintained for last few years.
>
>> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=1ca7bb943d15165a4b9631002a655587d923be63
> ---
>
> AUTHORS              |    4 -
> Makefile             |    5 -
> common/common.c      |    4 -
> common/common.h      |    3 -
> common/display-x11.c |  218 --------------------------------
> common/display.h     |   41 ------
> common/visualize.c   | 
>  341 --------------------------------------------------
> common/visualize.h   |   36 ------
> configure            |   20 +--
> encoder/encoder.c    |   24 ----
> x264.c               |   19 ---
> x264.h               |    3 +-
> 12 files changed, 2 insertions(+), 716 deletions(-)
>
> Diff: 
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commitdiff;h=1ca7bb943d15165a4b9631002a655587d923be63
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 30 Oct 2013 13:18:31 -0700
> From: Jason Garrett-Glaser <jason at x264.com>
> To: Mailing list for x264 developers <x264-devel at videolan.org>
> Subject: [x264-devel] x264 Development Newsletter: Vol. 40
> Message-ID:
> <CABS55+BFzi5T=XSQ+W_iKe3xzQLjR+qReoF51VF8x6ThenJbcA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> This is the fortieth x264 development newsletter. This is a regular
> email containing updates on fixes and improvements in the most recent
> x264 push, along with updates on what's coming next.  Previous
> versions can be found in the mailing list archives.
>
> Fixes:
>
> Work around an FFMS bug with empty index files.
>
> Fix INSTALL in configure on Solaris systems.
>
> Fix possible crashes in resize/crop filters on high bit depth input.
>
> Fix shared library compilation on the original Windows MinGW toolchain.
>
> Fix compilation in the case that the HAVE_LOG2F check fails spuriously.
>
> Include dependency libraries in pkg-config generation.
>
> Don't try to generate a .git version number on build if .git isn't
> present (e.g. in snapshots)
>
> Update code to the current libav/ffmpeg API.
>
> Improvements:
>
> Don't warn in non-verbose mode if VBV underflow occurs with CRF-max
> (since the user likely wanted it to occur).
>
> Slight speedup in chroma BI analysis.
>
> Make encoder_reconfig more threadsafe: fixes some rare crash issues
> with reconfiguring with frame threads.
>
> Add a --filler option to generate streams with filler without using NAL 
> HRD.
>
> Add AVC Intra 1080p50/60 Class 100 parameters and some further AVC
> Intra compatibility hacks/fixes.
>
> Add L-SMASH support as a preferred alternative to GPAC for mp4 muxing.
>
> Remove the --visualize option, as it is very old cruft and probably
> does not work with many combinations of settings anymore (as it hasn't
> been maintained).
>
> Jason Garrett-Glaser
>
> The x264 Team
>
>
> ------------------------------
>
> Message: 5
> Date: Wed, 30 Oct 2013 21:18:32 +0100 (CET)
> From: git at videolan.org (Martin Storsjo)
> To: x264-devel at videolan.org
> Subject: [x264-devel] configure: include dependency libs in the Libs
> pkg-config
> Message-ID: <20131030201832.297A6150325 at albiero.videolan.org>
> Content-Type: text/plain; charset=UTF-8
>
> x264 | branch: master | Martin Storsjo <martin at martin.st> | Tue Sep  3 
> 14:56:18 2013 -0700| [a4179405870732e679f42dbf6e37539e5126da15] | 
> committer: Jason Garrett-Glaser
>
> configure: include dependency libs in the Libs pkg-config
>
> If only a static library is built, the user of the library that just
> tries to link to the lib using the flags provided by pkg-config
> might not know that only a static lib exists and that he'd have to
> pass --static to pkg-config to get the internal dependencies to
> be able to link the library.
>
> For a shared build, the internal dependencies are kept in Libs.private
> as before.
>
> This matches how libav's pkg-config files are generated.
>
>> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=a4179405870732e679f42dbf6e37539e5126da15
> ---
>
> configure |    4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 3d714a5..d35561c 100755
> --- a/configure
> +++ b/configure
> @@ -1237,8 +1237,8 @@ includedir=$includedir
> Name: x264
> Description: H.264 (MPEG4 AVC) encoder library
> Version: $(grep POINTVER < x264_config.h | sed -e 's/.* "//; s/".*//')
> -Libs: -L$libdir -lx264
> -Libs.private: $libpthread $libm $libdl
> +Libs: -L$libdir -lx264 $([ "$shared" = "yes" ] || echo $libpthread $libm 
> $libdl)
> +Libs.private: $([ "$shared" = "yes" ] && echo $libpthread $libm $libdl)
> Cflags: -I$includedir
> EOF
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> https://mailman.videolan.org/listinfo/x264-devel
>
>
> ------------------------------
>
> End of x264-devel Digest, Vol 77, Issue 24
> ****************************************** 



More information about the x264-devel mailing list