Mystery black frames when encoding files with audio

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
danadiamond
Posts: 11
Joined: Mon Nov 23, 2020 10:36 pm

Mystery black frames when encoding files with audio

Post by danadiamond »

Description of problem or question:

This is my 2nd attempt to get help on this issue, sorry for the redundancy but it was not answered.

I have a ProRes video with audio. I noticed black frames at the end of my video when it was looping on Instagram so i knew something was wrong.

I had encoded my file in Handbrake, and the resulting MP4 leaves a handful of black frames at the end (these black frames are full frame, not top/bottom)

in Quicktime, the black frames are not initially visible in normal playback -so I checked the MP4 and realized if you manually advance the playhead in quicktime to the last frame, you’ll see the black frames.

Note: This issue only seems to happen when the orig file has audio.


Steps to reproduce the problem (If Applicable):

I have found this issue to persist even when I disable the decomb and interlace detection filters which was the initial suggestion to try. I have tried tests & when encoding an audio-less video file, that one comes out sans black frames which you can see here:
https://www.dropbox.com/sh/wjcnntilnrlv ... J1mWa?dl=0

The file "LT dance w audio.mp4" has the black frames
The file "LT dance no audio.mp4" has no black frames

Please download these / advance the playhead to the end to see the black frames


HandBrake version (e.g., 1.0.0):
V.1.3.3



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Mac 10.14.4 Mojave

Regarding the logs, since I made two tests, there are two logs, available here:
https://www.dropbox.com/sh/vaccc5930sbu ... 9rhBa?dl=0
the log file below is from the one with issues (files with audio)


HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

HandBrake Activity Log for Session: 2021-02-12T23:14:08Z
Handbrake Version: 1.3.3 (2020061300)
LT dance w audio.mp4
Preset: Klipsch 2
[00:14:08] macgui: QueueCore work done
[00:14:08] macgui: QueueCore scanning specifically for title: 1
[00:14:08] CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
[00:14:08]  - Intel microarchitecture Kaby Lake
[00:14:08]  - logical processor count: 12
[00:14:08] hb_scan: path=/Volumes/G-DRIVE SSD/WORK_ssd/Jobs_Berlin2020/Handbrake export tests/LT dance w audio.mov, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /Volumes/G-DRIVE SSD/WORK_ssd/Jobs_Berlin2020/Handbrake export tests/LT dance w audio.mov
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2585: nav_get_title_list(/Volumes/G-DRIVE SSD/WORK_ssd/Jobs_Berlin2020/Handbrake export tests/LT dance w audio.mov/) failed
[00:14:08] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.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
[00:14:08] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/G-DRIVE SSD/WORK_ssd/Jobs_Berlin2020/Handbrake export tests/LT dance w audio.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2021-02-12T23:12:10.000000Z
  Duration: 00:00:00.71, start: 0.000000, bitrate: 83076 kb/s
    Stream #0:0(eng): Video: prores (LT) (apcs / 0x73637061), yuv422p10le(tv, bt709, progressive), 1080x1080, 69697 kb/s, SAR 1:1 DAR 1:1, 24 fps, 24 tbr, 24 tbn, 24 tbc (default)
    Metadata:
      creation_time   : 2021-02-12T23:12:10.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422 LT
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2021-02-12T23:12:10.000000Z
      handler_name    : Apple Sound Media Handler
      timecode        : 00:00:00:00
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2021-02-12T23:12:10.000000Z
      handler_name    : Time Code Media Handler
      timecode        : 00:00:00:00
[00:14:08] scan: decoding previews for title 1
[00:14:08] scan: audio 0x1: pcm_s16le, rate=48000Hz, bitrate=1536000 English (pcm_s16le) (2.0 ch) (1536 kbps)
[00:14:09] scan: 10 previews, 1080x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 1.00:1, PAR 1:1
[00:14:09] Title is likely interlaced or telecined (10 out of 10 previews). You should do something about that.
[00:14:09] libhb: scan thread found 1 valid title(s)
[00:14:09] macgui: QueueCore scan done
[00:14:09] macgui: QueueCore started encoding LT dance w audio.mp4
[00:14:09] Starting work at: Sat Feb 13 00:14:09 2021

[00:14:09] macgui: QueueCore with preset Klipsch 2
[00:14:09] 1 job(s) to process
[00:14:09] Starting Task: Encoding Pass
[00:14:09] Skipping crop/scale filter
[00:14:09] work: only 1 chapter, disabling chapter markers
[00:14:09] job configuration:
[00:14:09]  * source
[00:14:09]    + /Volumes/G-DRIVE SSD/WORK_ssd/Jobs_Berlin2020/Handbrake export tests/LT dance w audio.mov
[00:14:09]    + title 1, chapter(s) 1 to 1
[00:14:09]    + container: mov,mp4,m4a,3gp,3g2,mj2
[00:14:09]    + data rate: 83076 kbps
[00:14:09]  * destination
[00:14:09]    + /Volumes/G-DRIVE SSD/WORK_ssd/Jobs_Berlin2020/Handbrake export tests/LT dance w audio.mp4
[00:14:09]    + container: MPEG-4 (libavformat)
[00:14:09]  * video track
[00:14:09]    + decoder: prores
[00:14:09]      + bitrate 69697 kbps
[00:14:09]    + filter
[00:14:09]      + Framerate Shaper (mode=1:rate=27000000/1125000)
[00:14:09]        + frame rate: 24.000 fps -> constant 24.000 fps
[00:14:09]    + Output geometry
[00:14:09]      + storage dimensions: 1080 x 1080
[00:14:09]      + pixel aspect ratio: 1 : 1
[00:14:09]      + display dimensions: 1080 x 1080
[00:14:09]    + encoder: H.264 (libx264)
[00:14:09]      + preset:  fast
[00:14:09]      + options: keyint=12:min-keyint=1:ref=1:bframes=0:qcomp=0.8:aq-strength=0.5:dct-decimate=0:fast-pskip=0:deblock=-2,-2
[00:14:09]      + profile: high
[00:14:09]      + level:   auto
[00:14:09]      + quality: 33.50 (RF)
[00:14:09]      + color profile: 1-1-1
[00:14:09]  * audio track 1
[00:14:09]    + decoder: English (pcm_s16le) (2.0 ch) (1536 kbps) (track 1, id 0x1)
[00:14:09]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[00:14:09]    + mixdown: Stereo
[00:14:09]    + dither: triangular
[00:14:09]    + encoder: AAC (Apple AudioToolbox)
[00:14:09]      + bitrate: 320 kbps, samplerate: 48000 Hz
[00:14:09] sync: expecting 16 video frames
[00:14:09] encx264: min-keyint: 1, keyint: 12
[00:14:09] encx264: encoding at constant RF 33.500000
[00:14:09] encx264: unparsed options: keyint=12:keyint-min=1:ref=1:bframes=0:qcomp=0.8:aq-strength=0.5:dct-decimate=0:fast-pskip=0:deblock=-2,-2:weightp=1:subme=6:rc-lookahead=30
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 3.2, 4:2:0, 8-bit
[00:14:09] reader: done. 1 scr changes
[00:14:09] sync: first pts video is 0
[00:14:09] sync: "Chapter 1" (1) at frame 1 time 0
[00:14:09] sync: first pts audio 0x1 is 0
[00:14:09] work: average encoding speed for job is 0.000000 fps
[00:14:09] vfr: 17 frames output, 0 dropped and 0 duped for CFR/PFR
[00:14:09] vfr: lost time: 0 (0 frames)
[00:14:09] vfr: gained time: 0 (0 frames) (0 not accounted for)
[00:14:09] pcm_s16le-decoder done: 34 frames, 0 decoder errors
[00:14:09] prores-decoder done: 17 frames, 0 decoder errors
[00:14:09] sync: got 17 frames, 16 expected
[00:14:09] sync: framerate min 24.000 fps, max 24.000 fps, avg 24.000 fps
x264 [info]: frame I:2     Avg QP:32.24  size: 95622
x264 [info]: frame P:15    Avg QP:34.88  size:  5500
x264 [info]: mb I  I16..4: 18.4% 64.3% 17.3%
x264 [info]: mb P  I16..4:  0.1%  0.2%  0.0%  P16..4:  7.5%  5.9%  4.1%  0.0%  0.0%    skip:82.1%
x264 [info]: 8x8 transform intra:64.4% inter:40.8%
x264 [info]: coded y,uvDC,uvAC intra: 42.3% 21.2% 15.8% inter: 5.0% 1.7% 1.0%
x264 [info]: i16 v,h,dc,p: 79% 12%  8%  1%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 20% 36%  3%  3%  4%  3%  4%  4%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 17%  7%  9%  8%  4%  7%  5%
x264 [info]: i8c dc,h,v,p: 78% 11%  9%  2%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: kb/s:3091.66
[00:14:09] mux: track 0, 17 frames, 273653 bytes, 2918.97 kbps, fifo 32
[00:14:09] mux: track 1, 36 frames, 34053 bytes, 363.23 kbps, fifo 64
[00:14:09] Finished work at: Sat Feb 13 00:14:09 2021

[00:14:09] libhb: work result = 0

rollin_eng
Veteran User
Posts: 3925
Joined: Wed May 04, 2011 11:06 pm

Re: Mystery black frames when encoding files with audio

Post by rollin_eng »

Both your outputs have 17 frames, how many black frames are you seeing at the end?
danadiamond
Posts: 11
Joined: Mon Nov 23, 2020 10:36 pm

Re: Mystery black frames when encoding files with audio

Post by danadiamond »

Hi & thanks for the reply.
In this particular test, just seeing one black frame.

In the past, in other MP4s there's been more than one.
mduell
Veteran User
Posts: 7438
Joined: Sat Apr 21, 2007 8:54 pm

Re: Mystery black frames when encoding files with audio

Post by mduell »

How many frames do you think your input is?
danadiamond
Posts: 11
Joined: Mon Nov 23, 2020 10:36 pm

Re: Mystery black frames when encoding files with audio

Post by danadiamond »

Sorry, what do you mean by my input?
mduell
Veteran User
Posts: 7438
Joined: Sat Apr 21, 2007 8:54 pm

Re: Mystery black frames when encoding files with audio

Post by mduell »

The source file you're providing to HB.
danadiamond
Posts: 11
Joined: Mon Nov 23, 2020 10:36 pm

Re: Mystery black frames when encoding files with audio

Post by danadiamond »

It doesn't seem to matter. The problem occurs in different lengths of sources.
Would it be helpful if I did a similar test to these, but longer and with a different source?

Thank you.
danadiamond
Posts: 11
Joined: Mon Nov 23, 2020 10:36 pm

Re: Mystery black frames when encoding files with audio

Post by danadiamond »

Hi again...any thoughts, by chance? Please let me know if you'd like to see a longer test (s) to troubleshoot with.
mduell
Veteran User
Posts: 7438
Joined: Sat Apr 21, 2007 8:54 pm

Re: Mystery black frames when encoding files with audio

Post by mduell »

How many frames do you think your input is?
danadiamond
Posts: 11
Joined: Mon Nov 23, 2020 10:36 pm

Re: Mystery black frames when encoding files with audio

Post by danadiamond »

As I mentioned, it varies. Each time I make a video it's a different length. Should I make a new test and log?
mduell
Veteran User
Posts: 7438
Joined: Sat Apr 21, 2007 8:54 pm

Re: Mystery black frames when encoding files with audio

Post by mduell »

How about this video you already posted the log for?
Post Reply