Opened 12 years ago

Last modified 12 years ago

#2173 new defect

m2ts made by ffmpeg isn't playbacked with panasonic hdd recoder with some of x264 options

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

Description

Summary of the bug:
m2ts made by ffmpeg cannot well be playbacked with panasonic hdd recoder if -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr is added. stop, playback, and black screen are repeated in movie. Sometimes, movie cannot be playbacked at all.
Sound is correctly playbacked.

On the other hand, a m2ts files made without it by ffmpeg are smoothly playbacked with panasonic hdd recoder.

My step
Step 1
Making m2ts files by ffmpeg
Step 2
Converting the files to AVCHD by multiAVCHD, which uses tsMuxR.

http://www.videohelp.com/tools/multiAVCHD

Step3
Playbaking the AVCHD with Panansonic HDD recorder

source is DmC: Devil May Cry - Mission 9 EXCLUSIVE Gameplay - Eurogamer

http://www.youtube.com/watch?v=ArGgYqW5Ssk

making console with -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr

ffmpeg  -i input.mp4  -t 15  -vf "fifo, scale= 720:480" -vcodec libx264 -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr -aspect 16:9 -r 29.97 -acodec ac3 -ac 2 -ar 48000 -ab 96000 output_ffmpeg_nal_m2ts.m2ts
ffmpeg version 1.0.git-5a2f3f0 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan  2 2013 18:09:20 with gcc 4.7.2 (MacPorts gcc47 4.7.2_2)
  configuration: --prefix=/sw --cc=gcc-mp-4.7 --cxx=g++-mp-4.7 --extra-cflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --extra-cxxflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-libfaac --enable-libopenjpeg --enable-libschroedinger --enable-libmodplug --enable-libxvid --enable-libfreetype --enable-openssl --enable-avfilter --enable-filters --arch=x86_64 --cpu=corei7-avx --enable-libass --enable-libbluray --enable-libopencore_amrwb --enable-libopencore_amrnb
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 85.100 / 54. 85.100
  libavformat    54. 59.100 / 54. 59.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.102 /  3. 30.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2013-01-02 11:53:23
  Duration: 00:04:11.16, start: 0.000000, bitrate: 5772 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 5578 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s
    Metadata:
      creation_time   : 2013-01-02 11:53:24
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
[libx264 @ 0x102873000] using SAR=32/27
[libx264 @ 0x102873000] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 0x102873000] profile High, level 3.0
Output #0, mpegts, to 'output_ffmpeg_nal_m2ts.m2ts':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf54.59.100
    Stream #0:0(und): Video: h264, yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=-1--1, 90k tbn, 29.97 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: ac3, 48000 Hz, stereo, fltp, 96 kb/s
    Metadata:
      creation_time   : 2013-01-02 11:53:24
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> ac3)
Press [q] to stop, [?] for help
frame=   78 fps=0.0 q=29.0 size=      55kB time=00:00:02.84 bitrate= 157.8kbits/frame=  147 fps=147 q=29.0 size=     268kB time=00:00:04.89 bitrate= 448.8kbits/frame=  211 fps=140 q=29.0 size=     488kB time=00:00:07.32 bitrate= 545.6kbits/frame=  278 fps=138 q=29.0 size=     670kB time=00:00:09.27 bitrate= 591.9kbits/frame=  331 fps=131 q=29.0 size=     993kB time=00:00:11.22 bitrate= 724.6kbits/frame=  373 fps=123 q=29.0 size=    1347kB time=00:00:12.66 bitrate= 871.2kbits/frame=  424 fps=120 q=29.0 size=    1704kB time=00:00:14.61 bitrate= 955.1kbits/frame=  450 fps=110 q=-1.0 Lsize=    2214kB time=00:00:15.00 bitrate=1208.8kbits/s dup=75 drop=0    
video:1775kB audio:176kB subtitle:0 global headers:0kB muxing overhead 13.458446%
[libx264 @ 0x102873000] frame I:10    Avg QP:21.48  size: 15072
[libx264 @ 0x102873000] frame P:295   Avg QP:23.69  size:  4993
[libx264 @ 0x102873000] frame B:145   Avg QP:25.64  size:  1340
[libx264 @ 0x102873000] consecutive B-frames: 40.7% 48.0%  3.3%  8.0%
[libx264 @ 0x102873000] mb I  I16..4: 17.6% 67.6% 14.7%
[libx264 @ 0x102873000] mb P  I16..4:  5.7% 12.8%  1.4%  P16..4: 31.9%  9.3%  4.0%  0.0%  0.0%    skip:34.8%
[libx264 @ 0x102873000] mb B  I16..4:  0.2%  0.3%  0.1%  B16..8: 25.6%  3.7%  0.7%  direct: 1.7%  skip:67.6%  L0:30.1% L1:64.4% BI: 5.5%
[libx264 @ 0x102873000] 8x8 transform intra:64.7% inter:77.3%
[libx264 @ 0x102873000] coded y,uvDC,uvAC intra: 42.7% 60.7% 18.1% inter: 14.1% 20.1% 0.8%
[libx264 @ 0x102873000] i16 v,h,dc,p: 35% 30%  6% 29%
[libx264 @ 0x102873000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 22% 22%  4%  6%  6%  7%  5%  4%
[libx264 @ 0x102873000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 22% 13%  4%  8%  8%  8%  5%  3%
[libx264 @ 0x102873000] i8c dc,h,v,p: 56% 21% 18%  5%
[libx264 @ 0x102873000] Weighted P-Frames: Y:12.5% UV:8.8%
[libx264 @ 0x102873000] ref P L0: 65.7% 18.3% 11.5%  4.2%  0.3%
[libx264 @ 0x102873000] ref B L0: 87.6% 12.4%  0.0%
[libx264 @ 0x102873000] ref B L1: 99.7%  0.3%
[libx264 @ 0x102873000] kb/s:968.60

ffmpeg -i console with -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr

ffmpeg -i output_ffmpeg_nal_m2ts.m2ts ffmpeg version 1.0.git-5a2f3f0 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan  2 2013 18:09:20 with gcc 4.7.2 (MacPorts gcc47 4.7.2_2)
  configuration: --prefix=/sw --cc=gcc-mp-4.7 --cxx=g++-mp-4.7 --extra-cflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --extra-cxxflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-libfaac --enable-libopenjpeg --enable-libschroedinger --enable-libmodplug --enable-libxvid --enable-libfreetype --enable-openssl --enable-avfilter --enable-filters --arch=x86_64 --cpu=corei7-avx --enable-libass --enable-libbluray --enable-libopencore_amrwb --enable-libopencore_amrnb
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 85.100 / 54. 85.100
  libavformat    54. 59.100 / 54. 59.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.102 /  3. 30.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x10280ec00] max_analyze_duration 5000000 reached at 5005000
Input #0, mpegts, from 'output_ffmpeg_nal_m2ts.m2ts':
  Duration: 00:00:15.05, start: 1.333289, bitrate: 1205 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 720x480 [SAR 32:27 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](und): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 96 kb/s
At least one output file must be specified

making console without -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr

ffmpeg  -i input.mp4  -t 15  -vf "fifo, scale= 720:480" -vcodec libx264 -aspect 16:9 -r 29.97 -acodec ac3 -ac 2 -ar 48000 -ab 96000 output_ffmpeg_m2ts.m2ts
ffmpeg version 1.0.git-5a2f3f0 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan  2 2013 18:09:20 with gcc 4.7.2 (MacPorts gcc47 4.7.2_2)
  configuration: --prefix=/sw --cc=gcc-mp-4.7 --cxx=g++-mp-4.7 --extra-cflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --extra-cxxflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-libfaac --enable-libopenjpeg --enable-libschroedinger --enable-libmodplug --enable-libxvid --enable-libfreetype --enable-openssl --enable-avfilter --enable-filters --arch=x86_64 --cpu=corei7-avx --enable-libass --enable-libbluray --enable-libopencore_amrwb --enable-libopencore_amrnb
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 85.100 / 54. 85.100
  libavformat    54. 59.100 / 54. 59.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.102 /  3. 30.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2013-01-02 11:53:23
  Duration: 00:04:11.16, start: 0.000000, bitrate: 5772 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 5578 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s
    Metadata:
      creation_time   : 2013-01-02 11:53:24
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
[libx264 @ 0x102873000] using SAR=32/27
[libx264 @ 0x102873000] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 0x102873000] profile High, level 3.0
Output #0, mpegts, to 'output_ffmpeg_m2ts.m2ts':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf54.59.100
    Stream #0:0(und): Video: h264, yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=-1--1, 90k tbn, 29.97 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: ac3, 48000 Hz, stereo, fltp, 96 kb/s
    Metadata:
      creation_time   : 2013-01-02 11:53:24
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> ac3)
Press [q] to stop, [?] for help
frame=   80 fps=0.0 q=29.0 size=      61kB time=00:00:02.93 bitrate= 169.9kbits/frame=  148 fps=147 q=29.0 size=     269kB time=00:00:04.89 bitrate= 450.4kbits/frame=  214 fps=142 q=29.0 size=     498kB time=00:00:07.32 bitrate= 557.3kbits/frame=  282 fps=140 q=29.0 size=     695kB time=00:00:09.75 bitrate= 584.0kbits/frame=  335 fps=133 q=29.0 size=    1020kB time=00:00:11.22 bitrate= 744.3kbits/frame=  377 fps=125 q=26.0 size=    1362kB time=00:00:12.66 bitrate= 880.9kbits/frame=  428 fps=121 q=29.0 size=    1720kB time=00:00:14.61 bitrate= 964.0kbits/frame=  450 fps=111 q=-1.0 Lsize=    2207kB time=00:00:15.00 bitrate=1205.3kbits/s dup=75 drop=0    
video:1771kB audio:176kB subtitle:0 global headers:0kB muxing overhead 13.398644%
[libx264 @ 0x102873000] frame I:10    Avg QP:21.48  size: 15034
[libx264 @ 0x102873000] frame P:295   Avg QP:23.69  size:  4984
[libx264 @ 0x102873000] frame B:145   Avg QP:25.69  size:  1329
[libx264 @ 0x102873000] consecutive B-frames: 40.7% 48.0%  3.3%  8.0%
[libx264 @ 0x102873000] mb I  I16..4: 17.6% 67.6% 14.7%
[libx264 @ 0x102873000] mb P  I16..4:  5.7% 12.9%  1.4%  P16..4: 31.8%  9.3%  4.0%  0.0%  0.0%    skip:34.8%
[libx264 @ 0x102873000] mb B  I16..4:  0.2%  0.3%  0.1%  B16..8: 25.6%  3.7%  0.7%  direct: 1.7%  skip:67.6%  L0:30.1% L1:64.4% BI: 5.5%
[libx264 @ 0x102873000] 8x8 transform intra:64.7% inter:77.3%
[libx264 @ 0x102873000] coded y,uvDC,uvAC intra: 42.7% 60.8% 18.1% inter: 14.1% 20.1% 0.8%
[libx264 @ 0x102873000] i16 v,h,dc,p: 35% 30%  6% 30%
[libx264 @ 0x102873000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 22% 22%  4%  6%  6%  7%  5%  4%
[libx264 @ 0x102873000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 22% 13%  4%  8%  8%  8%  5%  3%
[libx264 @ 0x102873000] i8c dc,h,v,p: 56% 21% 18%  5%
[libx264 @ 0x102873000] Weighted P-Frames: Y:12.5% UV:8.8%
[libx264 @ 0x102873000] ref P L0: 65.6% 18.3% 11.6%  4.2%  0.3%
[libx264 @ 0x102873000] ref B L0: 87.7% 12.3%  0.0%
[libx264 @ 0x102873000] ref B L1: 99.7%  0.3%
[libx264 @ 0x102873000] kb/s:966.09

ffmpeg -i console without -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr

ffmpeg -i output_ffmpeg_m2ts.m2ts
ffmpeg version 1.0.git-5a2f3f0 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan  2 2013 18:09:20 with gcc 4.7.2 (MacPorts gcc47 4.7.2_2)
  configuration: --prefix=/sw --cc=gcc-mp-4.7 --cxx=g++-mp-4.7 --extra-cflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --extra-cxxflags='-mtune=native -mno-avx -mfpmath=sse -msse4.2' --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-libfaac --enable-libopenjpeg --enable-libschroedinger --enable-libmodplug --enable-libxvid --enable-libfreetype --enable-openssl --enable-avfilter --enable-filters --arch=x86_64 --cpu=corei7-avx --enable-libass --enable-libbluray --enable-libopencore_amrwb --enable-libopencore_amrnb
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 85.100 / 54. 85.100
  libavformat    54. 59.100 / 54. 59.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.102 /  3. 30.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x10280ec00] max_analyze_duration 5000000 reached at 5005000
Input #0, mpegts, from 'output_ffmpeg_m2ts.m2ts':
  Duration: 00:00:14.99, start: 1.394667, bitrate: 1206 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 720x480 [SAR 32:27 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](und): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 96 kb/s
At least one output file must be specified

Attachments (2)

output_ffmpeg_nal_m2ts.m2ts (2.2 MB ) - added by bonconboy 12 years ago.
with -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr
output_ffmpeg_m2ts.m2ts (2.2 MB ) - added by bonconboy 12 years ago.
without -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr

Change History (4)

by bonconboy, 12 years ago

Attachment: output_ffmpeg_nal_m2ts.m2ts added

with -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr

by bonconboy, 12 years ago

Attachment: output_ffmpeg_m2ts.m2ts added

without -x264opts vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr

comment:1 by Carl Eugen Hoyos, 12 years ago

Component: FFmpegundetermined

Sorry, I again do not understand the ticket;-(

Why do you want to use "vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr"?
Or in other words: If it works fine without, why do you believe there is a bug?

And if you can answer the two questions:
Do any of the following (untested) x264 options make a difference (does it work for some but not for others)?
"vbv-maxrate=12000:vbv-bufsize=12000"
"vbv-maxrate=12000:nal-hrd=vbr"
"vbv-bufsize=12000:nal-hrd=vbr"

in reply to:  1 comment:2 by bonconboy, 12 years ago

Replying to cehoyos:

Sorry, I again do not understand the ticket;-(

Please don't mind. Probably my explanation is not enough.

Why do you want to use "vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr"?

In general, nal-hrd=vbr enhances the conmpatibity of a video stream.
And blu-ray needs nal-hrd=vbr. Many AVCHD reproduction equipment, too.
https://sites.google.com/site/x264bluray/home
http://forum.doom9.org/showthread.php?t=154533
http://mailman.videolan.org/pipermail/x264-devel/2010-March/007049.html
an example in x264(r1480)

x264 --crf 16 --preset veryslow --tune film --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 -o

"bluray-compat" of x264 option forces the number of bframe, bpyramid(=normal or strict), weightp(0 or 1), aud=1、and nal-hrd=vbr. Of course, even when using "vbv-maxrate=12000:vbv-bufsize=12000:bluray-compat", the above problem appears.

Or in other words: If it works fine without, why do you believe there is a bug?

When using "vbv-maxrate=12000:vbv-bufsize=12000:nal-hrd=vbr" with handbrake to make mkv or mp4 for converting to AVCHD, no problem.
And I understand nal is addressed in libavformat/avc.c in ffmpeg.

And if you can answer the two questions:
Do any of the following (untested) x264 options make a difference (does it work for some but not for others)?
"vbv-maxrate=12000:vbv-bufsize=12000"

No problem. x264 addresses vbv-maxrate and vbv-bufsize, independent of nal, though both are the parameter of nal.

"vbv-maxrate=12000:nal-hrd=vbr"
"vbv-bufsize=12000:nal-hrd=vbr"

x264 ignore these because nal needs vbv-maxrate and vbv-bufsize.
If you need files and console, I will upload them.

Last edited 12 years ago by bonconboy (previous) (diff)
Note: See TracTickets for help on using tickets.