A few seconds - 1 minute is missing at the end

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
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

A few seconds - 1 minute is missing at the end

Post by linuxuser »

I recode DVB-S2 recordings, everything looks fine, except that at the end a few seconds - could be 1 minute too, is missing. Lips are synced. When I compare the original video length with vlc or mediainfo and with handbrake, the handbrake-time is shorter. Please let me know, which info you need. I use "gtkgui: HandBrake svn7008 (2015032101) - Linux x86_64". I think the problem is the DVB-S-stream itself, but if I play the ts-file with vlc the end is there, which is not with handbrake.

Please let me know which info you need.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

I found something interesting:

Original ts-file shows with vlc: 1:34:33 (6 GB)
Original ts-file loaded with handbrake: 1:33:26
Recoded file with handbrake: 1:33:26 (so about 1 minute is missing at the end)

Then I converted the original file into a mkv-container with "mkvmerge -o"
Original mkv-file with vlc: 1:34:34 (5.3GB)
Original mkv-file loaded with handbrake: 1:34:34
I didn't recode it with handbrake until now

So mkvmerge somehow heals the handbrake problem, although the file gets smaller, maybe the conversion reduces audio tracks or something else.

avconv -i ...ts -c copy ...ts makes the file smaller too, but handbrake shows 1:32:55 as length and the file is broken, I cannot move forward.
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: A few seconds - 1 minute is missing at the end

Post by mduell »

linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

Yesterday I had 2 files with this problem. Unfortunately I deleted them, because I needed space on my disk, with 2 new files everything is ok. I will come back to you, if I have a file with this problem again. Maybe it depends on the recorded satellite channel. I am sure the primary problem is the sent stream and not handbrake, but I think handbrake can correct it, since mkvmerge can it.

I also updated handbrake, but if you are not aware of the problem, I think it is not solved because of the newest version.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

The source is a recording from WDR:
20150401 1417 - WDR HD Köln - Lissabon - Stadt des Fado und des Lichts.ts
For testing the file was copied and renamed to test_broken.ts
[15:49:50] gtkgui: HandBrake svn7031 (2015033101) - Linux x86_64 - https://handbrake.fr
[15:49:50] hb_init: starting libhb thread
[15:49:50] hb_init: starting libhb thread
[15:49:50] hb_init: starting libhb thread
[15:50:01] CPU:
[15:50:01] - logical processor count: 8
[15:50:01] OpenCL: library not available
[15:50:01] hb_scan: path=/tapes/test_broken.ts, title_index=0
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /tapes/test_broken.ts/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /tapes/test_broken.ts/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(/tapes/test_broken.ts) failed
[15:50:01] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
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
[15:50:01] dvd: not a dvd - trying as a stream/file instead
[15:50:01] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[15:50:01] Found the following PIDS
[15:50:01] Video PIDS :
[15:50:01] 0x157d type H.264 (0x1b) (PCR)
[15:50:01] Audio PIDS :
[15:50:01] 0x157e type MPEG1 (0x3)
[15:50:01] 0x157f type MPEG1 (0x3)
[15:50:01] 0x1582 type AC3 (0x81)
[15:50:01] Subtitle PIDS :
[15:50:01] Other PIDS :
[15:50:01] 0x1580 type DVB Teletext (0x0)
[15:50:01] 0x87b type ISO 13818-6 DSM-CC U-N msgs (0xb)
[15:50:01] 0x942 type ISO 13818-1 private section (0x5)
[15:50:01] 0x1581 type DVB Subtitling (0x0)
[15:50:01] stream id 0x157e (type 0x3 substream 0x0) audio 0x157e
[15:50:01] stream id 0x157f (type 0x3 substream 0x0) audio 0x157f
[15:50:01] stream id 0x1582 (type 0x81 substream 0x0) audio 0x1582
[15:50:02] scan: decoding previews for title 1
[15:50:02] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[15:50:02] scan: audio 0x1582: ac3, rate=48000Hz, bitrate=448000 Deutsch (AC3) (2.0 ch)
[15:50:02] scan: audio 0x157f: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG) (2.0 ch)
[15:50:02] scan: audio 0x157e: mp2, rate=48000Hz, bitrate=200000 Deutsch (MPEG) (2.0 ch)
[15:50:04] stream: 30 good frames, 0 errors (0%)
[15:50:04] scan: 10 previews, 1280x720, 50,000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[15:50:04] libhb: scan thread found 1 valid title(s)
mediainfo shows a length of 43mn 23s, while handbrake shows less (42:45).
$ mediainfo test_broken.ts
General
ID : 1201 (0x4B1)
Complete name : test_broken.ts
Format : MPEG-TS
File size : 3.00 GiB
Duration : 43mn 23s
Overall bit rate mode : Variable
Overall bit rate : 9 887 Kbps

Video
ID : 5501 (0x157D)
Menu ID : 28325 (0x6EA5)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=8, N=32
Codec ID : 27
Duration : 43mn 23s
Bit rate : 8 558 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.186
Stream size : 2.59 GiB (87%)

Audio #1
ID : 5502 (0x157E)
Menu ID : 28325 (0x6EA5)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 43mn 23s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : -611ms
Stream size : 59.6 MiB (2%)
Language : German

Audio #2
ID : 5503 (0x157F)
Menu ID : 28325 (0x6EA5)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 43mn 23s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : -612ms
Stream size : 59.6 MiB (2%)

Audio #3
ID : 5506 (0x1582)
Menu ID : 28325 (0x6EA5)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : 6
Duration : 43mn 23s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -786ms
Stream size : 139 MiB (5%)
Language : German

Text #1
ID : 5504 (0x1580)-100
Menu ID : 28325 (0x6EA5)
Format : Teletext
Language : German

Text #2
ID : 5505 (0x1581)
Menu ID : 28325 (0x6EA5)
Format : DVB Subtitle
Codec ID : 6
Delay relative to video : 2s 640ms
Language : German

Menu
ID : 5500 (0x157C)
Menu ID : 28325 (0x6EA5)
Duration : 43mn 23s
List : 5501 (0x157D) (AVC) / 5502 (0x157E) (MPEG Audio, German) / 5503 (0x157F) (MPEG Audio) / 5504 (0x1580) () / 5506 (0x1582) (AC-3, German) / 2171 (0x87B) () / 2370 (0x942) () / 5505 (0x1581) (DVB Subtitle, German)
Language : / German / / / German / / / German
Handbrake shows a length of 00:42:45,00. See Screenshot:

Image
Last edited by linuxuser on Wed Apr 01, 2015 2:23 pm, edited 1 time in total.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

After a conversion of the ts file to mkv with mkvmerge I see the "mediainfo-time" in handbrake:

Image
$ mediainfo 20150401-1417---wdr-hd-koeln---lissabon---stadt-des-fado-und-des-lichts~16.9_1280x720p_v_9338kbps_vmpg4_mp3_48khz_43mn24s.mkv
General
Unique ID : 275528383475867548916294520395982476277 (0xCF48D6200BB1A0AB97119D3158F493F5)
Complete name : 20150401-1417---wdr-hd-koeln---lissabon---stadt-des-fado-und-des-lichts~16.9_1280x720p_v_9338kbps_vmpg4_mp3_48khz_43mn24s.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 2.83 GiB
Duration : 43mn 24s
Overall bit rate : 9 338 Kbps
Encoded date : UTC 2015-04-01 13:30:39
Writing application : mkvmerge v6.7.0 ('Back to the Ground') 64bit built on Jan 9 2014 18:03:17
Writing library : libebml v1.3.0 + libmatroska v1.4.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=8, N=32
Codec ID : V_MPEG4/ISO/AVC
Bit rate : 8 320 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Original frame rate : 50.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Default : Yes
Forced : No

Audio #1
ID : 2
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : A_MPEG/L2
Codec ID/Hint : MP2
Duration : 43mn 24s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : -487ms
Stream size : 59.6 MiB (2%)
Language : German
Default : Yes
Forced : No

Audio #2
ID : 3
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : A_MPEG/L2
Codec ID/Hint : MP2
Duration : 43mn 24s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : -488ms
Stream size : 59.6 MiB (2%)
Default : No
Forced : No

Audio #3
ID : 4
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : A_AC3
Duration : 43mn 24s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -566ms
Stream size : 139 MiB (5%)
Language : German
Default : No
Forced : No
Woodstock
Veteran User
Posts: 4619
Joined: Tue Aug 27, 2013 6:39 am

Re: A few seconds - 1 minute is missing at the end

Post by Woodstock »

Recorded transport stream files can have inconsistencies in them. I have seen numerous recommendations for running any recorded TS files through a utility like "Video Fixer" to have those cleared up before you run it through handbrake.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

What do you recommend to fix it with Linux? Is threre a better recommendation than mkvmerge?
Woodstock
Veteran User
Posts: 4619
Joined: Tue Aug 27, 2013 6:39 am

Re: A few seconds - 1 minute is missing at the end

Post by Woodstock »

Personally, I can't make any recommendations, but several possibilities came up with a search for "video fixer linux" on Google.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

Thanks, I have one dvb-receiver which creates files, that are better converted with mkvmerge, while files from the other are better converted with avconv / ffmepg. Project-X doesn't work with HD-videos. Mjpegtools have been reported to create audio delays. Not so easy ...
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

In the meantime I encoded a few very problematic dvb-streams, eg they could not be played with vlc or only partially, crashed with kdenlive, a.s.o.
HandBrake 0.10.1 (2015030800) encoded them all as expected, no problems detected. So IMHO there must be a bug with the development versions.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: A few seconds - 1 minute is missing at the end

Post by JohnAStebbins »

You have a bad habit of not providing proper logs. In all of this, you have not provided a single encode log showing us what HandBrake does when encoding one of these files. An encode log might show us why it skips the final bit of the file.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

Sorry, I posted all the log I got with handbrake. There is nothing more than in the 5th posting above.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: A few seconds - 1 minute is missing at the end

Post by JohnAStebbins »

The 5th posting is a scan log. Not an encode log. I want to see what happens when HandBrake encodes this file, not just the scan.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: A few seconds - 1 minute is missing at the end

Post by linuxuser »

Ok, sorry, next time I will try to do it better.
Post Reply