[Upstream Bug] HB doesn't use PCM audio from a CS6 encoded .avi

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
Djfe
Bright Spark User
Posts: 178
Joined: Tue May 13, 2014 8:01 pm

[Upstream Bug] HB doesn't use PCM audio from a CS6 encoded .avi

Post by Djfe »

Please describe the problem in as much detail as possible:
Handbrake doesn't use the audio of my lossless .avi files that got encoded by the Adobe Media Encoder
What are the steps to reproduce this problem:
Create a lossless .avi file with Premiere Pro and output to avi with lagarith and uncompressed (pcm)
Or use my provided test file: https://www.dropbox.com/s/ql82h3m2opzii ... 1.avi?dl=0
What version of HandBrake you are running:
The current nightly.
What operating system and version and you running (e.g. OSX 10.11, Windows 7, Ubuntu 14):
Win 10 Education 64bit
If there was any exception or error displayed, please copy it and paste it here:

Please include the scan or encode log:

Code: Select all

HandBrake Nightly 20160712030534-7d4e3f9-master (2016071401) - 64bit Version
OS: Microsoft Windows NT 10.0.10586.0 - 64bit
CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Ram: 16232 MB, 
GPU Information:
  Intel(R) HD Graphics 530 - 20.19.15.4285
  NVIDIA GeForce GTX 980 - 10.18.13.6881
Screen: 2560x1440
Temp Dir: C:\Users\x\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake Nightly
Data Dir: C:\Users\x\AppData\Roaming\HandBrake Team\HandBrake\0.0.0.0

-------------------------------------------


# Starting Encode ...

[11:13:28] 1 job(s) to process
[11:13:28] json job:
{

  "Audio": {

    "AudioList": [],

    "CopyMask": [

      1073807360,

      1073743872,

      1074003968,

      1073750016,

      1090519040,

      1074790400,

      1074266112,

      1107296256

    ],

    "FallbackEncoder": 2048

  },

  "Destination": {

    "ChapterList": [

      {

        "Name": "Chapter 1"

      }

    ],

    "ChapterMarkers": true,

    "File": "C:\\Users\\x\\Music\\test.mkv",

    "Mp4Options": {

      "IpodAtom": false,

      "Mp4Optimize": false

    },

    "Mux": 2097152

  },

  "Filters": {

    "FilterList": [

      {

        "ID": 11,

        "Settings": {

          "crop-bottom": "0",

          "crop-left": "0",

          "crop-right": "0",

          "crop-top": "0",

          "height": "1080",

          "width": "1920"

        }

      },

      {

        "ID": 6,

        "Settings": {

          "mode": "0"

        }

      }

    ]

  },

  "PAR": {

    "Num": 1,

    "Den": 1

  },

  "Metadata": {},

  "SequenceID": 0,

  "Source": {

    "Angle": 1,

    "Range": {

      "Type": "chapter",

      "Start": 1,

      "End": 1

    },

    "Title": 1,

    "Path": "C:\\Users\\x\\Music\\Sequence 01.avi"

  },

  "Subtitle": {

    "Search": {

      "Burn": true,

      "Default": false,

      "Enable": true,

      "Forced": false

    },

    "SubtitleList": []

  },

  "Video": {

    "Encoder": 65536,

    "Level": "auto",

    "TwoPass": false,

    "Turbo": false,

    "ColorMatrixCode": 0,

    "Options": "",

    "Preset": "fast",

    "Profile": "high",

    "Quality": 22.0,

    "Tune": "film",

    "OpenCL": false,

    "HWDecode": false,

    "QSV": {

      "Decode": true,

      "AsyncDepth": 0

    }

  }

}
[11:13:28] CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
[11:13:28]  - Intel microarchitecture Skylake
[11:13:28]  - logical processor count: 8
[11:13:28] OpenCL device #1: Intel(R) Corporation Intel(R) HD Graphics 530
[11:13:28]  - OpenCL version: 2.0 
[11:13:28]  - driver version: 20.19.15.4285
[11:13:28]  - device type:    GPU
[11:13:28]  - supported:      YES
[11:13:28] OpenCL device #2: NVIDIA Corporation GeForce GTX 980
[11:13:28]  - OpenCL version: 1.2 CUDA
[11:13:28]  - driver version: 368.81
[11:13:28]  - device type:    GPU
[11:13:28]  - supported:      no
[11:13:28] Intel Quick Sync Video support: yes
[11:13:28]  - Intel Media SDK hardware: API 1.16 (minimum: 1.3)
[11:13:28]  - H.264 encoder: yes
[11:13:28]     - preferred implementation: hardware (any)
[11:13:28]     - capabilities (hardware):  breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[11:13:28]  - H.265 encoder: yes
[11:13:28]     - preferred implementation: hardware (any)
[11:13:28]     - capabilities (hardware):  bpyramid vsinfo opt1
[11:13:28] hb_scan: path=C:\Users\x\Music\Sequence 01.avi, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image C:\Users\x\Music\Sequence 01.avi
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[11:13:28] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[11:13:28] dvd: not a dvd - trying as a stream/file instead
Input #0, avi, from 'C:\Users\x\Music\Sequence 01.avi':
  Metadata:
    date            : 2016-07-17T10:59:48+02:00
    encoder         : Adobe Premiere Pro CS6 (Windows)
  Duration: 00:00:09.88, start: 0.000000, bitrate: 3009 kb/s
    Stream #0.0: Video: lagarith, yuv420p, 1920x1080, 25 fps, 25 tbn
    Stream #0.1: Audio: [1][0][0][0] / 0x0001, 48000 Hz, stereo, 2304 kb/s
[11:13:28] scan: decoding previews for title 1
[11:13:28] scan: 10 previews, 1920x1080, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[11:13:28] libhb: scan thread found 1 valid title(s)
[11:13:28] Skipping subtitle scan.  No suitable subtitle tracks.
[11:13:28] starting job
[11:13:28] work: only 1 chapter, disabling chapter markers
[11:13:28] job configuration:
[11:13:28]  * source
[11:13:28]    + C:\Users\x\Music\Sequence 01.avi
[11:13:28]    + title 1, chapter(s) 1 to 1
[11:13:28]    + container: avi
[11:13:28]    + data rate: 3009 kbps
[11:13:28]  * destination
[11:13:28]    + C:\Users\x\Music\test.mkv
[11:13:28]    + container: Matroska (libavformat)
[11:13:28]  * video track
[11:13:28]    + decoder: lagarith
[11:13:28]    + filters
[11:13:28]      + Framerate Shaper (mode=0)
[11:13:28]        + frame rate: same as source (around 25.000 fps)
[11:13:28]      + Crop and Scale (width=1920:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[11:13:28]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[11:13:28]    + Output geometry
[11:13:28]      + storage dimensions: 1920 x 1080
[11:13:28]      + pixel aspect ratio: 1 : 1
[11:13:28]      + display dimensions: 1920 x 1080
[11:13:28]    + encoder: H.264 (libx264)
[11:13:28]      + preset:  fast
[11:13:28]      + tune:    film
[11:13:28]      + profile: high
[11:13:28]      + level:   auto
[11:13:28]      + quality: 22.00 (RF)
[11:13:28] sync: expecting 247 video frames
[11:13:28] encx264: encoding at constant RF 22.000000
[11:13:28] encx264: unparsed options: ref=2:rc-lookahead=30:subme=6:deblock=-1,-1:weightp=1:psy-rd=1,0.15
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
x264 [info]: profile High, level 4.0
[11:13:28] sync: first pts video is 0
[11:13:28] sync: "Chapter 1" (1) at frame 1 time 0
[11:13:29] reader: done. 1 scr changes
[11:13:30] work: average encoding speed for job is 0.000000 fps
[11:13:30] render: lost time: 0 (0 frames)
[11:13:30] render: gained time: 0 (0 frames) (0 not accounted for)
[11:13:30] lagarith-decoder done: 247 frames, 0 decoder errors
[11:13:30] sync: got 247 frames, 247 expected
[11:13:30] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.000 fps
x264 [info]: frame I:1     Avg QP: 8.47  size:  2143
x264 [info]: frame P:62    Avg QP: 8.20  size:    73
x264 [info]: frame B:184   Avg QP:11.67  size:    69
x264 [info]: consecutive B-frames:  0.4%  0.8%  0.0% 98.8%
x264 [info]: mb I  I16..4: 99.7%  0.0%  0.3%
x264 [info]: mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
x264 [info]: mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0: 0.0% L1:100.0% BI: 0.0%
x264 [info]: 8x8 transform intra:0.0% inter:0.0%
x264 [info]: coded y,uvDC,uvAC intra: 0.1% 0.4% 0.3% inter: 0.0% 0.0% 0.0%
x264 [info]: i16 v,h,dc,p: 95%  4%  1%  0%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 24% 39%  0%  0%  0%  0%  0%  0%
x264 [info]: i8c dc,h,v,p: 90%  3%  6%  0%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: kb/s:15.70
[11:13:30] mux: track 0, 247 frames, 19350 bytes, 15.60 kbps, fifo 256
[11:13:30] libhb: work result = 0

# Encode Completed ...
As you can see in the log, it even detects that there is pcm audio, but it neither shows it in the gui (audio tab) nor does it encode it into the new file.
If I remux the file with ffmpeg (copy video and audio streams) it works fine though.

Hopefully you are able to this fix :)

It was annoying to find out after a 22h encode (nlmeans with vp9) that the file I wanted to encode had no audio ^^

Regards,
Djfe
User avatar
s55
HandBrake Team
Posts: 10357
Joined: Sun Dec 24, 2006 1:05 pm

Re: HB doesn't use PCM audio from a CS6 encoded .avi

Post by s55 »

Looks like the version of libav we use, doesn't support that flavor of PCM.

We'll be upgrading to libav12 in the not so distance future when it releases so we'll see if that resolve this.
Djfe
Bright Spark User
Posts: 178
Joined: Tue May 13, 2014 8:01 pm

Re: HB doesn't use PCM audio from a CS6 encoded .avi

Post by Djfe »

ok, cool :)

I thought it was just a bug in HB, so I reported it here

just testet the current libav win nightly from June 1

It gives me the following error:

Code: Select all

[abuffer @ 0000000002af7360] Invalid sample format (null).
Error opening filters!
I'll report the issue on their bugzilla now, so it can get fixed sooner

according to -encoders and -decoders it should be able to de- and encode pcm_s24le (PCM signed 24-bit little-endian)
so it might be really just a minor issue relating how AME encodes it in detail

https://bugzilla.libav.org/show_bug.cgi?id=950
User avatar
s55
HandBrake Team
Posts: 10357
Joined: Sun Dec 24, 2006 1:05 pm

Re: HB doesn't use PCM audio from a CS6 encoded .avi

Post by s55 »

Should, but remember, we are not using a recent version of libav. Current versions may not have issues with it.

Edit: Nevermind, you've confirmed it in GIT HEAD.
Deleted User 11865

Re: HB doesn't use PCM audio from a CS6 encoded .avi

Post by Deleted User 11865 »

It could be that it was muxed incorrectly (though a demuxer bug might be more likely).
Djfe
Bright Spark User
Posts: 178
Joined: Tue May 13, 2014 8:01 pm

Re: HB doesn't use PCM audio from a CS6 encoded .avi

Post by Djfe »

ok it got fixed in the current nightly,
so the fix will find it's way into handbrake with the next upstream merge :)
Deleted User 11865

Re: HB doesn't use PCM audio from a CS6 encoded .avi

Post by Deleted User 11865 »

Nice :)
Deleted User 13735

Re: [Upstream Bug] HB doesn't use PCM audio from a CS6 encoded .avi

Post by Deleted User 13735 »

Audio
ID : 1
Format : PCM
Format settings, Endianness : Little
Format settings, Sign : Signed
Codec ID : 00001000-0000-0100-8000-00AA00389B71
Duration : 9s 880ms
Bit rate mode : Constant
Bit rate : 2 304 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 24 bits
Stream size : 2.71 MiB (77%)
Alignment : Aligned on interleaves
Interleave, duration : 988 ms (24.70 video frames)
Interleave, preload duration : 1000 ms
48/24 PCM audio is a bit of a red herring in AVI. 48/16 (Integer) is expected.
That said, it is nice that they fixed it for you.
Djfe
Bright Spark User
Posts: 178
Joined: Tue May 13, 2014 8:01 pm

Re: [Upstream Bug] HB doesn't use PCM audio from a CS6 encoded .avi

Post by Djfe »

Oh, I didn't know that. Good to know though :)
Since I'm only 20years old, my first encodes were all mp4s or 3gpp files. (downloading from YouTube for my old phone etc.)

avis already seemed fairly old to me and I barely came in touch with them.

The only reason I used the container, was to be able to export losslessly from Premiere and do the encoding in Handbrake and with x264, which did a far superior job.

And it offered 24bit, so I chose that of course, since my recorded audio was also a 24bit 48khz wav
(it even offered 5.1 surround, samplerates up to 96khz and 32bit and 32bit float ^^)

What leaves me wondering is, that libav generally had no issues with the remuxed pcm from ffmpeg, even though that was 24bit as well.

I'm glad they fixed it anyways though :)

what do you mean by red herring?
is it just unusual or does avi not tell the demuxer/decoder, what type of audio a certain stream is? (like an atom or so)
I couldn't find any info on that on the net
Post Reply