Problems with Transport Stream

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
Vietwoojagig
Posts: 49
Joined: Thu Dec 17, 2009 8:38 am

Problems with Transport Stream

Post by Vietwoojagig »

Hi,

since some weeks, I have problems with Transport Streams that I have recorded with my Kathrein SAT receiver.
It is not only linked to one program, so it had happened for at least two different german HD programs.
I tried Handbrake version 0.9.9 and the latest highly builds (not in the logs below).

I trimmed the transport stream to a 15s clip using Avidemux. The problem is the same as of the original file.
The original file is 720p/50. No matter what framerate I select, the encoded file will be around only 11-12 frames per second.
If I use Avidemux to export an MKV version of the problematic sample, Handbrake encodes everything fine, keeping the sample rate.

Here are the two sample files:
https://www.dropbox.com/s/9hwu9i3ayzxc1 ... -ts-15s.ts
https://www.dropbox.com/s/khc3w2nvgqckm ... kv-15s.mkv
As you can see, even dropbox is able to encode the files, keeping the sample rate correctly.

Here are the logs:

Encoding of Sample-ts-15s.ts with settings "Normal (default)

Code: Select all

[11:12:43] macgui: Handbrake Version: 6201svn x86_64 (2014052201)
[11:12:43] hb_init: starting libhb thread
[11:12:43] hb_init: starting libhb thread
[11:12:43] macgui: hbInstances path to this instance: /Users/******/Applications/HandBrake.app
[11:12:43] macgui: hbInstance found instance pidnum: 70911 at path: /Users/******/Applications/HandBrake.app
[11:12:43] macgui: hbInstance MATCH FOUND, our pidnum is: 70911
[11:12:43] macgui: Pid for this instance: 70911
[11:12:43] macgui: HBQueueController : My Pidnum is 70911
[11:12:44] macgui: Queue reloaded
[11:12:53] macgui: trying to open video_ts folder (parent directory chosen)
[11:12:53] macgui: scanning titles with a duration of 10 seconds or more
[11:12:53] CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
[11:12:53]  - Intel microarchitecture Haswell
[11:12:53]  - logical processor count: 4
[11:12:53] OpenCL device #1: Intel HD Graphics 5000
[11:12:53]  - OpenCL version: 1.2 
[11:12:53]  - driver version: 1.2(May  5 2014 20:39:23)
[11:12:53]  - device type:    GPU
[11:12:53]  - supported:      YES
[11:12:53] hb_scan: path=/Users/******/Dropbox/Videos/Sample-ts-15s.ts, title_index=0
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-ts-15s.ts/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-ts-15s.ts/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(/Users/******/Dropbox/Videos/Sample-ts-15s.ts) failed
[11:12:53] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.0
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:12:53] dvd: not a dvd - trying as a stream/file instead
[11:12:53] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[11:12:53] Found the following PIDS
[11:12:53]     Video PIDS : 
[11:12:53]       0x100 type H.264 (0x1b) (PCR)
[11:12:53]     Audio PIDS : 
[11:12:53]       0x101 type MPEG1 (0x3)
[11:12:53]       0x102 type MPEG1 (0x3)
[11:12:53]       0x103 type AC3 (0x81)
[11:12:53]       0x104 type MPEG1 (0x3)
[11:12:53]     Subtitle PIDS : 
[11:12:53]     Other PIDS : 
[11:12:53] stream id 0x101 (type 0x3 substream 0x0) audio 0x101
[11:12:53] stream id 0x102 (type 0x3 substream 0x0) audio 0x102
[11:12:53] stream id 0x103 (type 0x81 substream 0x0) audio 0x103
[11:12:53] stream id 0x104 (type 0x3 substream 0x0) audio 0x104
[11:12:53] scan: decoding previews for title 1
[11:12:53] scan: audio 0x101: mp2, rate=48000Hz, bitrate=200000 Deutsch (MPEG) (2.0 ch)
[11:12:53] scan: audio 0x102: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG) (2.0 ch)
[11:12:53] scan: audio 0x103: ac3, rate=48000Hz, bitrate=448000 Deutsch (AC3) (2.0 ch)
[11:12:53] scan: audio 0x104: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG) (2.0 ch)
[11:12:54] scan: 30 previews, 1280x720, 50.000 fps, autocrop = 88/86/0/0, aspect 16:9, PAR 1:1
[11:12:54] stream: 15 good frames, 0 errors (0%)
[11:12:54] libhb: scan thread found 1 valid title(s)
[11:12:55] macgui: showNewScan: This is a new source item scan
[11:13:07] macgui: Rip: Pending queue count is 0
[11:13:07] macgui: getNextPendingQueueIndex next pending encode index is:0
[11:13:07] macgui: scanning specifically for title: 1
[11:13:07] CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
[11:13:07]  - Intel microarchitecture Haswell
[11:13:07]  - logical processor count: 4
[11:13:07] OpenCL device #1: Intel HD Graphics 5000
[11:13:07]  - OpenCL version: 1.2 
[11:13:07]  - driver version: 1.2(May  5 2014 20:39:23)
[11:13:07]  - device type:    GPU
[11:13:07]  - supported:      YES
[11:13:07] hb_scan: path=/Users/******/Dropbox/Videos/Sample-ts-15s.ts, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-ts-15s.ts/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-ts-15s.ts/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(/Users/******/Dropbox/Videos/Sample-ts-15s.ts) failed
[11:13:07] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.0
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:07] dvd: not a dvd - trying as a stream/file instead
[11:13:07] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[11:13:07] Found the following PIDS
[11:13:07]     Video PIDS : 
[11:13:07]       0x100 type H.264 (0x1b) (PCR)
[11:13:07]     Audio PIDS : 
[11:13:07]       0x101 type MPEG1 (0x3)
[11:13:07]       0x102 type MPEG1 (0x3)
[11:13:07]       0x103 type AC3 (0x81)
[11:13:07]       0x104 type MPEG1 (0x3)
[11:13:07]     Subtitle PIDS : 
[11:13:07]     Other PIDS : 
[11:13:07] stream id 0x101 (type 0x3 substream 0x0) audio 0x101
[11:13:07] stream id 0x102 (type 0x3 substream 0x0) audio 0x102
[11:13:07] stream id 0x103 (type 0x81 substream 0x0) audio 0x103
[11:13:07] stream id 0x104 (type 0x3 substream 0x0) audio 0x104
[11:13:07] scan: decoding previews for title 1
[11:13:07] scan: audio 0x101: mp2, rate=48000Hz, bitrate=200000 Deutsch (MPEG) (2.0 ch)
[11:13:07] scan: audio 0x102: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG) (2.0 ch)
[11:13:07] scan: audio 0x103: ac3, rate=48000Hz, bitrate=448000 Deutsch (AC3) (2.0 ch)
[11:13:07] scan: audio 0x104: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG) (2.0 ch)
[11:13:07] scan: 10 previews, 1280x720, 50.000 fps, autocrop = 88/86/0/0, aspect 16:9, PAR 1:1
[11:13:07] stream: 5 good frames, 0 errors (0%)
[11:13:07] libhb: scan thread found 1 valid title(s)
[11:13:09] macgui: ScanDone state received from fQueueEncodeLibhb
[11:13:09] macgui: Preset: Normal (Default)
[11:13:09] macgui: processNewQueueEncode number of passes expected is: 1
[11:13:09] macgui: Start / Stop set to chapters
[11:13:09] macgui: prepareJob exiting
[11:13:09] 1 job(s) to process
[11:13:09] starting job
[11:13:09] sync: expecting 747 video frames
[11:13:09] job configuration:
[11:13:09]  * source
[11:13:09]    + /Users/******/Dropbox/Videos/Sample-ts-15s.ts
[11:13:09]    + title 1, chapter(s) 1 to 1
[11:13:09]  * destination
[11:13:09]    + /Users/******/Desktop/Sample-ts-15s.m4v
[11:13:09]    + container: MPEG-4 (libavformat)
[11:13:09]  * video track
[11:13:09]    + decoder: h264
[11:13:09]      + bitrate 200 kbps
[11:13:09]    + filters
[11:13:09]      + Framerate Shaper (0:27000000:540000)
[11:13:09]        + frame rate: same as source (around 50.000 fps)
[11:13:09]      + Crop and Scale (1280:546:88:86:0:0)
[11:13:09]        + source: 1280 * 720, crop (88/86/0/0): 1280 * 546, scale: 1280 * 546
[11:13:09]    + loose anamorphic
[11:13:09]      + storage dimensions: 1280 * 546, mod 2
[11:13:09]      + pixel aspect ratio: 1 / 1
[11:13:09]      + display dimensions: 1280 * 546
[11:13:09]    + encoder: H.264 (libx264)
[11:13:09]      + preset:  veryfast
[11:13:09]      + profile: main
[11:13:09]      + level:   4.0
[11:13:09]      + quality: 20.00 (RF)
[11:13:09]  * audio track 1
[11:13:09]    + decoder: Deutsch (MPEG) (2.0 ch) (track 1, id 0x101)
[11:13:09]      + bitrate: 200 kbps, samplerate: 48000 Hz
[11:13:09]    + mixdown: Stereo
[11:13:09]    + encoder: AAC (Apple AudioToolbox)
[11:13:09]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:13:09] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[11:13:09] encx264: min-keyint: 50, keyint: 500
[11:13:09] encx264: encoding at constant RF 20.000000
[11:13:09] encx264: unparsed options: level=4.0:ref=1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10
[11:13:09] reader: first SCR 180 id 0x101 DTS 669
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x264 [info]: profile Main, level 4.0
[11:13:09] h264: "Chapter 1" (1) at frame 0 time 76417
[11:13:09] sync: first pts is 76417
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 83877, next 91077, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 91077, next 105477, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 105477, next 109077, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 112677, next 119877, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 119877, next 134277, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 134277, next 137877, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 141477, next 148677, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 148677, next 163077, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 163077, next 166677, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 170277, next 177477, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 177477, next 191877, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 191877, next 195477, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 199077, next 206277, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 206277, next 220677, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 220677, next 224277, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 227877, next 235077, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 235077, next 249477, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 249477, next 253077, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 256677, next 263877, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 263877, next 278277, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 278277, next 281877, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 285477, next 292677, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 292677, next 307077, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 307077, next 310677, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 314277, next 321477, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 321477, next 335877, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 335877, next 339477, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 343077, next 350277, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 350277, next 364677, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 364677, next 368277, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 371877, next 379077, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 379077, next 393477, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 393477, next 397077, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 400677, next 407877, dur 7200)
[11:13:09] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 407877, next 422277, dur 14400)
[11:13:09] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 422277, next 425877, dur 3600)
[11:13:09] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 429477, next 436677, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 436677, next 451077, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 451077, next 454677, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 458277, next 465477, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 465477, next 479877, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 479877, next 483477, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 487077, next 494277, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 494277, next 508677, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 508677, next 512277, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 515877, next 523077, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 523077, next 537477, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 537477, next 541077, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 544677, next 551877, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 551877, next 566277, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 566277, next 569877, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 573477, next 580677, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 580677, next 595077, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 595077, next 598677, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 602277, next 609477, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 609477, next 623877, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 623877, next 627477, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 631077, next 638277, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 638277, next 652677, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 652677, next 656277, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 659877, next 667077, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 667077, next 681477, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 681477, next 685077, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 688677, next 695877, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 695877, next 710277, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 710277, next 713877, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 717477, next 724677, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 724677, next 739077, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 739077, next 742677, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 746277, next 753477, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 753477, next 767877, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 767877, next 771477, dur 3600)
[11:13:10] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 775077, next 782277, dur 7200)
[11:13:10] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 782277, next 796677, dur 14400)
[11:13:10] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 796677, next 800277, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 803877, next 811077, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 811077, next 825477, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 825477, next 829077, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 832677, next 839877, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 839877, next 854277, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 854277, next 857877, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 861477, next 868677, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 868677, next 883077, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 883077, next 886677, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 890277, next 897477, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 897477, next 911877, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 911877, next 915477, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 919077, next 926277, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 926277, next 940677, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 940677, next 944277, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 947877, next 955077, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 955077, next 969477, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 969477, next 973077, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 976677, next 983877, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 983877, next 998277, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 998277, next 1001877, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1005477, next 1012677, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1012677, next 1027077, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1027077, next 1030677, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1034277, next 1041477, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1041477, next 1055877, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1055877, next 1059477, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1063077, next 1070277, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1070277, next 1084677, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1084677, next 1088277, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1091877, next 1099077, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1099077, next 1113477, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1113477, next 1117077, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1120677, next 1127877, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1127877, next 1142277, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1142277, next 1145877, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1149477, next 1156677, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1156677, next 1171077, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1171077, next 1174677, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1178277, next 1185477, dur 7200)
[11:13:11] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1185477, next 1199877, dur 14400)
[11:13:11] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1199877, next 1203477, dur 3600)
[11:13:11] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1207077, next 1214277, dur 7200)
[11:13:12] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1214277, next 1228677, dur 14400)
[11:13:12] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1228677, next 1232277, dur 3600)
[11:13:12] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1235877, next 1243077, dur 7200)
[11:13:12] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1243077, next 1257477, dur 14400)
[11:13:12] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1257477, next 1261077, dur 3600)
[11:13:12] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1264677, next 1271877, dur 7200)
[11:13:12] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1271877, next 1286277, dur 14400)
[11:13:12] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1286277, next 1289877, dur 3600)
[11:13:12] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1293477, next 1300677, dur 7200)
[11:13:12] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1300677, next 1315077, dur 14400)
[11:13:12] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1315077, next 1318677, dur 3600)
[11:13:12] hb_ts_stream_decode - eof
[11:13:12] reader: done. 2 scr changes
[11:13:12] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1322277, next 1329477, dur 7200)
[11:13:12] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1329477, next 1343877, dur 14400)
[11:13:12] sync: video time didn't advance - dropped 8 frames (delta 120 ms, current 1343877, next 1347477, dur 3600)
[11:13:12] sync: video time didn't advance - dropped 1 frames (delta 60 ms, current 1351077, next 1358277, dur 7200)
[11:13:12] sync: video time didn't advance - dropped 3 frames (delta 40 ms, current 1358277, next 1372677, dur 14400)
[h264 @ 0x10382a200] missing picture in access unit
[11:13:12] work: average encoding speed for job is 0.000000 fps
[11:13:12] sync: got 181 frames, 747 expected
[11:13:12] render: lost time: 0 (0 frames)
[11:13:12] render: gained time: 0 (0 frames) (0 not accounted for)
[11:13:12] h264-decoder done: 721 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:3     Avg QP:14.71  size: 81294
x264 [info]: frame P:84    Avg QP:19.24  size: 19628
x264 [info]: frame B:94    Avg QP:22.16  size:  2469
x264 [info]: consecutive B-frames: 22.7% 12.2% 36.5% 28.7%
x264 [info]: mb I  I16..4:  9.6%  0.0% 90.4%
x264 [info]: mb P  I16..4:  5.1%  0.0%  2.6%  P16..4: 35.8% 21.9% 15.6%  0.0%  0.0%    skip:19.0%
x264 [info]: mb B  I16..4:  0.6%  0.0%  0.1%  B16..8: 15.9%  5.1%  0.6%  direct: 5.4%  skip:72.3%  L0:59.0% L1:23.8% BI:17.2%
x264 [info]: coded y,uvDC,uvAC intra: 61.1% 72.1% 30.6% inter: 16.7% 19.1% 0.4%
x264 [info]: i16 v,h,dc,p: 63% 20% 12%  5%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 41% 16% 11%  4%  6%  8%  4%  6%  4%
x264 [info]: i8c dc,h,v,p: 44% 14% 36%  6%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: kb/s:1102.90
[11:13:12] mp2-decoder done: 0 frames, 0 decoder errors, 0 drops
[11:13:12] mux: track 0, 181 frames, 2124605 bytes, 1113.82 kbps, fifo 256
[11:13:12] mux: track 1, 713 frames, 314254 bytes, 164.75 kbps, fifo 1024
[11:13:12] stream: 736 good frames, 0 errors (0%)
[11:13:12] libhb: work result = 0
[11:13:13] macgui: incrementQueueItemDone there are no more pending encodes
[11:13:15] macgui: Queue reloaded
[11:13:15] macgui: Queue reloaded
[11:13:15] macgui: Queue reloaded
Encoding of Sample-mkv-15s.mkv with settings "Normal (default)

Code: Select all

[11:35:07] macgui: Handbrake Version: 6201svn x86_64 (2014052201)
[11:35:07] hb_init: starting libhb thread
[11:35:07] hb_init: starting libhb thread
[11:35:07] macgui: hbInstances path to this instance: /Users/******/Applications/HandBrake.app
[11:35:07] macgui: hbInstance found instance pidnum: 71688 at path: /Users/******/Applications/HandBrake.app
[11:35:07] macgui: hbInstance MATCH FOUND, our pidnum is: 71688
[11:35:07] macgui: Pid for this instance: 71688
[11:35:07] macgui: HBQueueController : My Pidnum is 71688
[11:35:08] macgui: Queue reloaded
[11:35:11] macgui: trying to open video_ts folder (parent directory chosen)
[11:35:11] macgui: scanning titles with a duration of 10 seconds or more
[11:35:11] CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
[11:35:11]  - Intel microarchitecture Haswell
[11:35:11]  - logical processor count: 4
[11:35:11] OpenCL device #1: Intel HD Graphics 5000
[11:35:11]  - OpenCL version: 1.2 
[11:35:11]  - driver version: 1.2(May  5 2014 20:39:23)
[11:35:11]  - device type:    GPU
[11:35:11]  - supported:      YES
[11:35:11] hb_scan: path=/Users/******/Dropbox/Videos/Sample-mkv-15s.mkv, title_index=0
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-mkv-15s.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-mkv-15s.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(/Users/******/Dropbox/Videos/Sample-mkv-15s.mkv) failed
[11:35:11] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.0
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:35:11] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/Users/******/Dropbox/Videos/Sample-mkv-15s.mkv':
  Metadata:
    ENCODER         : Lavf54.63.104
  Duration: 00:00:15.27, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264 (Main), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 fps, 1k tbn, 100 tbc (default)
    Stream #0.1(deu): Audio: mp2, 48000 Hz, 2 channels, s16p, 256 kb/s (default)
    Stream #0.2(mis): Audio: mp2, 48000 Hz, 2 channels, s16p, 192 kb/s (default)
    Stream #0.3(deu): Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s (default)
    Stream #0.4(mul): Audio: mp2, 48000 Hz, 2 channels, s16p, 192 kb/s (default)
[11:35:11] scan: decoding previews for title 1
[11:35:11] scan: audio 0x1: mp2, rate=48000Hz, bitrate=256000 Deutsch (MPEG) (2.0 ch)
[11:35:11] scan: audio 0x2: mp2, rate=48000Hz, bitrate=192000 Unknown (MPEG) (2.0 ch)
[11:35:11] scan: audio 0x3: ac3, rate=48000Hz, bitrate=448000 Deutsch (AC3) (2.0 ch)
[11:35:11] scan: audio 0x4: mp2, rate=48000Hz, bitrate=192000 Unknown (MPEG) (2.0 ch)
[11:35:14] scan: 30 previews, 1280x720, 50.000 fps, autocrop = 88/86/0/0, aspect 16:9, PAR 1:1
[11:35:14] libhb: scan thread found 1 valid title(s)
[11:35:14] macgui: showNewScan: This is a new source item scan
[11:35:19] macgui: Rip: Pending queue count is 0
[11:35:19] macgui: getNextPendingQueueIndex next pending encode index is:0
[11:35:19] macgui: scanning specifically for title: 1
[11:35:19] CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
[11:35:19]  - Intel microarchitecture Haswell
[11:35:19]  - logical processor count: 4
[11:35:19] OpenCL device #1: Intel HD Graphics 5000
[11:35:19]  - OpenCL version: 1.2 
[11:35:19]  - driver version: 1.2(May  5 2014 20:39:23)
[11:35:19]  - device type:    GPU
[11:35:19]  - supported:      YES
[11:35:19] hb_scan: path=/Users/******/Dropbox/Videos/Sample-mkv-15s.mkv, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-mkv-15s.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /Users/******/Dropbox/Videos/Sample-mkv-15s.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(/Users/******/Dropbox/Videos/Sample-mkv-15s.mkv) failed
[11:35:19] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.0
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:35:19] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/Users/******/Dropbox/Videos/Sample-mkv-15s.mkv':
  Metadata:
    ENCODER         : Lavf54.63.104
  Duration: 00:00:15.27, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264 (Main), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 fps, 1k tbn, 100 tbc (default)
    Stream #0.1(deu): Audio: mp2, 48000 Hz, 2 channels, s16p, 256 kb/s (default)
    Stream #0.2(mis): Audio: mp2, 48000 Hz, 2 channels, s16p, 192 kb/s (default)
    Stream #0.3(deu): Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s (default)
    Stream #0.4(mul): Audio: mp2, 48000 Hz, 2 channels, s16p, 192 kb/s (default)
[11:35:19] scan: decoding previews for title 1
[11:35:19] scan: audio 0x1: mp2, rate=48000Hz, bitrate=256000 Deutsch (MPEG) (2.0 ch)
[11:35:19] scan: audio 0x2: mp2, rate=48000Hz, bitrate=192000 Unknown (MPEG) (2.0 ch)
[11:35:19] scan: audio 0x3: ac3, rate=48000Hz, bitrate=448000 Deutsch (AC3) (2.0 ch)
[11:35:19] scan: audio 0x4: mp2, rate=48000Hz, bitrate=192000 Unknown (MPEG) (2.0 ch)
[11:35:19] scan: 10 previews, 1280x720, 50.000 fps, autocrop = 88/86/0/0, aspect 16:9, PAR 1:1
[11:35:20] libhb: scan thread found 1 valid title(s)
[11:35:21] macgui: Queue reloaded
[11:35:21] macgui: ScanDone state received from fQueueEncodeLibhb
[11:35:21] macgui: Preset: Normal (Default)
[11:35:21] macgui: processNewQueueEncode number of passes expected is: 1
[11:35:21] macgui: Start / Stop set to chapters
[11:35:21] macgui: prepareJob exiting
[11:35:21] 1 job(s) to process
[11:35:21] starting job
[11:35:21] sync: expecting 763 video frames
[11:35:21] job configuration:
[11:35:21]  * source
[11:35:21]    + /Users/******/Dropbox/Videos/Sample-mkv-15s.mkv
[11:35:21]    + title 1, chapter(s) 1 to 1
[11:35:21]    + container: matroska,webm
[11:35:21]  * destination
[11:35:21]    + /Users/******/Desktop/Sample-mkv-15s.m4v
[11:35:21]    + container: MPEG-4 (libavformat)
[11:35:21]  * video track
[11:35:21]    + decoder: h264
[11:35:21]    + filters
[11:35:21]      + Framerate Shaper (0:27000000:540000)
[11:35:21]        + frame rate: same as source (around 50.000 fps)
[11:35:21]      + Crop and Scale (1280:546:88:86:0:0)
[11:35:21]        + source: 1280 * 720, crop (88/86/0/0): 1280 * 546, scale: 1280 * 546
[11:35:21]    + loose anamorphic
[11:35:21]      + storage dimensions: 1280 * 546, mod 2
[11:35:21]      + pixel aspect ratio: 1 / 1
[11:35:21]      + display dimensions: 1280 * 546
[11:35:21]    + encoder: H.264 (libx264)
[11:35:21]      + preset:  veryfast
[11:35:21]      + profile: main
[11:35:21]      + level:   4.0
[11:35:21]      + quality: 20.00 (RF)
[11:35:21]  * audio track 1
[11:35:21]    + decoder: Deutsch (MPEG) (2.0 ch) (track 1, id 0x1)
[11:35:21]      + bitrate: 256 kbps, samplerate: 48000 Hz
[11:35:21]    + mixdown: Stereo
[11:35:21]    + encoder: AAC (Apple AudioToolbox)
[11:35:21]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:35:21] reader: first SCR 76680 id 0x0 DTS 76680
[11:35:21] encx264: min-keyint: 50, keyint: 500
[11:35:21] encx264: encoding at constant RF 20.000000
[11:35:21] encx264: unparsed options: level=4.0:ref=1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x264 [info]: profile Main, level 4.0
[11:35:23] macgui: Queue reloaded
[11:35:26] reader: done. 1 scr changes
[11:35:27] work: average encoding speed for job is 124.427483 fps
[11:35:27] sync: got 721 frames, 763 expected
[11:35:27] render: lost time: 0 (0 frames)
[11:35:27] render: gained time: 0 (0 frames) (0 not accounted for)
[11:35:27] h264-decoder done: 721 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:3     Avg QP:20.51  size: 50788
x264 [info]: frame P:244   Avg QP:22.36  size:  8254
x264 [info]: frame B:474   Avg QP:23.09  size:   851
x264 [info]: consecutive B-frames: 12.3%  0.0%  0.0% 87.7%
x264 [info]: mb I  I16..4: 19.9%  0.0% 80.1%
x264 [info]: mb P  I16..4:  4.2%  0.0%  0.7%  P16..4: 31.8% 15.9%  7.3%  0.0%  0.0%    skip:40.1%
x264 [info]: mb B  I16..4:  0.2%  0.0%  0.0%  B16..8:  8.7%  1.4%  0.1%  direct: 2.7%  skip:86.9%  L0:47.2% L1:40.1% BI:12.8%
x264 [info]: coded y,uvDC,uvAC intra: 40.2% 54.8% 11.1% inter: 5.5% 6.2% 0.0%
x264 [info]: i16 v,h,dc,p: 61% 20% 14%  4%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 41% 15% 14%  4%  6%  7%  4%  6%  3%
x264 [info]: i8c dc,h,v,p: 49% 13% 34%  4%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: kb/s:1425.65
[11:35:27] mp2-decoder done: 0 frames, 0 decoder errors, 0 drops
[11:35:27] mux: track 0, 721 frames, 2569619 bytes, 1425.59 kbps, fifo 1024
[11:35:27] mux: track 1, 672 frames, 295666 bytes, 164.03 kbps, fifo 1024
[11:35:27] libhb: work result = 0
[11:35:29] macgui: incrementQueueItemDone there are no more pending encodes
[11:35:30] macgui: Queue reloaded
Deleted User 13735

Re: Problems with Transport Stream

Post by Deleted User 13735 »

Run your transport streams through the Quick stream Fix utility in Videoredo first. There is a trial version.
Vietwoojagig
Posts: 49
Joined: Thu Dec 17, 2009 8:38 am

Re: Problems with Transport Stream

Post by Vietwoojagig »

1. I'm using OS X, so Videoredo is no option.
2. I have already a workflow TS -->Avidemux--> MKV -->Handbrake--> M4V that works.
3. The purpose of this post is to provide an example file that does not work with Handbrake. Since other software (e.g. VLC) are able to play the file without problem, there might be a bug in the code that is responsible for parsing the TS stream.
HandyMan
Bright Spark User
Posts: 169
Joined: Tue Aug 07, 2012 10:52 pm

Re: Problems with Transport Stream

Post by HandyMan »

A few months ago I noticed that Avidemux was causing these problems on some 720p channel, since then I use VideoRedo to cut and fix .ts
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

I've never seen a TS file with more broken timestamps. That is one f'd up stream. The timestamps are jumping backward in time all over the place. It would take some extraordinary efforts to fix this.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

Just FYI. I ran a quick test to see if it works to buffer some number of frames and manually re-order the timestamps in those frames after decoding. In order to catch all the backward jumping timestamps, I had to buffer 32 frames. Playback was smooth after this, so the timestamps are truely out of order and not just randomly jumbled.

We currently already have code that buffers 8 frames and re-orders timestamps for another known error condition (broken AVI files). In theory, I could use this same code to "fix" this problem, but increasing this value to 32 means we would be consuming an additional 60MB of memory (when encoding HD, I don't even want to think about the memory consumption of 4K). And there is no guarantee that you (or someone else) won't find a stream that requires more buffering. So I really don't want to do this.

Patch for those that are interested http://paste.handbrake.fr/pastebin.php?show=3944
Deleted User 11865

Re: Problems with Transport Stream

Post by Deleted User 11865 »

If it works fine in VLC, maybe we could look at what they're doing?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

Rodeo wrote:If it works fine in VLC, maybe we could look at what they're doing?
"Fine" is probably an overstatement. It also works "fine" in avplay. I already looked at what avplay does. When it sees pts errors it makes a "guess". It's "guess" is to use dts if the number of pts errors exceeds the number of dts errors. You can see a few stutters and the A/V sync is going to be off what whatever the separation is between dts and pts. But it looks mostly "fine".

Another option would be to just advance the pts by the frame duration whenever the pts goes backwards. I tried this and it also "fixes" this stream. But this would be prone to sync drift if you have a file where timestamps actually *do* jump backward (i.e. not just out of order) for one stream and do not jump backwards for other streams in the file. I.e. the frame dropping logic in sync.c might as well be removed because it would never be invoked. Buffering frames and reordering timestamps does not have this potential for sync drift.

The avplay "guess" is better than adding frame duration IMO because it also does not have this sync drift issue (it is just permanently out of sync by some small amount, about 30ms in this sample stream).
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

Forgot to mention, using the patch I posted, but changing the buffer depth back to 8 looks nearly as good as avplay to me, even though it is still dropping many frames in sync.c. So this would also be "fine" by some definition of the word.

The result of a buffer depth of 8 is that one frame out of 16 is dropped due to the timestamp going backwards. The lost time is made up by one frame in the group of 16 being 2 periods long. Without the patch, the pattern of drops is irregular with frequent sequences of 8 consecutive dropped frames.

Strangely, increasing the buffer depth to 16 isn't really better than 8. Different frames are dropped, but it is still 1 in 16. A depth of 17 makes the problem go away. So the period of the out of order sequences appears to always be 17 or less frames. My guess is that a depth of 8 is enough to resolve all out of order b-frames (b-pyramid), but not enough to resolve the out of order p frame which will have the largest descrepency. I.e. There is a sequence IPBBBBBBBBBBBBBBB. The I and the Bs always resolve in less than 8 frames, but the P (which belongs at the end in display sequence) requires a depth of 17.
Deleted User 13735

Re: Problems with Transport Stream

Post by Deleted User 13735 »

JohnAStebbins,
Just to be clear, are the broken and backwards time stamps a result of stream errors from satellite broadcast, or from the processing that was done in AviDemux, or is that possible to tell?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

I don't know if it was AviDemux or some problem with the the encoding of the stream *pre-broadcast*. But basically, there are frames that have timestamps that indicate the frame should be played *out* of order, but the bitstream is encoded with the frames *in* order.

One way I can imagine this happening is if the broadcast transcoder or avidemux did not properly associate the timestamps with the correct frames during decoding. The decoder doesn't really need timestamps to decode. It will spit out a sequence of frames without them. But due to P and B frames, the order of the output frames will not be the same as the order they were input to the decoder. So if the transcoding software is reading a packet, parsing the pts, decoding a frame, and assiging that pts to the decoded frame, it will be assiging the pts to the wrong frame. I think some variation of this must have happened in the creation of this TS file.
PaulF
Novice
Posts: 58
Joined: Thu Nov 21, 2013 7:15 am

Re: Problems with Transport Stream

Post by PaulF »

Stepped through a few frames and the PTS jumped, but the the DTS didn't. A clue?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

PaulF wrote:Stepped through a few frames and the PTS jumped, but the the DTS didn't. A clue?
DTS is the time the frame should be presented to the input of the decoder. It *must* always be in order by spec except at stream discontinuities (which are generally rare). If DTS jumped around, you would generally treat it as a discontinuity and adjust all subsequent timestamps by the amount that it jumped.

PTS jumping around is actually normal, but it is accompanied by a resequencing of the frames during decoding such that after decoding, the timestamps are back in order. This is what is not happening with this stream. After resequencing the frames and their associated PTS by the decoder, the PTS is still out of order (i.e. not monotonically increasing).
PaulF
Novice
Posts: 58
Joined: Thu Nov 21, 2013 7:15 am

Re: Problems with Transport Stream

Post by PaulF »

JohnAStebbins wrote:
PaulF wrote:Stepped through a few frames and the PTS jumped, but the the DTS didn't. A clue?
PTS jumping around is actually normal, but it is accompanied by a resequencing of the frames during decoding such that after decoding, the timestamps are back in order.
Thanks. I happen to be working on another ts problem and learned something. Since you mentioned decoding, I tried a different codec and QSV works OK. A clue?
Deleted User 11865

Re: Problems with Transport Stream

Post by Deleted User 11865 »

PaulF wrote:
JohnAStebbins wrote:
PaulF wrote:Stepped through a few frames and the PTS jumped, but the the DTS didn't. A clue?
PTS jumping around is actually normal, but it is accompanied by a resequencing of the frames during decoding such that after decoding, the timestamps are back in order.
Thanks. I happen to be working on another ts problem and learned something. Since you mentioned decoding, I tried a different codec and QSV works OK. A clue?
That's because we have timestamp reordering to work around another, QSV-specific bug.
Vietwoojagig
Posts: 49
Joined: Thu Dec 17, 2009 8:38 am

Re: Problems with Transport Stream

Post by Vietwoojagig »

Hi guys,
thank a lot for the time you spend to check this issue.

I can assure you, that the problem is exactly the same for the original 12GB file, which has not been touched by Avidemux.
I could produce the problem anywhere in the timeline of the original file in the 15s previews of Handbrake.

I was cutting off the end (not the beginning) to make it 15s long sample which does not blow up my dropbox space.

Some of the problematic files that I have (not the one that I provided), had been edited by the Kathrein SAT receiver. I had to cut them because the movies sometimes contain 5.1 audio, but not the advertisement at the beginning. And Handbrake then only sees the 2.0. I don't know what Kathrein uses to edit files.

What surprised me was, that Avidemux somehow repairs the file during export to MKV but not to TS. And the MKV is shrinked from 12GB to 7GB. So there seems to be a lot of other stuff in the file which maybe belongs to other programs of the the same transponder.

If things are too complicated or have bad side effects , I would have a workflow that I could live with (export to MKV first). I used this workflow to encode the move of the sample and everything is fine and in sync.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

Vietwoojagig wrote:Hi guys,
thank a lot for the time you spend to check this issue.

I can assure you, that the problem is exactly the same for the original 12GB file, which has not been touched by Avidemux.
I could produce the problem anywhere in the timeline of the original file in the 15s previews of Handbrake.
FYI, you don't need to use avidemux to cut a TS file. You can hack a TS file pretty much anwhere. There are no global headers to worry about, so any tool such as dd on linux/osx that can cut a segment out of a file will work.
I was cutting off the end (not the beginning) to make it 15s long sample which does not blow up my dropbox space.

Some of the problematic files that I have (not the one that I provided), had been edited by the Kathrein SAT receiver. I had to cut them because the movies sometimes contain 5.1 audio, but not the advertisement at the beginning. And Handbrake then only sees the 2.0. I don't know what Kathrein uses to edit files.

What surprised me was, that Avidemux somehow repairs the file during export to MKV but not to TS. And the MKV is shrinked from 12GB to 7GB. So there seems to be a lot of other stuff in the file which maybe belongs to other programs of the the same transponder.

If things are too complicated or have bad side effects , I would have a workflow that I could live with (export to MKV first). I used this workflow to encode the move of the sample and everything is fine and in sync.
I'm thinking I should *at least* commit my patch that enables re-ordering with a buffer depth of 8. It improves the output *and* it provides log output that alerts us that the file has timestamp problems. The log will save a lot of debug time in the future if/when others have similar problems.
Vietwoojagig
Posts: 49
Joined: Thu Dec 17, 2009 8:38 am

Re: Problems with Transport Stream

Post by Vietwoojagig »

JohnAStebbins wrote:FYI, you don't need to use avidemux to cut a TS file. You can hack a TS file pretty much anwhere. There are no global headers to worry about, so any tool such as dd on linux/osx that can cut a segment out of a file will work.
OK , here are the first untouched 25MB from the original file, copied by the use of the dd unix command (dd if=.. of=.. count=25000000 bs=1):
https://www.dropbox.com/s/j4f243arp03wj ... ts-25mb.ts
Vietwoojagig
Posts: 49
Joined: Thu Dec 17, 2009 8:38 am

Re: Problems with Transport Stream

Post by Vietwoojagig »

I did a quick test with 6227svn

The sample of the first 25MB of the original transport stream (Sample-ts-25mb.ts), created with unix command dd, now works great and produces no errors.
The sample of the first 15s of the edited transport stream (Sample-ts-15s.ts), edited with Avidemux still don't work.

So I will stop editing transport steams with Avidemux in future.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Problems with Transport Stream

Post by JohnAStebbins »

Strange that it would "wotk" now because no changes have been made yet that should have any effect on this problem. This makes me think that avidemux was the cause of the original problem.
Djfe
Bright Spark User
Posts: 178
Joined: Tue May 13, 2014 8:01 pm

Re: Problems with Transport Stream

Post by Djfe »

you should stop using avidemux and use TS Doctor by Cypheros instead (http://www.cypheros.de/tsdoctor_e.html)
you can use the trial to test it

from my own experience I can only recommend it

it supports a lot of receivers and formats that are receiver specific versions of ts (ts4, rec, etc.)

you can fix and cut your stream with it and it brings along tools to remux your stream to mp4, mkv etc.
and a lot of other tools, like a raw cutter (cut off for example 25mb but take packets into consideration)

it works just fine and if there would be any errors in the source file like time jumps it would correct them for you

Like John I guess Avidemux produces the issue as it isn't handling transport streams correctly (somthing similar could be said for smart cutter, too)

EDIT:
@John if you ask the developer (cypheros) you could probably get some help in handling TS files with errors, as he has a lot of knowledge about them
Post Reply