[vlc-devel] Regression in VLC version 3.0.1 - raw ".h264" video files do not play properly

Zhao Zhili quinkblack at foxmail.com
Tue Mar 20 04:23:27 CET 2018

On 2018年03月20日 07:41, Ross Finlayson wrote:
> I have discovered that raw H.264 (“.h264”) video files that play OK in VLC 2.2.8, no longer play properly in VLC 3.0.1 (and the most recent 4.0 build).  Sometimes the files play jerkily; sometimes they don’t play at all.  (I am on a 2017 MacBook Pro,  running Mac OS 10.13.3)
> Examples:
> The file
> 	http://www.live555.com/tmp/does_not_play_in_vlc_3_0_1.h264
> does not play at all in VLC 3.0.1, but plays OK in VLC 2.2.8
> The file
> 	http://www.live555.com/tmp/jerky_in-vlc_3_0_1.h264
> plays jerkily in VLC 3.0.1, but plays OK in VLC 2.2.8
> Note that this problem applies only to *raw* H.264 video files: Those that contain only a sequence of H.264 NAL units, each prepended by a 4-byte ‘0x00 0x00 0x00 0x01’ MPEG ‘start code’.  If I convert these raw files to “.mp4” files (using “ffmpeg -c copy”), then the resulting “.mp4” files will play OK in VLC 3.0.1
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

does_not_play_in_vlc_3_0_1.h264 has a SPS followed by a PPS and an 
access unit
delimiter. The specification says:

When an access unit delimiter NAL unit is present, it shall be the first NAL
unit. There shall be at most one access unit delimiter NAL unit in any 

h26x demuxer checks that. Without the check, it plays well.
I have no idea if it's OK to not check since I know little about H.264.

diff --git a/modules/demux/mpeg/h26x.c b/modules/demux/mpeg/h26x.c
index 3072551..d046cdb 100644
--- a/modules/demux/mpeg/h26x.c
+++ b/modules/demux/mpeg/h26x.c
@@ -205,7 +205,7 @@ static int ProbeH264( const uint8_t *p_peek, size_t 
i_peek, void *p_priv )
      else if( i_nal_type == H264_NAL_AU_DELIMITER )
-        if( i_ref_idc || p_ctx->b_pps || p_ctx->b_sps )
+        if( i_ref_idc ) // || p_ctx->b_pps || p_ctx->b_sps )
              return -1;
      else if ( i_nal_type == H264_NAL_SEI )

More information about the vlc-devel mailing list