Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4522 closed defect (invalid)

Video data difference when HEVC Raw bit stream to mp4 with vcodec copy option

Reported by: kgp700 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: hevc
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
I was copy stream HEVC Raw bit stream (bin) to mp4 on ffmpeg
and hex compared HEVC Raw bit stream and mp4

Result was too many data changed (please reference screenshot)

I know add data on header and moov part
but why so many difference on bit stream part?

If played both video, I can't find any difference
but why can see so many difference on hex data?
Have reason? or Is it bug?

How to reproduce:

ffmpeg -report -i "DSLICE_C_HHI_5.bin" -vcodec copy -an "DSLICE_C_HHI_5.mp4"

http://i.imgur.com/9S0xfgj.png

Log:

ffmpeg started on 2015-04-28 at 17:44:28
Report written to "ffmpeg-20150428-174428.log"
Command line:
ffmpeg -report -i DSLICE_C_HHI_5.bin -vcodec copy -an DSLICE_C_HHI_5.mp4
ffmpeg version N-71471-ged2a712 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.1 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/kgpbuild/ffmpegbuild5/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --disable-w32threads --enable-pthreads --enable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs --extra-cflags=-DPTW32_STATIC_LIB --extra-cflags=-DPTHREAD_STATIC --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libfdk-aac --enable-libvpx --disable-libilbc --prefix=/home/kgpbuild/ffmpegbuild5/sandbox/mingw-w64-i686/i686-w64-mingw32 --enable-static --disable-shared --enable-libsoxr --enable-fontconfig --enable-libass --enable-libutvideo --enable-libbluray --enable-iconv --enable-l  libavutil      54. 22.101 / 54. 22.101
  libavcodec     56. 34.100 / 56. 34.100
  libavformat    56. 30.100 / 56. 30.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 14.100 /  5. 14.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input file with argument 'DSLICE_C_HHI_5.bin'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option 'DSLICE_C_HHI_5.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file DSLICE_C_HHI_5.bin.
Successfully parsed a group of options.
Opening an input file: DSLICE_C_HHI_5.bin.
[hevc @ 04925380] Format hevc probed with size=2048 and score=51
[hevc @ 04925380] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
[hevc @ 04926560] Decoding VPS
[hevc @ 04926560] Main profile bitstream
[hevc @ 04926560] Decoding SPS
[hevc @ 04926560] Main profile bitstream
[hevc @ 04926560] Decoding PPS
[hevc @ 04926560] nal_unit_type: 32, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 33, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 34, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 40, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 32, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] Decoding VPS
[hevc @ 04926560] Main profile bitstream
[hevc @ 04926560] nal_unit_type: 33, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] Decoding SPS
[hevc @ 04926560] Main profile bitstream
[hevc @ 04926560] nal_unit_type: 34, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] Decoding PPS
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 19, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] nal_unit_type: 40, nuh_layer_id: 0, temporal_id: 0
[hevc @ 04926560] Decoding SEI
[hevc @ 04926560] Decoded frame with POC 0.
[hevc @ 04925380] All info found
[hevc @ 04925380] After avformat_find_stream_info() pos: 373275 bytes read:373275 seeks:0 frames:50
Input #0, hevc, from 'DSLICE_C_HHI_5.bin':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 50, 1/1200000: Video: hevc (Main), yuv420p(tv), 1920x1080, 25 fps, 25 tbr, 1200k tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file DSLICE_C_HHI_5.mp4.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
Applying option an (disable audio) with argument 1.
Successfully parsed a group of options.
Opening an output file: DSLICE_C_HHI_5.mp4.
Successfully opened the file.
[mp4 @ 05361840] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, mp4, to 'DSLICE_C_HHI_5.mp4':
  Metadata:
    encoder         : Lavf56.30.100
    Stream #0:0, 0, 1/1200000: Video: hevc ([35][0][0][0] / 0x0023), yuv420p, 1920x1080, q=2-31, 25 fps, 25 tbr, 1200k tbn, 1200k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
[mp4 @ 05361840] pts has no value
No more output streams to write to, finishing.
frame=   50 fps=0.0 q=-1.0 Lsize=     366kB time=00:00:01.84 bitrate=1631.2kbits/s    
video:365kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.508204%
Input file #0 (DSLICE_C_HHI_5.bin):
  Input stream #0:0 (video): 50 packets read (373275 bytes); 
  Total: 50 packets (373275 bytes) demuxed
Output file #0 (DSLICE_C_HHI_5.mp4):
  Output stream #0:0 (video): 50 packets muxed (373275 bytes); 
  Total: 50 packets (373275 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 04927460] Statistics: 34 seeks, 78 writeouts
[AVIOContext @ 04925b60] Statistics: 373275 bytes read, 0 seeks

Change History (4)

comment:1 Changed 4 years ago by kgp700

  • Component changed from undetermined to ffmpeg

comment:2 Changed 4 years ago by heleppkes

RAW HEVC streams are in AnnexB format, ie. every NALU starts with a 0x00000001 start code.
HEVC in MP4 uses a different syntax, where instead of the startcode, a 4-byte size field is used.

The difference you are seeing is therefor perfectly normal.

comment:3 Changed 4 years ago by heleppkes

  • Resolution set to invalid
  • Status changed from new to closed

comment:4 Changed 4 years ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Keywords hevc added
Note: See TracTickets for help on using tickets.