using NLMeans instantly cause crashing

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
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

using NLMeans instantly cause crashing

Post by Lazyncoder »

Hi,

just tried to test something with NLMeans. it crashes instantly (in my case at 00.08%).
Nothing to post here as log.

Image

Edit: last_encode_log.txt

Code: Select all

HandBrake svn6879 (Nightly Build) - 64bit Version
OS: Microsoft Windows NT 6.2.9200.0 - 64bit
CPU: Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
Ram: 24566 MB, 
GPU Information:
  Microsoft Basic Display Adapter - 6.3.9600.16384
Screen: 1024x768
Temp Dir: C:\Users\Administrator\AppData\Local\Temp\2\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\Administrator\AppData\Roaming\HandBrake\HandBrake\0.0.0.6879

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


# Scanning title for encoding ... 
[22:33:30] CPU: Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
[22:33:30]  - logical processor count: 24
[22:33:30] OpenCL: library not available
[22:33:30] Intel Quick Sync Video support: no
[22:33:30] hb_scan: path=E:\Videos\Test1.mkv, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening E:\Videos\Test1.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening E:\Videos\Test1.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(E:\Videos\Test1.mkv) failed
[22:33:30] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[22:33:30] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'E:\Videos\Test1.mkv':
  Duration: 00:43:04.12, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1916x1076 [PAR 1:1 DAR 479:269], 24 fps, 1k tbn (default)
    Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s (default)
    Stream #0.2(eng): Subtitle: [0][0][0][0] / 0x0000 (default)
    Metadata:
      title           : SDH-Removed
    Stream #0.3(eng): Subtitle: [0][0][0][0] / 0x0000
    Metadata:
      title           : SDH
[22:33:30] dxva2:IDirectXVideoDecoderService_GetDecoderDeviceGuids failed
[22:33:30] dxva2:DxFindVideoServiceConversion failed
[22:33:30] scan: decoding previews for title 1
[22:33:30] scan: audio 0x1: ac3, rate=48000Hz, bitrate=384000 English (AC3) (5.1 ch)
[22:33:31] scan: 10 previews, 1916x1076, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[22:33:31] libhb: scan thread found 1 valid title(s)
# Scan Completed. Setting up the job for encoding ...
# Starting Encode ...
[22:33:32] 1 job(s) to process
[22:33:32] starting job
[22:33:32] NLMeans using SSE2 optimizations
[22:33:32] NLMeans thread started for segment 0
[22:33:32] NLMeans thread started for segment 1
[22:33:32] NLMeans thread started for segment 2
[22:33:32] NLMeans thread started for segment 3
[22:33:32] NLMeans thread started for segment 5
[22:33:32] NLMeans thread started for segment 4
[22:33:32] NLMeans thread started for segment 6
[22:33:32] NLMeans thread started for segment 7
[22:33:32] NLMeans thread started for segment 8
[22:33:32] NLMeans thread started for segment 9
[22:33:32] NLMeans thread started for segment 10
[22:33:32] NLMeans thread started for segment 11
[22:33:32] NLMeans thread started for segment 12
[22:33:32] NLMeans thread started for segment 13
[22:33:32] NLMeans thread started for segment 14
[22:33:32] NLMeans thread started for segment 15
[22:33:32] NLMeans thread started for segment 16
[22:33:32] NLMeans thread started for segment 17
[22:33:32] NLMeans thread started for segment 18
[22:33:32] NLMeans thread started for segment 19
[22:33:32] NLMeans thread started for segment 20
[22:33:32] NLMeans thread started for segment 21
[22:33:32] NLMeans thread started for segment 22
[22:33:32] NLMeans thread started for segment 23
[22:33:32] sync: expecting 62019 video frames
[22:33:32] job configuration:
[22:33:32]  * source
[22:33:32]    + E:\Videos\Test1.mkv
[22:33:32]    + title 1, chapter(s) 1 to 1
[22:33:32]    + container: matroska,webm
[22:33:32]  * destination
[22:33:32]    + E:\Videos\Dest-1.mkv
[22:33:32]    + container: Matroska (libavformat)
[22:33:32]  * video track
[22:33:32]    + decoder: h264
[22:33:32]    + filters
[22:33:32]      + Framerate Shaper (0:27000000:1125000)
[22:33:32]        + frame rate: same as source (around 24.000 fps)
[22:33:32]      + Denoise (nlmeans) (6.000000:0.800000:7:3:2:0:8.000000:0.800000:7:3:2:0)
[22:33:32]      + Crop and Scale (1280:720:0:0:0:0)
[22:33:32]        + source: 1916 * 1076, crop (0/0/0/0): 1916 * 1076, scale: 1280 * 720
[22:33:32]    + Output geometry
[22:33:32]      + storage dimensions: 1280 x 720
[22:33:32]      + pixel aspect ratio: 1 : 1
[22:33:32]      + display dimensions: 1280 x 720
[22:33:32]    + encoder: H.265 (libx265)
[22:33:32]      + preset:  slow
[22:33:32]      + profile: main
[22:33:32]      + quality: 25.00 (RF)
[22:33:32]  * audio track 1
[22:33:32]    + decoder: English (AC3) (5.1 ch) (track 1, id 0x1)
[22:33:32]      + bitrate: 384 kbps, samplerate: 48000 Hz
[22:33:32]    + mixdown: Stereo
[22:33:32]    + dither: triangular
[22:33:32]    + encoder: HE-AAC (libfdk_aac)
[22:33:32]      + bitrate: 48 kbps, samplerate: 48000 Hz
[22:33:32] reader: first SCR 0 id 0x0 DTS 0
x265 [info]: HEVC encoder version 1.4
x265 [info]: build info [Windows][GCC 4.9.0][64 bit] 8bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: WPP streams / frame threads / pool  : 12 / 5 / 24
x265 [info]: CTU size / RQT depth inter / intra  : 64 / 1 / 1
x265 [info]: ME / range / subpel / merge         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut       : 24 / 240 / 40
x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb / refs: 1 / 1 / 0 / 3
x265 [info]: Rate Control / AQ-Strength / CUTree : CRF-25.0 / 1.0 / 1
x265 [info]: tools: rect rd=4 lft sao signhide tmvp 
Last edited by Lazyncoder on Mon Feb 09, 2015 7:08 pm, edited 1 time in total.
mduell
Veteran User
Posts: 8206
Joined: Sat Apr 21, 2007 8:54 pm

Re: using NLMeans instantly cause crashing

Post by mduell »

Encoding log needed.
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: using NLMeans instantly cause crashing

Post by moneymatt4life »

... on win7-64, handbrake didn't crash with either 0.10.1(beta) or svn6886 while using nlmeans...
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

Re: using NLMeans instantly cause crashing

Post by Lazyncoder »

moneymatt4life wrote:... on win7-64, handbrake didn't crash with either 0.10.1(beta) or svn6886 while using nlmeans...
OK I forgot to mention. the issue occurs in both svn6879 and svn6858. and I use x265.
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

Re: using NLMeans instantly cause crashing

Post by Lazyncoder »

mduell wrote:Encoding log needed.
There is nothing to post here. I click on "close the program" and everything will be gone.
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: using NLMeans instantly cause crashing

Post by moneymatt4life »

does the x265 denoiser not produce suitable results? :?
but either way, i can't get handbrake to crash with both nlmeans(medium, film) and x265(veryslow)... so i dunno...
mduell
Veteran User
Posts: 8206
Joined: Sat Apr 21, 2007 8:54 pm

Re: using NLMeans instantly cause crashing

Post by mduell »

Lazyncoder wrote:
mduell wrote:Encoding log needed.
There is nothing to post here. I click on "close the program" and everything will be gone.
Nope - all logs saved to disk, in a well documented location.
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

Re: using NLMeans instantly cause crashing

Post by Lazyncoder »

logs added to the first post.
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

Re: using NLMeans instantly cause crashing

Post by Lazyncoder »

OK since no reply is posted here...
I think so many threads of NLMeans is a little suspicious. this problem only happens on this system, which has, as mentioned above, "logical processor count: 24"
I tried to create same circumstance on my other quad-core PC, with "threads=48" but I guess it doesn't affect on NLMeans.
This is the only thing I can think of.
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

Re: using NLMeans instantly cause crashing

Post by Lazyncoder »

If it helps, new logs from different PC/hardware
Crashes at 00.03%

Code: Select all

HandBrake svn6910 (Nightly Build) - 64bit Version
OS: Microsoft Windows NT 6.2.9200.0 - 64bit
CPU: Intel(R) Xeon(R) CPU E3-1246 v3 @ 3.50GHz
Ram: 32630 MB, 
GPU Information:
  Microsoft Basic Display Adapter - 6.3.9600.16384
Screen: 1024x768
Temp Dir: C:\Users\Administrator\AppData\Local\Temp\2\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\Administrator\AppData\Roaming\HandBrake\HandBrake\0.0.0.6910

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


# Scanning title for encoding ... 
[16:32:25] CPU: Intel(R) Xeon(R) CPU E3-1246 v3 @ 3.50GHz
[16:32:25]  - Intel microarchitecture Haswell
[16:32:25]  - logical processor count: 8
[16:32:25] OpenCL: library not available
[16:32:25] Intel Quick Sync Video support: no
[16:32:25] hb_scan: path=E:\Sample.mkv, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening E:\Sample.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening E:\Sample.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(E:\Sample.mkv) failed
[16:32:25] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[16:32:25] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'E:\Sample.mkv':
  Duration: 00:43:13.28, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1918x1080, PAR 1:1 DAR 959:540, 23.98 fps, 1k tbn, 47.95 tbc (default)
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s (default)
    Stream #0.2: Subtitle: [0][0][0][0] / 0x0000 (default)
[16:32:25] dxva2:IDirectXVideoDecoderService_GetDecoderDeviceGuids failed
[16:32:25] dxva2:DxFindVideoServiceConversion failed
[16:32:25] scan: decoding previews for title 1
[16:32:25] scan: audio 0x1: ac3, rate=48000Hz, bitrate=384000 Unknown (AC3) (5.1 ch)
[16:32:29] scan: 10 previews, 1918x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 1.78:1, PAR 1:1
[16:32:29] libhb: scan thread found 1 valid title(s)
# Scan Completed. Setting up the job for encoding ...
# Starting Encode ...
[16:32:29] 1 job(s) to process
[16:32:29] starting job
[16:32:29] NLMeans using SSE2 optimizations
[16:32:29] NLMeans thread started for segment 0
[16:32:29] NLMeans thread started for segment 1
[16:32:29] NLMeans thread started for segment 2
[16:32:29] NLMeans thread started for segment 3
[16:32:29] NLMeans thread started for segment 4
[16:32:29] NLMeans thread started for segment 5
[16:32:29] NLMeans thread started for segment 6
[16:32:29] NLMeans thread started for segment 7
[16:32:29] sync: expecting 62176 video frames
[16:32:29] job configuration:
[16:32:29]  * source
[16:32:29]    + E:\Sample.mkv
[16:32:29]    + title 1, chapter(s) 1 to 1
[16:32:29]    + container: matroska,webm
[16:32:29]  * destination
[16:32:29]    + E:\Dest-1.mkv
[16:32:29]    + container: Matroska (libavformat)
[16:32:29]  * video track
[16:32:29]    + decoder: h264
[16:32:29]    + filters
[16:32:29]      + Framerate Shaper (0:27000000:1126125)
[16:32:29]        + frame rate: same as source (around 23.976 fps)
[16:32:29]      + Denoise (nlmeans) (8.000000:0.600000:7:3:2:0:10.000000:0.600000:7:3:2:0)
[16:32:29]      + Crop and Scale (1280:720:0:0:0:0)
[16:32:29]        + source: 1918 * 1080, crop (0/0/0/0): 1918 * 1080, scale: 1280 * 720
[16:32:29]    + Output geometry
[16:32:29]      + storage dimensions: 1280 x 720
[16:32:29]      + pixel aspect ratio: 1 : 1
[16:32:29]      + display dimensions: 1280 x 720
[16:32:29]    + encoder: H.265 (libx265)
[16:32:29]      + preset:  slow
[16:32:29]      + options: aq-mode=2:aq-strength=1.0
[16:32:29]      + profile: main
[16:32:29]      + quality: 25.00 (RF)
[16:32:29]  * audio track 1
[16:32:29]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 0x1)
[16:32:29]      + bitrate: 384 kbps, samplerate: 48000 Hz
[16:32:29]    + mixdown: Stereo
[16:32:29]    + dither: triangular
[16:32:29]    + encoder: HE-AAC (libfdk_aac)
[16:32:29]      + bitrate: 48 kbps, samplerate: 48000 Hz
[16:32:29] reader: first SCR 0 id 0x0 DTS 0
x265 [info]: HEVC encoder version 1.5
x265 [info]: build info [Windows][GCC 4.9.0][64 bit] 8bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: WPP streams / frame threads / pool  : 12 / 3 / 8
x265 [info]: CTU size / RQT depth inter / intra  : 64 / 1 / 1
x265 [info]: ME / range / subpel / merge         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut       : 24 / 240 / 40
x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb / refs: 1 / 1 / 0 / 3
x265 [info]: Rate Control / AQ-Strength / CUTree : CRF-25.0 / 1.0 / 1
x265 [info]: tools: rect rd=4 psy-rd=0.30 psy-rdoq=1.00 deblock sao signhide tmvp 
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: using NLMeans instantly cause crashing

Post by moneymatt4life »

... you're using strong/film right?
well either way, i still can't get it to crash even when using (at least trying to) the same settings as your log... :?
Deleted User 11865

Re: using NLMeans instantly cause crashing

Post by Deleted User 11865 »

The joys of writing assembly would be my guess…
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: using NLMeans instantly cause crashing

Post by JohnAStebbins »

I was able to reproduce this after a little fiddling. For some reason it is not reproducible from a DVD iso. But seems easy to produce from an mkv. I also tried other settings variations to see if it corresponded with anything in particular. E.g. hevc vs. avc vs. mpeg2 encoding, he-aac vs passthru encoding, h.264 decode vs. mpeg2 decode, etc. The only common thread seems to be libavformat demux with nlmeans filter which is strange.

But anyway, it's crashing at line 108 in nlmeans_x86.c

Code: Select all

            _mm_store_si128((__m128i*)(out),    lldiff); // Store low  diff low  in memory
Perhaps fpu state is not being preserved and restored properly. Not really something I'm expert in.
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: using NLMeans instantly cause crashing

Post by moneymatt4life »

... i was testing from iso/m2ts (^^',) but yeah, now testing from an mkv, i can get it to crash...
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: using NLMeans instantly cause crashing

Post by JohnAStebbins »

Hahaha, this has nothing to do with the demuxer. The key is the source width. 720 works (as does 1920). 718 does not. Probably something to do with how integral_stride is being calculated.
moneymatt4life
Veteran User
Posts: 440
Joined: Fri Mar 09, 2012 5:26 am

Re: using NLMeans instantly cause crashing

Post by moneymatt4life »

... after a few crashes(at various resolutions 720x480/718x480/720x364/1920x1080), i can't get it to crash anymore... i noticed the log saying

Code: Select all

x265 [error]: unknown profile <auto>
Failure to initialise thread 'H.265/HEVC encoder (libx265)'
Failure to initialise thread 'H.265/HEVC encoder (libx265)'
so i set it main again, not sure how it got set to auto... not relevant to Lazy's problem though, since they've set it to main...
now i'm back to not having it crash anymore :? even on mkvs and resolution at 718x480...
Deleted User 11865

Re: using NLMeans instantly cause crashing

Post by Deleted User 11865 »

moneymatt4life wrote:... after a few crashes(at various resolutions 720x480/718x480/720x364/1920x1080), i can't get it to crash anymore... i noticed the log saying

Code: Select all

x265 [error]: unknown profile <auto>
Failure to initialise thread 'H.265/HEVC encoder (libx265)'
Failure to initialise thread 'H.265/HEVC encoder (libx265)'
so i set it main again, not sure how it got set to auto... not relevant to Lazy's problem though, since they've set it to main...
My bug, will fix.
Deleted User 11865

Re: using NLMeans instantly cause crashing

Post by Deleted User 11865 »

Rodeo wrote:
moneymatt4life wrote:... after a few crashes(at various resolutions 720x480/718x480/720x364/1920x1080), i can't get it to crash anymore... i noticed the log saying

Code: Select all

x265 [error]: unknown profile <auto>
Failure to initialise thread 'H.265/HEVC encoder (libx265)'
Failure to initialise thread 'H.265/HEVC encoder (libx265)'
so i set it main again, not sure how it got set to auto... not relevant to Lazy's problem though, since they've set it to main...
My bug, will fix.
https://trac.handbrake.fr/changeset/6913
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: using NLMeans instantly cause crashing

Post by BradleyS »

NLMeans crash fixed in https://trac.handbrake.fr/changeset/6915

My fault for not testing mod < 16 sources when implementing the accelerated code. Thank you for reporting this Lazyncoder.
Post Reply