Opened 6 years ago

Closed 6 years ago

#6965 closed defect (invalid)

Native aac encoder broken for 5.1 side input and at least some decoders

Reported by: Bhaumik Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: aac regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
If I have a File in .MKV with x264 and I want to compress it to save disk space, by using Processor/software encoding into x265, I get proper outfile without any error, but Audio is single sided i.e. on right side, and buggy, with lot of static in left side
I converted many .mp4 files with same parameters and there was no problem with that, but all the time I used to convert .mkv files, just wasted
How to reproduce:
just convert using the given command line, convert any H.264 to H.265
with command line

% ffmpeg -fflags +genpts -i "name.mkv" -c:v libx265 -preset fast -crf 20 -c:a aac -copyts "name.mkv"
ffmpeg version
built on ... Using ffmpeg 20180102
}}}

The File's info before conversion i.e. in H.264 Form

General
Unique ID : 238677808599741308780759886148926411450 (0xB38FAC825EDC4FF7A1032DE0E2AF92BA)
Complete name : D:\ffmpeg\bin\My Cousin Rachel 2017.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 8.29 GiB
Duration : 1 h 46 min
Overall bit rate : 11.2 Mb/s
Encoded date : UTC 2017-08-21 09:43:21
Writing application : mkvmerge v10.0.0 ('To Drown In You') 64bit
Writing library : libebml v1.3.4 + libmatroska v1.4.5

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, RefFrames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 1 h 46 min
Bit rate : 9 668 kb/s
Width : 1 920 pixels
Height : 804 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.261
Stream size : 7.17 GiB (86%)
Writing library : x264 core 149 r2771+45 509cceb 7mod [8-bit@all X86_64]
Encoding settings : cabac=1 / ref=4 / deblock=1:-3:-3 / analyse=0x3:0x113 / me=umh / subme=10 / psy=1 / fade_compensate=0.00 / psy_rd=0.90:0.10 / mixed_ref=1 / me_range=48 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=0 / crf=20.0000 / qcomp=0.70 / qpmin=0:0:0 / qpmax=69:69:69 / qpstep=4 / vbv_maxrate=35000 / vbv_bufsize=35000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / pb_ratio=1.30 / aq=3:1.00 / aq-sensitivity=10.00 / aq-factor=1.00:1.00:1.00 / aq2=0 / aq3=2:[0.50:0.50]:[0.50:0.50]:[0.50:0.50]:[0.50:0.50] / aq3-sensitivity=10.00 / aq3-factor=[1.00:1.00]:[1.00:1.00]:[1.00:1.00] / aq3-boundary=192:64:24
Language : English
Default : Yes
Forced : No
Color range : Limited
Matrix coefficients : BT.709

Audio
ID : 2
Format : DTS
Format/Info : Digital Theater Systems
Codec ID : A_DTS
Duration : 1 h 46 min
Bit rate mode : Constant
Bit rate : 1 509 kb/s
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossy
Stream size : 1.12 GiB (13%)
Language : English
Default : Yes
Forced : No

and after successful conversion to H.265 without any errors

General
Unique ID : 174474705265077947022489332329785451350 (0x83429B1EEFF02396F89C3D940F71E356)
Complete name : D:\ffmpeg\bin\My Cousin Rachel 2017x265.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 1.70 GiB
Duration : 1 h 46 min
Overall bit rate : 2 293 kb/s
Writing application : Lavf58.3.100
Writing library : Lavf58.3.100
ErrorDetectionType : Per level 1

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Width : 1 920 pixels
Height : 804 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Variable
Original frame rate : 23.976 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Writing library : x265 2.6+22-ff02513b92c0:[Windows][GCC 7.2.0][64 bit] 8bit
Encoding settings : cpuid=1173503 / frame-threads=3 / numa-pools=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x804 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=0 / b-pyramid / bframe-bias=0 / rc-lookahead=15 / lookahead-slices=5 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=2 / no-early-skip / rskip / fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=20.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=1 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-save=(null) / analysis-load=(null) / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1
Language : English
Default : Yes
Forced : No
Statistics Tags Issue : mkvmerge v10.0.0 ('To Drown In You') 64bit 2017-08-21 09:43:21 / Lavf58.3.100
FromStats_BitRate : 9667882
FromStats_Duration : 01:46:08.884000000
FromStats_FrameCount : 152700
FromStats_StreamSize : 7696677534

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC-2
Duration : 1 h 46 min
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: C, Back: L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Writing library : Lavc58.9.100 aac
Language : English
Default : Yes
Forced : No
Statistics Tags Issue : mkvmerge v10.0.0 ('To Drown In You') 64bit 2017-08-21 09:43:21 / Lavf58.3.100
FromStats_BitRate : 1509000
FromStats_Duration : 01:46:08.885000000
FromStats_FrameCount : 597081
FromStats_StreamSize : 1201326972

Change History (8)

comment:1 by Carl Eugen Hoyos, 6 years ago

Component: ffmpegundetermined
Priority: importantnormal

To make this a valid ticket please provide the command line you tested together with the complete, uncut console output.

comment:2 by Bhaumik, 6 years ago

I cannot do that, unfortunately, I closed ffmpeg, and if you request me to do that again, I might have to waste another 4-5 Hours,

but I request you to just try any .mkv file, with DTS or AAC audio

comment:3 by Carl Eugen Hoyos, 6 years ago

You could consider to encode the first ten seconds which likely would not take several hours...

comment:4 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedavcodec
Keywords: aac regression added
Priority: normalimportant
Version: unspecifiedgit-master

Apparently a regression since fc9dcfe7d50d7f1b38fb287b4d92b5f3fc4bfb05

comment:5 by Carl Eugen Hoyos, 6 years ago

Summary: Audio Copying from MKV for x265 makes the Audio One sidedNative aac encodes 5.1 side input as (unusual) 5.1 side instead of expected 5.1 back

comment:6 by Carl Eugen Hoyos, 6 years ago

Summary: Native aac encodes 5.1 side input as (unusual) 5.1 side instead of expected 5.1 backNative aac encoder broken for 5.1 side input and at least some decoders

comment:7 by Bhaumik, 6 years ago

So, did you guys fixed it?

Any update?

comment:8 by Rostislav Pehlivanov, 6 years ago

Resolution: invalid
Status: newclosed

Sounds like you're using decoders which can't properly decode PCE elements.
Post full encoding log. Try to convert them to basic aac layouts using something like -channel_layout 5.1 or using the aresample filter. Closing bug since we can't fix broken encoders from lazy vendors. Could reopen if it turns out to be an encoder bug after all.

Note: See TracTickets for help on using tickets.