svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

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
mac.jedi
Enlightened
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by mac.jedi »

I'm getting regular segmentation faults when encoding tsMuxeR m2ts files with VC-1 and DTS. I get the error either straight away or 30-40% in. This is only happening with the last few svn's I've compiled:
svn2592
svn2713
svn2725

If I use SVN 2412 I get no seg faults. It works perfectly, as all my compiles have previously.

I've listed the log for svn2725 below:
I've tried changing the encode settings and got it to work once with no settings only -i and -o.
The settings below are what I use in a shell script for batch encoding. I also tried using ca_aac, but it fails also.

-Version: HandBrakeCLI svn2725 (2009072301) - Darwin x86_64
-Date of download: 2009-07-23
-Platform: Mac
-Settings: -e x264 -b 5500 -a 1,1 -E faac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 --width 1280 --maxHeight 720 -m -x cabac=0:ref=2:mixed-refs=1:bframes=3:me=umh:subme=7:b-adapt=2:8x8dct=1 -v
-Operating System version: Mac OS X - v10.5.7
-M2TS title: Watchmen Blu-Ray
-What you were doing at the time besides encoding: Monitoring Encoding Status via Screen Sharing
-What other applications were running: iTunes
-Whether or not the problem is reproducible: Is reproducible. Sometimes errors after .10%.

Code: Select all

#ERROR LOG
$ /Users/robertyamada/handbrakecli-svn2725/HandBrakeCLI -i /Volumes/SpeedDisk/Test/test3.m2ts -o /Volumes/SpeedDisk/test5.m4v -e x264 -b 5500 -a 1,1 -E faac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 --width 1280 --maxHeight 720 -m -x cabac=0:ref=2:mixed-refs=1:bframes=3:me=umh:subme=7:b-adapt=2:8x8dct=1 -v
[15:21:22] hb_init: checking cpu count
[15:21:22] hb_init: starting libhb thread
HandBrake svn2725 (2009072301) - Darwin x86_64 - http://handbrake.fr
8 CPUs detected
Opening /Volumes/SpeedDisk/Test/test3.m2ts...
[15:21:22] hb_scan: path=/Volumes/SpeedDisk/Test/test3.m2ts, title_index=1
[15:21:22] scan: trying to open with libdvdread
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.
ERROR: dvd: ifoOpen failed
[15:21:22] file is MPEG Transport Stream with 192 byte packets offset 4 bytes
[15:21:22] hb_ts_stream_find_pids - found the following PIDS
[15:21:22]     Video PIDS : 
[15:21:22]       0x1011 type VC1 (0xea)
[15:21:22]     Audio PIDS : 
[15:21:22]       0x1100 type HDMV DTS (0x82)
[15:21:22] transport stream pid 0x1100 (type 0x82) may be HDMV DTS audio (id 0x1)
[15:21:22] scan: decoding previews for title 1
[15:21:22] scan: audio 0x1: DCA, rate=48000Hz, bitrate=1536000 English (DTS) (5.1 ch)
Scanning title 1...
Scanning title 1...
Scanning title 1...
[15:21:23] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 140/140/0/0, aspect 16:9, PAR 1:1
[15:21:23] scan: title (0) job->width:1920, job->height:800
[15:21:23] stream: 5 good frames, 0 errors (0%)
Scanning title 1...
[15:21:23] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + duration: 03:03:27
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 140/140/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 03:03:27
  + audio tracks:
    + 1, English (DTS) (5.1 ch) (iso639-2: eng), 48000Hz, 1536000bps
  + subtitle tracks:
Invalid sample rate 0, using input rate 48000
[15:21:23] 1 job(s) to process
[15:21:23] starting job
[15:21:23] Passthru requested and input codec is not the same as output codec for track 2
[15:21:23] job configuration:
[15:21:23]  * source
[15:21:23]    + /Volumes/SpeedDisk/Test/test3.m2ts
[15:21:23]    + title 1, chapter(s) 1 to 1
[15:21:23]  * destination
[15:21:23]    + /Volumes/SpeedDisk/test5.m4v
[15:21:23]    + container: MPEG-4 (.mp4 and .m4v)
[15:21:23]      + 64-bit formatting
[15:21:23]      + chapter markers
[15:21:23]  * video track
[15:21:23]    + decoder: vc1
[15:21:23]      + bitrate 200 kbps
[15:21:23]    + frame rate: same as source (around 23.976 fps)
[15:21:23]    + dimensions: 1920 * 1080 -> 1280 * 528, crop 140/140/0/0
[15:21:23]    + encoder: x264
[15:21:23]      + options: cabac=0:ref=2:mixed-refs=1:bframes=3:me=umh:subme=7:b-adapt=2:8x8dct=1
[15:21:23]      + bitrate: 5500 kbps, pass: 0
[15:21:23]  * audio track 0
[15:21:23]    + decoder: English (DTS) (5.1 ch) (track 1, id 1)
[15:21:23]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[15:21:23]    + mixdown: Dolby Pro Logic II
[15:21:23]    + encoder: faac
[15:21:23]      + bitrate: 160 kbps, samplerate: 48000 Hz
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.
ERROR: dvd: ifoOpen failed
[15:21:23] reader: first SCR 53955000
[15:21:23] encx264: keyint-min: 24, keyint-max: 240
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile High, level 3.1
Stream with high frequencies VQ coding
[15:21:23] sync: expecting 263932 video frames
[15:21:23] sync: first pts is 3754
Encoding: task 1 of 1, 32.45 % (42.33 fps, avg 39.92 fps, ETA 01h14m26s)Segmentation fault
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by nathug »

I'd highly recommend using ClownBD to do all the work to get files ready for Handbrake. The guy who created it keeps it up to date all the time. I haven't had a problem in a very very long time with files that are changed with this great front end.

Nate
User avatar
JohnAStebbins
HandBrake Team
Posts: 5725
Joined: Sat Feb 09, 2008 7:21 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by JohnAStebbins »

I tried reproducing this on linux with svn2713. It works fine for me. The disc I used is "Dark City" which has VC-1, DTS-HD, and a couple regular DTS tracks. used tsMuxeR gui to re-mux to an m2ts with VC-1 and regular old DTS (this is unnecessary with handbrake, but I did it anyway to reproduce the conditions as close as possible). I also tried other combinations of audio tracks (not shown here). mac.jedi, have a look to see if I replicated your scenario properly.

tsMuxeR parameters I used:

Code: Select all

MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr  --vbv-len=500
V_MS/VFW/WVC1, "/mnt/Sandbox/TS-Rips/DARK_CITY/BDMV/STREAM/00043.m2ts", fps=23.976, track=4113
A_DTS, "/mnt/Sandbox/TS-Rips/DARK_CITY/BDMV/STREAM/00043.m2ts", down-to-dts, track=4352
hb cli command:

Code: Select all

HandBrakeCLI -i ~/Videos/test2.m2ts -o ~/Videos/test.m4v -e x264 -b 5500 -a 1,1 -E faac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 --width 1280 --maxHeight 720 -m -x cabac=0:ref=2:mixed-refs=1:bframes=3:me=umh:subme=7:b-adapt=2:8x8dct=1 -v
Successful Activity log:

Code: Select all

[10:26:30] hb_init: checking cpu count
[10:26:30] hb_init: starting libhb thread
HandBrake svn2713 (2009071901) - Linux x86_64 - http://handbrake.fr
2 CPUs detected
Opening /home/jstebbins/Videos/test2.m2ts...
[10:26:30] hb_scan: path=/home/jstebbins/Videos/test2.m2ts, title_index=1
[10:26:30] scan: trying to open with libdvdread
libdvdread: Using libdvdcss version 1.2.10 for DVD access
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.
ERROR: dvd: ifoOpen failed
[10:26:30] file is MPEG Transport Stream with 192 byte packets offset 4 bytes
[10:26:30] hb_ts_stream_find_pids - found the following PIDS
[10:26:30]     Video PIDS : 
[10:26:30]       0x1011 type VC1 (0xea)
[10:26:30]     Audio PIDS : 
[10:26:30]       0x1100 type HDMV DTS (0x82)
[10:26:32] transport stream pid 0x1100 (type 0x82) may be HDMV DTS audio (id 0x1)
[10:26:32] scan: decoding previews for title 1
Scanning title 1...
[10:26:32] scan: audio 0x1: DCA, rate=48000Hz, bitrate=1536000 Unknown (DTS) (5.1 ch)
Scanning title 1...
Scanning title 1...
Scanning title 1...
Scanning title 1...
Scanning title 1...
Scanning title 1...
Scanning title 1...
[10:26:34] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 128/138/60/0, aspect 16:9, PAR 1:1
[10:26:34] scan: title (0) job->width:1872, job->height:816
[10:26:34] stream: 4 good frames, 0 errors (0%)
[10:26:34] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + duration: 01:48:37
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 128/138/60/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:48:37
  + audio tracks:
    + 1, Unknown (DTS) (5.1 ch) (iso639-2: und), 48000Hz, 1536000bps
  + subtitle tracks:
Invalid sample rate 0, using input rate 48000
[10:26:34] 1 job(s) to process
[10:26:34] starting job
[10:26:34] Passthru requested and input codec is not the same as output codec for track 2
[10:26:34] job configuration:
[10:26:34]  * source
[10:26:34]    + /home/jstebbins/Videos/test2.m2ts
[10:26:34]    + title 1, chapter(s) 1 to 1
[10:26:34]  * destination
[10:26:34]    + /home/jstebbins/Videos/test.m4v
[10:26:34]    + container: MPEG-4 (.mp4 and .m4v)
[10:26:34]      + 64-bit formatting
[10:26:34]      + chapter markers
[10:26:34]  * video track
[10:26:34]    + decoder: vc1
[10:26:34]      + bitrate 200 kbps
[10:26:34]    + frame rate: same as source (around 23.976 fps)
[10:26:34]    + dimensions: 1920 * 1080 -> 1280 * 560, crop 128/138/60/0
[10:26:34]    + encoder: x264
[10:26:34]      + options: cabac=0:ref=2:mixed-refs=1:bframes=3:me=umh:subme=7:b-adapt=2:8x8dct=1
[10:26:34]      + bitrate: 5500 kbps, pass: 0
[10:26:34]  * audio track 0
[10:26:34]    + decoder: Unknown (DTS) (5.1 ch) (track 1, id 1)
[10:26:34]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[10:26:34]    + mixdown: Dolby Pro Logic II
[10:26:34]    + encoder: faac
[10:26:34]      + bitrate: 160 kbps, samplerate: 48000 Hz
libdvdread: Using libdvdcss version 1.2.10 for DVD access
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.
ERROR: dvd: ifoOpen failed
[10:26:34] reader: first SCR 53955000
[10:26:34] encx264: keyint-min: 24, keyint-max: 240
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile High, level 3.1
Stream with high frequencies VQ coding
[10:26:35] sync: expecting 156296 video frames
Encoding: task 1 of 1, 0.00 %[10:26:35] sync: first pts is 3754
Encoding: task 1 of 1, 100.00 %[15:39:09] hb_ts_stream_decode - eofm00s)
[15:39:09] dca_syncinfo failed
[15:39:09] stream: 160729 good frames, 0 errors (0%)
[15:39:09] reader: done. 1 scr changes
Encoding: task 1 of 1, 100.00 %[15:39:22] sync: got 160728 frames, 156296 expected
[15:39:22] work: average encoding speed for job is 8.563493 fps
Muxing: this may take awhile...[15:39:24] mux: track 0, 160728 frames, 4509851911 bytes, 5381.86 kbps, fifo 16
[15:39:24] mux: track 1, 314239 frames, 133652198 bytes, 159.49 kbps, fifo 1024
[15:39:24] vc1-decoder done: 160729 frames, 1 decoder errors, 0 drops
[15:39:24] render: lost time: 0 (0 frames)
[15:39:24] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:3294  Avg QP:11.91  size: 81079  PSNR Mean Y:50.98 U:55.04 V:55.51 Avg:51.84 Global:51.30
x264 [info]: slice P:60143 Avg QP:12.96  size: 43994  PSNR Mean Y:49.19 U:54.06 V:54.46 Avg:50.02 Global:49.10
x264 [info]: slice B:97291 Avg QP:14.41  size: 16413  PSNR Mean Y:48.09 U:53.99 V:54.52 Avg:49.03 Global:48.25
x264 [info]: consecutive B-frames:  3.0% 32.7% 33.0% 31.2%
x264 [info]: mb I  I16..4: 10.4% 67.3% 22.3%
x264 [info]: mb P  I16..4:  1.9% 14.0%  3.0%  P16..4: 33.5% 27.7% 13.5%  0.0%  0.0%    skip: 6.4%
x264 [info]: mb B  I16..4:  0.2%  1.9%  0.4%  B16..8: 47.4%  3.6%  4.3%  direct: 8.7%  skip:33.5%  L0:38.4% L1:50.6% BI:11.0%
x264 [info]: final ratefactor: 16.62
x264 [info]: 8x8 transform  intra:73.1%  inter:48.1%
x264 [info]: coded y,uvDC,uvAC intra:89.9% 91.3% 82.0% inter:32.4% 40.1% 6.5%
x264 [info]: ref P L0  73.0% 27.0%
x264 [info]: SSIM Mean Y:0.9899400
x264 [info]: PSNR Mean Y:48.559 U:54.038 V:54.517 Avg:49.456 Global:48.598 kb/s:5381.93
[15:39:24] libhb: work result = 0

Rip done!
HandBrake has exited.
mac.jedi
Enlightened
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by mac.jedi »

JohnAStebbins wrote: mac.jedi, have a look to see if I replicated your scenario properly.
Hi John,

Thanks for looking into this. Everything looks right. The only other common thing I've noticed is that the "titles" that are failing are also seamless branching. So it may be something to do with HandBrake or a support app having trouble with these m2ts files. I tried using a ts container, but it didn't make any difference. What is really weird is that they encode fine with HandBrake svn 2412. Also what is weird, is that I was able to encode the non-directors cut track of Watchmen off the same BD with no issues. It also had seamless branching, VC-1 and DTS-HD.

So the common things I see are: Seamless branching, VC-1 and DTS-HD, but only on certain playlists, which makes it not so common. I also haven't seen any issues with non-seamless branching, VC-1 and DTS-HD or any other combination of audio or video codecs.

In any case, I'm definitely keeping a copy of svn 2412 around for a while.

Thanks,

Robert
User avatar
JohnAStebbins
HandBrake Team
Posts: 5725
Joined: Sat Feb 09, 2008 7:21 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by JohnAStebbins »

Seamless branching means the movie is made up of several separate m2ts files. What are you using to splice together the collection of m2ts files? In general, you can't just concatenate them together. Each video segment actually starts a few sectors after the beginning of the file. There's a map that defines where each segment begins and ends within each m2ts that should be followed (in BDMV/CLIBINF/*.clpi). I found that sometimes, if you don't follow this map, the extra junk that gets inserted at the splice points can make the decoder crash. Specifically, I encountered this with Spiderman 2.

If you are proficient at building from source, I wrote some tools for inspecting bd structure information and splicing m2ts files properly. The source can be found here: http://www.stebbins.biz/source/bdtools-1.1.tgz
mac.jedi
Enlightened
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by mac.jedi »

JohnAStebbins wrote: What are you using to splice together the collection of m2ts files? In general, you can't just concatenate them together.
Thank you so much for your help!

In answer to your question, I'm using the tsMuxeR GUI and cli (mac) to combine the m2ts files.

Thanks again for the link, I'll take a crack at the tools when I get some free time.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by nathug »

Not to push it, but ClownBD really does takes care of all of this guess work here, its totally fool proof. The only stitching issue I ever had was with Bolt, but this was from a version way back and is now fixed. ClownBD has come a long way since its first release, now it can extract audio cores, convert audio, rebuild the m2ts file etc. etc. Takes no more that 45min to an hour per moive, after taking less than a minute to start it.

All Handbreak versions haave taken every file I have created with this, with no problems what so ever, and I've ran them on most builds.
Nate
User avatar
JohnAStebbins
HandBrake Team
Posts: 5725
Joined: Sat Feb 09, 2008 7:21 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by JohnAStebbins »

ClownBD is a windows tool that is a front end to several other utilities. Can they be run under parallels or something? The OP is using mac. From what I've read, eac3to doesn't run properly under wine, so ClownBD is a no-go on linux (my os of choice). It uses several DirectShow decoders which can't be made to work.
mac.jedi
Enlightened
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: svn2592, 2713, 2725 Segmentation Fault with M2ts, vc1, dts

Post by mac.jedi »

I appreciate your suggestion, but I've tried BDclown under VMware Fusion. Like John wrote, It is really is just a front end for eac3to and a couple other tools ... including tsMuxeR. I don't see how there would be any difference between muxing with BDClown or just using tsMuxeR ... Other than the gui.

In any case, I'm trying to get away from using Windows altogether as it makes me feel icky, like I need a shower or something. :)
Post Reply