Severe decoding failure with 1080i50 H264 from UK satellite

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Severe decoding failure with 1080i50 H264 from UK satellite

Post by spooky »

Handbrake doesn't seem to be able to decode my H264 satellite captures properly - the output ends up with video corruption and frame skipping with the knock-on effect that audio drifts way out of sync. Blu-ray discs and other more 'standard' content decodes and encodes fine. The captures are completely free of any errors or discontinuities and other encoding platforms can handle the material fine.

Here's a 30s sample of the first 30 seconds of a show which reproduces the problem (47.7mb): https://dl.dropboxusercontent.com/u/147 ... _sample.ts

And here's my log from trying to encode the above sample:

Code: Select all

HandBrake svn5671 (Nightly Build) - 64bit Version
OS: Microsoft Windows NT 6.2.9200.0
CPU: Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
Ram: 15313 MB, Screen: 1280x1024
Temp Dir: C:\Users\spooky\AppData\Local\Temp\
Install Dir: C:\Program Files\Video\Handbrake
Data Dir: C:\Users\spooky\AppData\Roaming\HandBrake\HandBrake\0.0.0.5671

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

CLI Query:  -i "C:\Users\spooky\Desktop\Loothor_sample.ts" -t 1 --angle 1 -c 1 -o "C:\PCH\_qsv\Loothor Sample-1.mkv"  -f mkv  -w 1280 --loose-anamorphic  --modulus 16 -e qsv_h264 -b 3000 --cfr -a 1 -E copy -6 auto -R Auto -B 0 -D 0 --gain 0 --audio-fallback ac3 --h264-level="4.1"  --h264-profile=high  -x target-usage=2 --verbose=2
User Query: False

[12:33:09] Intel Quick Sync Video support: yes
[12:33:09]  - 3rd gen. Intel Core processor
[12:33:09]  - hardware name:    Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
[12:33:09]  - hardware version: 1.7 (minimum: 1.3)
[12:33:09] hb_init: starting libhb thread
[12:33:09] thread 3b650e0 started ("libhb")
HandBrake svn5671 (2013072701) - MinGW x86_64 - http://handbrake.fr
8 CPUs detected
Opening C:\Users\spooky\Desktop\Loothor_sample.ts...
[12:33:09] hb_scan: path=C:\Users\spooky\Desktop\Loothor_sample.ts, title_index=1
[12:33:09] thread 3b65280 started ("scan")
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\spooky\Desktop\Loothor_sample.ts/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\spooky\Desktop\Loothor_sample.ts/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:1725: nav_get_title_list(C:\Users\spooky\Desktop\Loothor_sample.ts) failed (0000000003b65e00)
[12:33:09] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[12:33:09] dvd: not a dvd - trying as a stream/file instead
[12:33:09] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[12:33:09] Found the following PIDS
[12:33:09]     Video PIDS : 
[12:33:09]       0x30 type H.264 (0x1b) (PCR)
[12:33:09]     Audio PIDS : 
[12:33:09]       0x41 type AC3 (0x81)
[12:33:09]     Subtitle PIDS : 
[12:33:09]     Other PIDS : 
[12:33:09]       0x50 type DVB Subtitling (0x0)
[12:33:09]       0x63 type DVB Teletext (0x0)
[12:33:09] stream id 0x41 (type 0x81 substream 0x0) audio 0x41
[12:33:09] scan: decoding previews for title 1
[12:33:09] scan: preview 1
[12:33:09] fifo_close: trashing 0 buffer(s)
[12:33:09] scan: audio 0x41: AC-3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch)
[h264 @ 0000000003bd32a0] mmco: unref short failure
[12:33:09] scan: preview 2
[12:33:09] scan: preview 3
[12:33:09] scan: preview 4
[h264 @ 0000000003bd32a0] mmco: unref short failure
[12:33:09] scan: preview 5
[h264 @ 0000000003bd32a0] mmco: unref short failure
[h264 @ 0000000003bd32a0] mmco: unref short failure
[12:33:09] scan: preview 6
[12:33:10] scan: preview 7
Scanning title 1 of 1, preview 7, 70.00 %[12:33:10] scan: preview 8
[12:33:10] scan: preview 9
[12:33:10] scan: preview 10
[12:33:10] scan: 10 previews, 1920x1080, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[12:33:10] stream: 9 good frames, 0 errors (0%)
[12:33:10] thread 3b65280 exited ("scan")
[12:33:10] thread 3b65280 joined ("scan")
[12:33:10] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: C:\Users\spooky\Desktop\Loothor_sample.ts
  + duration: 00:00:28
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 25.000 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:00:28
  + audio tracks:
    + 1, English (AC3) (2.0 ch) (iso639-2: eng), 48000Hz, 192000bps
  + subtitle tracks:
[12:33:10] thread 3b65280 started ("work")
[12:33:10] 1 job(s) to process
[12:33:10] starting job
[12:33:10] Auto Passthru: allowed codecs are AAC, AC3, DTS, DTS-HD, MP3
[12:33:10] Auto Passthru: fallback is AC3
[12:33:10] Auto Passthru: using AC3 Passthru for track 1
[12:33:10] sync: expecting 719 video frames
[12:33:10] job configuration:
[12:33:10]  * source
[12:33:10]    + C:\Users\spooky\Desktop\Loothor_sample.ts
[12:33:10]    + title 1, chapter(s) 1 to 1
[12:33:10]  * destination
[12:33:10]    + C:\PCH\_qsv\Loothor Sample-1.mkv
[12:33:10]    + container: Matroska (libmkv)
[12:33:10]  * video track
[12:33:10]    + decoder: h264
[12:33:10]      + bitrate 200 kbps
[12:33:10]    + filter
[12:33:10]      + Quick Sync Video VPP (1280:720:0:0:0:0_dei:0)
[12:33:10]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1280 * 720
[12:33:10]    + loose anamorphic
[12:33:10]      + storage dimensions: 1280 * 720, mod 16
[12:33:10]      + pixel aspect ratio: 1 / 1
[12:33:10]      + display dimensions: 1280 * 720
[12:33:10]    + encoder: H.264 (Intel QSV)
[12:33:10]      + options: target-usage=2
[12:33:10]      + h264 profile: high
[12:33:10]      + h264 level: 4.1
[12:33:10]      + bitrate: 3000 kbps, pass: 0
[12:33:10]  * audio track 1
[12:33:10]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x41)
[12:33:10]      + bitrate: 192 kbps, samplerate: 48000 Hz
[12:33:10]    + AC3 Passthru
[12:33:10] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[12:33:10] thread 3b794d0 started ("Reader")
[12:33:10] thread 3b68990 started ("Quick Sync Video VPP")
[12:33:10] thread 4a74130 started ("AudioSynchronization")
[12:33:10] reader: first SCR 914 id 0x41 DTS 18000
[12:33:10] thread 4a743f0 started ("Video decoder (libavcodec)")
[12:33:10] thread 4a75e90 started ("H.264/AVC encoder (Intel QSV)")
[12:33:10] thread 4a8b7d0 started ("AC3 decoder")
[12:33:10] thread 4a8b970 started ("Video Synchronization")
[12:33:10] thread 3c382b0 started ("Muxer")
[12:33:10] h264_qsv: "Chapter 1" (1) at frame 0 time 0
[12:33:10] qsv: Intel QSV/MediaSDK uses hardware implementation
[12:33:10] qsv: RateControlMethod:MFX_RATECONTROL_VBR TargetKbps:3000
[12:33:10] qsv: TargetUsage:2 AsyncDepth:4
[12:33:10] qsv: GopRefDist:4 GopPicSize:126 NumRefFrame:0
[12:33:10] sync: video time didn't advance - dropped 16 frames (delta 627 ms, current 74460, next 75600, dur 1140)
[12:33:11] sync: video time didn't advance - dropped 12 frames (delta 460 ms, current 369045, next 370800, dur 1755)
[12:33:11] sync: video time didn't advance - dropped 1 frames (delta 1 ms, current 1000953, next 1004400, dur 3447)
[12:33:11] sync: video time didn't advance - dropped 8 frames (delta 293 ms, current 1034430, next 1036800, dur 2370)
[12:33:12] sync: video time didn't advance - dropped 35 frames (delta 1378 ms, current 1834027, next 1836000, dur 1973)
[12:33:13] hb_ts_stream_decode - eof
[12:33:13] reader: done. 1 scr changes
[12:33:13] thread 3b794d0 exited ("Reader")
[12:33:13] work: average encoding speed for job is 0.000000 fps
[12:33:13] thread 4a8b7d0 exited ("AC3 decoder")
[12:33:13] thread 4a74130 exited ("AudioSynchronization")
[12:33:13] thread 3c382b0 exited ("Muxer")
[12:33:13] thread 4a8b970 exited ("Video Synchronization")
[12:33:13] thread 4a743f0 exited ("Video decoder (libavcodec)")
[12:33:13] thread 3b68990 exited ("Quick Sync Video VPP")
[12:33:13] thread 4a8b970 joined ("Video Synchronization")
[12:33:13] sync: got 704 frames, 719 expected
[12:33:13] thread 3b68990 joined ("Quick Sync Video VPP")
[12:33:13] qsv_filter[Default] done: max_surfaces: 12/32 , max_syncs: 7/32
[12:33:13] thread 4a74130 joined ("AudioSynchronization")
[12:33:13] thread 4a743f0 joined ("Video decoder (libavcodec)")
[12:33:13] h264_qsv-decoder done: 776 frames, 0 decoder errors, 0 drops
[12:33:13] thread 4a75e90 exited ("H.264/AVC encoder (Intel QSV)")
[12:33:13] thread 4a75e90 joined ("H.264/AVC encoder (Intel QSV)")
[12:33:13] enc_qsv done: frames: 704 in, 704 out
[12:33:14] thread 4a8b7d0 joined ("AC3 decoder")
[12:33:14] thread 3c382b0 joined ("Muxer")
[12:33:14] Writing Metadata to output file...
[12:33:14] mux: file size, 10778525 bytes
[12:33:14] mux: track 0, 704 frames, 10003327 bytes, 2564.96 kbps, fifo 1024
[12:33:14] mux: video bitrate error, -1696673 bytes
[12:33:14] mux: track 1, 975 frames, 748800 bytes, 192.00 kbps, fifo 1024
[12:33:14] mux: overhead, 15.72 bytes per frame
[12:33:14] thread 3b794d0 joined ("Reader")
[12:33:14] stream: 781 good frames, 0 errors (0%)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] fifo_close: trashing 0 buffer(s)
[12:33:14] Freed 32 buffers of size 1024
[12:33:14] Freed 5 buffers of size 2048
[12:33:14] Freed 18 buffers of size 4096
[12:33:14] Freed 32 buffers of size 8192
[12:33:14] Freed 32 buffers of size 16384
[12:33:14] Freed 32 buffers of size 32768
[12:33:14] Freed 17 buffers of size 65536
[12:33:14] Freed 6 buffers of size 131072
[12:33:14] Freed 2 buffers of size 262144
[12:33:14] Freed 2 buffers of size 524288
[12:33:14] Freed 9 buffers of size 2097152
[12:33:14] Freed 17 buffers of size 4194304
[12:33:14] Allocated 95602688 bytes of buffers on this pass and Freed 95602688 bytes, 0 bytes leaked
[12:33:14] thread 3b65280 exited ("work")
[12:33:14] thread 3b65280 joined ("work")
[12:33:14] libhb: work result = 0
Encode done!
[12:33:14] thread 3b650e0 exited ("libhb")
[12:33:14] thread 3b650e0 joined ("libhb")
HandBrake has exited.
I assume the visual glitches and the eventual audio sync loss are all down to these lines:

Code: Select all

[12:33:10] sync: video time didn't advance - dropped 16 frames (delta 627 ms, current 74460, next 75600, dur 1140)
[12:33:11] sync: video time didn't advance - dropped 12 frames (delta 460 ms, current 369045, next 370800, dur 1755)
[12:33:11] sync: video time didn't advance - dropped 1 frames (delta 1 ms, current 1000953, next 1004400, dur 3447)
[12:33:11] sync: video time didn't advance - dropped 8 frames (delta 293 ms, current 1034430, next 1036800, dur 2370)
[12:33:12] sync: video time didn't advance - dropped 35 frames (delta 1378 ms, current 1834027, next 1836000, dur 1973)
But I don't see why the decoder is choking like that, there's nothing wrong with the capture and it plays perfectly on a range of hardware and software players. Media Player Classic HC with LAV filters plays it fine and I thought that's what Handbrake used for decoding? Thanks for any assistance.
Deleted User 13735

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by Deleted User 13735 »

That's because your Satellite / OTA recordings are Transport Streams; playable, but fraught with errors for decoding.
Running through VideoRedo (Quickstream Fix) or TSDoctor should prepare them for Handbrake with few, if any dropped frames.
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by spooky »

Thanks but as I already said, these captures are completely error free plus they've already been run through VideoReDo (which didn't have to add/remove any audio/video frames because the cap is clean). If you'd downloaded the sample, played it then run it through Handbrake, you'd see that and how obviously this is a problem specific to whatever decoder handbrake is using.

I've been working with this type of material for a very long time and am fully aware of the possibility of signal related discontinuities/errors and how they affect various post-processing tasks like re-encoding. As I also already said, these files play back perfectly on any hardware or software player and will re-encode without error in all sorts of other encoding apps.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by s55 »

You might want to avoid using QuickSync when working with TS, as it's decoder is far more sensitive to glicthyness (not necessarily errors) in the file. Even files that appear valid are able to trip it up.

I ran your sample via the libav path and it doesn't throw errors.

I do however get decode issues in VLC. Two points in the file it glitches out for a few frames. Doesn't seem to tie up with the quicksync results though :S
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by spooky »

So Handbrake is using QuickSync for decoding as well as encoding? Part of the mystery to me was what exactly handbrake is using to decode. I figured it was something else because if I use DVDFab and set it to use QuickSync for decode and encode, the results are perfectly fine. I wanted to switch to handbrake instead though because it gives more control over the encode settings.

When you say 'ran it via the libav path', is that a setting I can change in Handbrake? I still want to encode with QuickSync of course.

I had to trim that 30s sample and the cut points may cause a brief decoding issue in VLC but I can assure you the stream is 100% error free. The odd glitch either side of edit points I can understand but the decoder HB is using (or the manner in which HB is invoking QSV) is making a complete pigs ear of it. The rainbowing and breakup is practically constant. If you haven't already, run the sample through HB yourself and you'll see what I mean.
Deleted User 13735

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by Deleted User 13735 »

No, you didn't say you've already run it through VRD.
If you had, I wouldn't have suggested it, or the likelihood of index / GOP errors in your Transport Stream.
Also, if you are as experienced as you say, you would know that "plays perfectly" means nothing wrt allowable TS stream errors that will hose a full-inflate decode.
But you're already in more capable hands than mine. Best of luck.
[EDIT] Your downloaded sample encodes in Handbrake and plays perfectly on my machine (no QS).
Last edited by Deleted User 13735 on Mon Aug 05, 2013 9:51 pm, edited 2 times in total.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by s55 »

When you say 'ran it via the libav path', is that a setting I can change in Handbrake? I still want to encode with QuickSync of course.
You can't. It's one or the other. If you encode via x264, it gets decoded via libav.
I had to trim that 30s sample and the cut points may cause a brief decoding issue in VLC but I can assure you the stream is 100% error free. The odd glitch either side of edit points I can understand but the decoder HB is using (or the manner in which HB is invoking QSV) is making a complete pigs ear of it. The rainbowing and breakup is practically constant. If you haven't already, run the sample through HB yourself and you'll see what I mean.
I just ran it though QSV. Same errors but none of the rainbowing or breakup you describe. Plays the same as the original file as far as I can see. I don't know what else to suggest to you.

I can pass the sample along to someone at Intel see what they say. May take some time though.
maxim_d33
Bright Spark User
Posts: 175
Joined: Mon Mar 21, 2011 12:02 pm

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by maxim_d33 »

thanks for report and sample sharing,

brief looks shows that this sample stream is not "error free"
h264 @ 01D20600] mmco: unref short failure
22:48:19] muxmp4: track 0, chunk duration 14400
h264 @ 01D20600] reference picture missing during reorder
h264 @ 01D20600] Missing reference picture
h264 @ 01D20600] reference picture missing during reorder
h264 @ 01D20600] Missing reference picture
22:48:19] h264: "Chapter 1" (1) at frame 0 time 0
h264 @ 01D20600] reference picture missing during reorder
h264 @ 01D20600] Missing reference picture
h264 @ 01D20600] reference picture missing during reorder
h264 @ 01D20600] Missing reference picture
h264 @ 01D20600] reference picture missing during reorder
h264 @ 01D20600] Missing reference picture
h264 @ 01D20600] reference picture missing during reorder
h264 @ 01D20600] Missing reference picture
h264 @ 01D2BC60] mmco: unref short failure
and these are decode related errors,

it needs to be investigated yet in more details
to see if some good solution/workaround possible,
if at all.
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by spooky »

s55 wrote:You can't. It's one or the other. If you encode via x264, it gets decoded via libav.
Ah OK, I was hoping it might be possible to select the decoder and encoder independently a la DVDFab - that lets you have QuickSync for encoding and DXVA/CoreAVC/QuickSync as the decoder.
s55 wrote:I just ran it though QSV. Same errors but none of the rainbowing or breakup you describe. Plays the same as the original file as far as I can see. I don't know what else to suggest to you.
Hm, this is puzzling. I have to assume then that different variants of the Intel CPUs or maybe different revisions of the drivers produce different results when decoding then because the corruption is horrendous at my end on the output. This isn't some weird filters issue on my machine either, here's a photo of HB's QSV output playing on a Popcorn Hour A-400 (Sigma SOC hardware player):

Image

That big pink mess at the bottom is on and off every few seconds as is the big white bar at the top. This is exactly the same as I'm seeing in Media Player Classic but when you said your output looked OK, you made me doubt myself for second hence testing on a hardware player to make sure.
s55 wrote:I can pass the sample along to someone at Intel see what they say. May take some time though.
That would be awesome although I don't think the sample is big enough to be of much use, do you have an FTP I could upload a full episode to? For example, whatever the decoding snafu is, it gradually causes the audio to go out of sync, I guess because of the amount of frames being dropped. By about half way through the full episode, the audio is about 13s out of sync, the sample doesn't have much audio to check sync with.
maxim_d33 wrote:brief looks shows that this sample stream is not "error free"
I'll keep repeating this - the capture is clean. European H264 satellite broadcasts are definitely unusual and in the early days lots of tools and players struggled with them but the stream you're looking at is a faithful reproduction of what's pumped to every UK satellite viewer's STB which goes on to decode it quite nicely with no errors or loss of frames. Instead of checking it with the very tool that's butchering it, try checking it with any H264 diagnostic tool you please - VideoRedo, TSDoctor, TSPE will all tell you the transport stream is 100% OK. I can re-encode any of my recordings with an avisynth script and any software decoder of my choosing and the encode will come out flawlessly. I've often used ffmpeg/yadif to serve them up to x264 and again, not a peep from ffmpeg about any error in the stream and the output looks lovely.

The only reason I'm persevering with this is that the sheer speed of QuickSync encodes makes them incredibly handy. Handbrake seems to be about the only tool that allows a decent amount of customisation to the encode settings (ref frames, AVC Profile/Level etc). What continues to puzzle me is that DVDFab's implementation of QuickSync, which it uses for encoding and decoding, deals with these files fine too. Same CPU, same Intel drivers and yet HB butchers them which still leads me to believe that this is something to do with the way HB addresses QuickSync. But then someone else has said their output with HB looks OK - I can't resolve that in my head. :?
maxim_d33
Bright Spark User
Posts: 175
Joined: Mon Mar 21, 2011 12:02 pm

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by maxim_d33 »

beside stated above - there are pts/dts corner case(s) in this stream,
practically, within transcode, output values needs to be extrapolated...

this issue is in TODO list.
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by spooky »

So there is a fixable issue here? I don't really understand your post.

Here's some extra info which may help or simply further confuse matters - if I remux the TS to MKV using MKVMerge and enable splitting to cut off the first 10s, Handbrake will re-encode with QSV without reporting any decoding errors. The output still looks horrible:

Image

and indeed the behaviour of the pink blobs and white lines looks identical to the attempt with the original TS so it hasn't really solved anything.

Here's the encode log from the chopped MKV attempt, it's no longer full of errors:

Code: Select all

HandBrake svn5671 (Nightly Build) - 64bit Version
OS: Microsoft Windows NT 6.2.9200.0
CPU: Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
Ram: 15313 MB, Screen: 1280x1024
Temp Dir: C:\Users\spooky\AppData\Local\Temp\
Install Dir: C:\Program Files\Video\Handbrake
Data Dir: C:\Users\spooky\AppData\Roaming\HandBrake\HandBrake\0.0.0.5671

-------------------------------------------
CLI Query:  -i "C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv" -t 1 --angle 1 -c 1 -o "C:\Users\spooky\Desktop\Luther S03e01.10s Chopped-1.mkv"  -f mkv  -w 1280 --loose-anamorphic  --modulus 16 -e qsv_h264 -b 8000 --cfr -a 1 -E copy -6 auto -R Auto -B 0 -D 0 --gain 0 --audio-fallback ac3 -x target-usage=2 --verbose=2
User Query: False

[15:49:09] Intel Quick Sync Video support: yes
[15:49:09]  - 3rd gen. Intel Core processor
[15:49:09]  - hardware name:    Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
[15:49:09]  - hardware version: 1.6 (minimum: 1.3)
[15:49:09] hb_init: starting libhb thread
[15:49:09] thread 3b650d0 started ("libhb")
HandBrake svn5671 (2013072701) - MinGW x86_64 - http://handbrake.fr
8 CPUs detected
Opening C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv...
[15:49:09] hb_scan: path=C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv, title_index=1
[15:49:09] thread 3b65270 started ("scan")
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:1725: nav_get_title_list(C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv) failed (0000000003b65df0)
[15:49:09] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[15:49:09] dvd: not a dvd - trying as a stream/file instead
[h264 @ 0000000003b79060] mmco: unref short failure
Input #0, matroska,webm, from 'C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv':
  Duration: 00:57:21.40, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 50 fps, 50 tbr, 1k tbn, 50 tbc (default)
    Stream #0.1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
[15:49:09] Found ffmpeg 0 chapters, container=matroska,webm
[15:49:09] scan: decoding previews for title 1
[15:49:09] scan: preview 1
[h264 @ 00000000052d70e0] mmco: unref short failure
[15:49:09] fifo_close: trashing 0 buffer(s)
[15:49:09] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch)
[15:49:09] scan: preview 2
[h264 @ 00000000052d70e0] mmco: unref short failure
[h264 @ 00000000052d70e0] mmco: unref short failure
[15:49:09] scan: preview 3
[15:49:09] scan: preview 4
[h264 @ 00000000052d70e0] mmco: unref short failure
[h264 @ 00000000052d70e0] mmco: unref short failure
[15:49:09] scan: preview 5
[15:49:09] scan: preview 6
[15:49:09] scan: preview 7
Scanning title 1 of 1, preview 7, 70.00 %[15:49:09] scan: preview 8
[15:49:09] scan: preview 9
[h264 @ 00000000052d70e0] mmco: unref short failure
[h264 @ 00000000052d70e0] mmco: unref short failure
[15:49:09] scan: preview 10
[15:49:09] scan: 10 previews, 1920x1080, 50.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[15:49:09] thread 3b65270 exited ("scan")
[15:49:09] thread 3b65270 joined ("scan")
[15:49:09] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv
  + duration: 00:57:21
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 50.000 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:57:21
  + audio tracks:
    + 1, English (AC3) (2.0 ch) (iso639-2: eng), 48000Hz, 192000bps
  + subtitle tracks:
[15:49:09] thread 3b65270 started ("work")
[15:49:09] 1 job(s) to process
[15:49:09] starting job
[15:49:09] Auto Passthru: allowed codecs are AAC, AC3, DTS, DTS-HD, MP3
[15:49:09] Auto Passthru: fallback is AC3
[15:49:09] Auto Passthru: using AC3 Passthru for track 1
[15:49:09] sync: expecting 172070 video frames
[15:49:09] job configuration:
[15:49:09]  * source
[15:49:09]    + C:\Users\spooky\Desktop\Luther S03E01.10s chopped.mkv
[15:49:09]    + title 1, chapter(s) 1 to 1
[15:49:09]    + container: matroska,webm
[15:49:09]  * destination
[15:49:09]    + C:\Users\spooky\Desktop\Luther S03e01.10s Chopped-1.mkv
[15:49:09]    + container: Matroska (libmkv)
[15:49:09]  * video track
[15:49:09]    + decoder: h264
[15:49:09]    + filter
[15:49:09]      + Quick Sync Video VPP (1280:720:0:0:0:0_dei:0)
[15:49:09]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1280 * 720
[15:49:09]    + loose anamorphic
[15:49:09]      + storage dimensions: 1280 * 720, mod 16
[15:49:09]      + pixel aspect ratio: 1 / 1
[15:49:09]      + display dimensions: 1280 * 720
[15:49:09]    + encoder: H.264 (Intel QSV)
[15:49:09]      + options: target-usage=2
[15:49:09]      + bitrate: 8000 kbps, pass: 0
[15:49:09]  * audio track 1
[15:49:09]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x1)
[15:49:09]      + bitrate: 192 kbps, samplerate: 48000 Hz
[15:49:09]    + AC3 Passthru
[h264 @ 0000000004a7e8e0] mmco: unref short failure
[15:49:09] thread 3b6f3a0 started ("Reader")
[15:49:09] thread 4449700 started ("Quick Sync Video VPP")
[15:49:09] thread 52d7420 started ("AudioSynchronization")
[15:49:09] Seeking to chapter 1: starts 0, ends 309726000, AV pos 0
[15:49:09] reader: first SCR 0 id 0x0 DTS 0
[15:49:09] thread 4279fb0 started ("Video decoder (libavcodec)")
[15:49:09] thread 427a330 started ("H.264/AVC encoder (Intel QSV)")
[15:49:09] thread 56beaf0 started ("AC3 decoder")
[15:49:09] thread 56bec90 started ("Video Synchronization")
[15:49:09] thread 4449400 started ("Muxer")
[15:49:09] qsv: Intel QSV/MediaSDK uses hardware implementation
[15:49:09] qsv: RateControlMethod:MFX_RATECONTROL_VBR TargetKbps:8000
[15:49:09] qsv: TargetUsage:2 AsyncDepth:4
[15:49:09] qsv: GopRefDist:4 GopPicSize:251 NumRefFrame:0
[15:54:31] reader: done. 1 scr changes
[15:54:31] thread 3b6f3a0 exited ("Reader")
[15:54:31] work: average encoding speed for job is 267.528900 fps
[15:54:31] thread 56beaf0 exited ("AC3 decoder")
[15:54:31] thread 4279fb0 exited ("Video decoder (libavcodec)")
[15:54:31] thread 4449400 exited ("Muxer")
[15:54:31] thread 52d7420 exited ("AudioSynchronization")
[15:54:31] thread 56bec90 exited ("Video Synchronization")
[15:54:31] thread 56bec90 joined ("Video Synchronization")
[15:54:31] sync: got 86020 frames, 172070 expected
[15:54:31] thread 4449700 exited ("Quick Sync Video VPP")
[15:54:31] thread 4449700 joined ("Quick Sync Video VPP")
[15:54:31] qsv_filter[Default] done: max_surfaces: 10/32 , max_syncs: 8/32
[15:54:31] thread 52d7420 joined ("AudioSynchronization")
[15:54:31] thread 4279fb0 joined ("Video decoder (libavcodec)")
[15:54:31] h264_qsv-decoder done: 86020 frames, 0 decoder errors, 0 drops
[15:54:31] thread 427a330 exited ("H.264/AVC encoder (Intel QSV)")
[15:54:31] thread 427a330 joined ("H.264/AVC encoder (Intel QSV)")
[15:54:31] enc_qsv done: frames: 86020 in, 86020 out
[15:54:31] thread 56beaf0 joined ("AC3 decoder")
[15:54:31] thread 4449400 joined ("Muxer")
[15:54:31] Writing Metadata to output file...
[15:54:31] mux: file size, 1581285393 bytes
[15:54:31] mux: track 0, 86020 frames, 1496375847 bytes, 3478.57 kbps, fifo 1024
[15:54:31] mux: video bitrate error, -1944984153 bytes
[15:54:31] mux: track 1, 107543 frames, 82593024 bytes, 192.00 kbps, fifo 1024
[15:54:31] mux: overhead, 11.97 bytes per frame
[15:54:31] thread 3b6f3a0 joined ("Reader")
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] fifo_close: trashing 0 buffer(s)
[15:54:31] Freed 32 buffers of size 1024
[15:54:31] Freed 32 buffers of size 2048
[15:54:31] Freed 32 buffers of size 4096
[15:54:31] Freed 32 buffers of size 8192
[15:54:31] Freed 32 buffers of size 16384
[15:54:31] Freed 32 buffers of size 32768
[15:54:31] Freed 32 buffers of size 65536
[15:54:31] Freed 16 buffers of size 131072
[15:54:31] Freed 3 buffers of size 262144
[15:54:31] Freed 1 buffers of size 524288
[15:54:31] Freed 6 buffers of size 2097152
[15:54:31] Freed 25 buffers of size 4194304
[15:54:31] Allocated 125009920 bytes of buffers on this pass and Freed 125009920 bytes, 0 bytes leaked
[15:54:31] thread 3b65270 exited ("work")
[15:54:31] thread 3b65270 joined ("work")
[15:54:31] libhb: work result = 0
Encode done!
[15:54:31] thread 3b650d0 exited ("libhb")
[15:54:31] thread 3b650d0 joined ("libhb")
HandBrake has exited.
It's as if a few errors right in the first few frames send the decoder into a death spiral. Errors at cut or edit points of broadcast H264 are common due to the fact it's sometimes impossible to detect safe cut points but at worst, this should cause pixilation until an IDR or reference frame is hit. This test sort of suggests that errors in the log do not relate to the garbled output because in the above example, the log is clean but the output is still fubar. :?
maxim_d33
Bright Spark User
Posts: 175
Joined: Mon Mar 21, 2011 12:02 pm

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by maxim_d33 »

your issue is on TODO list - would it help?

can you share your driver used?
is this a recommended one?
see Release notes at https://trac.handbrake.fr/milestone/QuickSync%20Beta

also, about "pink blobs and white lines", how can I reproduce situation on my side?
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by spooky »

I'm using the recommended 3071 version of the Intel drivers. I also tried the much newer 3234 but that was no different.

Your question about how to reproduce made me think though - I tried not changing any settings at all for the output and now it looks OK. The pink blobs and white lines only show up if I set the output to resize to 1280x720. Does that help?
maxim_d33
Bright Spark User
Posts: 175
Joined: Mon Mar 21, 2011 12:02 pm

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by maxim_d33 »

yes, thanks

let me investigate it now...
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by spooky »

Thank you. I've been doing some more testing and it seems there are 2 separate issues. One is the obvious video corruption (pink blobs/white lines) when resizing to 720p and the other is more general decoding issue where frames are dropped throughout the decoding process.

Even if I chop the first few seconds away from the source and don't resize, the output still gets massive audio sync drift. I believe that the decoder is still dropping frames even when I trick it into producing a clean log by removing the first few seconds. Also, for some reason the output when using a trimmed input is a blockfest - looks like it was encoded at 512kbps rather than the 8000kbps actually used.

I really think that a full capture would benefit you in reproducing these problems - do you have an FTP where I could upload the full episode? It's 2.25gb is size.
maxim_d33
Bright Spark User
Posts: 175
Joined: Mon Mar 21, 2011 12:02 pm

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by maxim_d33 »

you are correct,
you actually found two issues:
- video corruption (pink blobs/white lines) when resizing to 720p
should be already fixed in svn, will be part of next binary drop
- decoding issue where frames are dropped throughout the decoding process.
We will discuss fix next week and it should be fine as well

thanks for your report(s)!
spooky
Posts: 9
Joined: Thu Jun 27, 2013 11:40 am

Re: Severe decoding failure with 1080i50 H264 from UK satell

Post by spooky »

That's fantastic news maxim_d33! Can't wait for a new binary so I can finally re-encode my captures with QuickSync :D
Post Reply