norihiro / obs-face-tracker

Face tracking plugin for OBS Studio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash (with logs)

BryanCrotaz opened this issue · comments

commented

Running on laptop with face tracker as filter on internal webcam. In the process the webcam seems to have been left in an invalid state - after restarting OBS the webcam source is black.

Crash 2022-01-12 09-56-57.txt

When the crash happened, just after adding the filter, after several seconds or minutes?
How often the crash happens?
Could you provide a last log just after the crash happened?

commented

It's crashed several times, probably always within 5 minutes of setting the filter up, not noticeably related to me changing any parameters. Having built this type of video processing before I'd guess there's an unhandled exception in a thread. I'd be happy to run an instrumented version with exception logging at the root of every thread. My C++ skills aren't up to providing a PR for this I'm afraid.

commented

Some possibly related logs:

10:16:58.346: [Media Source 'Media Source']: settings:
10:16:58.346: 	input:                   C:/Users/bgcro/OneDrive/Pictures/Dentanomics/elevationsshort.mp4
10:16:58.346: 	input_format:            (null)
10:16:58.346: 	speed:                   100
10:16:58.346: 	is_looping:              no
10:16:58.346: 	is_linear_alpha:         no
10:16:58.346: 	is_hw_decoding:          no
10:16:58.346: 	is_clear_on_media_end:   yes
10:16:58.346: 	restart_on_activate:     yes
10:16:58.346: 	close_when_inactive:     no
10:16:58.350: [Media Source 'Media Source 2']: settings:
10:16:58.350: 	input:                   C:/Users/bgcro/OneDrive/Pictures/Dentanomics/Luxation Matthew short.mp4
10:16:58.350: 	input_format:            (null)
10:16:58.350: 	speed:                   100
10:16:58.350: 	is_looping:              no
10:16:58.350: 	is_linear_alpha:         no
10:16:58.350: 	is_hw_decoding:          no
10:16:58.350: 	is_clear_on_media_end:   yes
10:16:58.350: 	restart_on_activate:     yes
10:16:58.350: 	close_when_inactive:     no
10:16:58.455: [obs-face-tracker] face_detector_base: starting the thread.
10:16:58.590: warning: deprecated pixel format used, make sure you did set range correctly
commented

a crash occurred after this run

09:50:43.676: [DShow Device: 'Video Capture Device'] settings updated: 
09:50:43.676: 	video device: Integrated Camera
09:50:43.676: 	video path: \\?\usb#vid_04f2&pid_b61e&mi_00#6&10400b6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
09:50:43.676: 	resolution: 1280x720
09:50:43.676: 	flip: 0
09:50:43.676: 	fps: 30.00 (interval: 333333)
09:50:43.676: 	format: YUY2
09:51:05.310: User switched to scene 'Powerpoint'
09:51:19.938: Video Capture Device: ResolutionValid failed
09:51:19.938: Video Capture Device: Video configuration failed
09:51:27.691: ---------------------------------
09:51:27.691: [DShow Device: 'Video Capture Device'] settings updated: 
09:51:27.691: 	video device: Integrated Camera
09:51:27.691: 	video path: \\?\usb#vid_04f2&pid_b61e&mi_00#6&10400b6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
09:51:27.691: 	resolution: 1280x720
09:51:27.691: 	flip: 0
09:51:27.691: 	fps: 30.00 (interval: 333333)
09:51:27.691: 	format: YUY2
09:51:43.502: [obs-face-tracker] face_tracker_base: starting a new thread.
09:51:43.702: [obs-face-tracker] face_tracker_base: starting a new thread.
09:52:04.842: ---------------------------------
09:52:04.842: [DShow Device: 'Video Capture Device'] settings updated: 
09:52:04.842: 	video device: Integrated Camera
09:52:04.842: 	video path: \\?\usb#vid_04f2&pid_b61e&mi_00#6&10400b6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
09:52:04.842: 	resolution: 1280x720
09:52:04.842: 	flip: 0
09:52:04.842: 	fps: 30.00 (interval: 333333)
09:52:04.842: 	format: YUY2
09:52:12.587: ---------------------------------
09:52:12.587: [DShow Device: 'Video Capture Device'] settings updated: 
09:52:12.587: 	video device: Integrated Camera
09:52:12.587: 	video path: \\?\usb#vid_04f2&pid_b61e&mi_00#6&10400b6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
09:52:12.587: 	resolution: 1280x720
09:52:12.587: 	flip: 0
09:52:12.587: 	fps: 30.00 (interval: 333333)
09:52:12.587: 	format: YUY2
09:52:13.795: ---------------------------------
09:52:13.795: [DShow Device: 'Video Capture Device'] settings updated: 
09:52:13.795: 	video device: Integrated Camera
09:52:13.795: 	video path: \\?\usb#vid_04f2&pid_b61e&mi_00#6&10400b6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
09:52:13.795: 	resolution: 1280x720
09:52:13.795: 	flip: 0
09:52:13.795: 	fps: 30.00 (interval: 333333)
09:52:13.795: 	format: YUY2
09:53:12.260: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:53:14.381: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:55:55.579: [window-capture: 'Window Capture'] update settings:
09:55:55.579: 	executable: blender.exe
09:55:55.579: 	method selected: Automatic
09:55:55.579: 	method chosen: BitBlt
09:55:55.579: 
09:56:30.598: [obs-face-tracker] face_tracker_base: starting a new thread.
09:56:35.340: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
commented

Possibly starting multiple threads to do the same thing?

08:39:06.316: ------------------------------------------------
08:39:07.036: [obs-websocket] server started successfully on port 4444
08:39:07.036: [obs-websocket] io thread started
08:39:30.517: ---------------------------------
08:39:30.517: video settings reset:
08:39:30.517: 	base resolution:   1920x1080
08:39:30.517: 	output resolution: 1280x720
08:39:30.517: 	downscale filter:  Bicubic
08:39:30.517: 	fps:               30/1
08:39:30.517: 	format:            NV12
08:39:30.517: 	YUV mode:          709/Partial
08:39:30.518: NV12 texture support not available
08:39:30.542: Audio monitoring device:
08:39:30.542: 	name: Default
08:39:30.542: 	id: default
08:39:30.542: Created profile 'Video Conference' (clean, Video_Conference)
08:39:30.542: ------------------------------------------------
08:39:41.609: ---------------------------------
08:39:41.609: video settings reset:
08:39:41.609: 	base resolution:   1920x1080
08:39:41.609: 	output resolution: 1920x1080
08:39:41.609: 	downscale filter:  Bicubic
08:39:41.609: 	fps:               30/1
08:39:41.609: 	format:            NV12
08:39:41.609: 	YUV mode:          709/Partial
08:39:41.609: NV12 texture support not available
08:40:03.922: ---------------------------------
08:40:03.923: video settings reset:
08:40:03.923: 	base resolution:   1920x1080
08:40:03.923: 	output resolution: 1280x720
08:40:03.923: 	downscale filter:  Bicubic
08:40:03.923: 	fps:               30/1
08:40:03.923: 	format:            NV12
08:40:03.923: 	YUV mode:          709/Partial
08:40:03.923: NV12 texture support not available
08:40:03.931: Audio monitoring device:
08:40:03.931: 	name: Default
08:40:03.931: 	id: default
08:40:03.982: Switched to profile 'Untitled' (Untitled)
08:40:03.982: ------------------------------------------------
08:40:06.878: ---------------------------------
08:40:06.878: video settings reset:
08:40:06.878: 	base resolution:   1920x1080
08:40:06.878: 	output resolution: 1920x1080
08:40:06.878: 	downscale filter:  Bicubic
08:40:06.878: 	fps:               30/1
08:40:06.878: 	format:            NV12
08:40:06.878: 	YUV mode:          709/Partial
08:40:06.878: NV12 texture support not available
08:40:06.884: Audio monitoring device:
08:40:06.884: 	name: Default
08:40:06.884: 	id: default
08:40:06.915: Switched to profile 'Video Conference' (Video_Conference)
08:40:06.915: ------------------------------------------------
08:40:31.418: User added scene 'Powerpoint'
08:40:31.436: User switched to scene 'Powerpoint'
08:40:48.538: User added source 'Video Capture Device' (dshow_input) to scene 'Powerpoint'
08:40:48.592: Video Capture Device: DecodeDeviceId failed
08:40:48.592: Video Capture Device: Video configuration failed
08:40:54.909: ---------------------------------
08:40:54.909: [DShow Device: 'Video Capture Device'] settings updated: 
08:40:54.909: 	video device: NewTek NDI Video
08:40:54.909: 	video path: \\?\root#media#0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\vidsource0
08:40:54.909: 	resolution: 1920x1080
08:40:54.909: 	flip: 0
08:40:54.909: 	fps: 29.97 (interval: 333667)
08:40:54.909: 	format: YUY2
08:40:56.633: ---------------------------------
08:40:56.634: [DShow Device: 'Video Capture Device'] settings updated: 
08:40:56.634: 	video device: NewTek NDI Video
08:40:56.634: 	video path: \\?\root#media#0001#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\vidsource0
08:40:56.634: 	resolution: 1920x1080
08:40:56.634: 	flip: 0
08:40:56.634: 	fps: 29.97 (interval: 333667)
08:40:56.634: 	format: YUY2
08:40:59.640: ---------------------------------
08:40:59.640: [DShow Device: 'Video Capture Device'] settings updated: 
08:40:59.640: 	video device: Integrated Camera
08:40:59.640: 	video path: \\?\usb#vid_04f2&pid_b61e&mi_00#6&10400b6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
08:40:59.640: 	resolution: 1280x720
08:40:59.640: 	flip: 0
08:40:59.640: 	fps: 30.00 (interval: 333333)
08:40:59.640: 	format: YUY2
08:41:15.985: [obs-face-tracker] face_detector_base: starting the thread.
08:41:16.299: User added source 'Face Tracker' (face_tracker_source) to scene 'Powerpoint'
08:41:16.797: [obs-face-tracker] fts_tick: target=0000023CD2977140
08:41:36.357: [obs-face-tracker] ftf_preset_load: loading preset 
08:41:36.358: [obs-face-tracker] ftf_preset_load: preset  does not exist
08:42:30.029: adding 21 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)
08:42:30.029: 
08:42:42.922: [obs-face-tracker] ftf_preset_load: loading preset 
08:42:42.922: [obs-face-tracker] ftf_preset_load: preset  does not exist
08:43:22.379: [obs-face-tracker] fts_tick: target=0000023CD2C87680
08:43:23.009: [obs-face-tracker] face_tracker_base: starting a new thread.
08:43:24.738: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
08:43:25.151: [obs-face-tracker] face_tracker_base: starting a new thread.
08:43:26.583: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
08:43:27.328: [obs-face-tracker] face_tracker_base: starting a new thread.
08:43:30.168: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
08:47:08.580: [obs-face-tracker] face_tracker_base: starting a new thread.
08:47:11.690: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
08:47:48.641: adding 64 milliseconds of audio buffering, total audio buffering is now 106 milliseconds (source: Mic/Aux)
08:47:48.641: 
08:50:15.813: User added filter 'Image Mask/Blend' (mask_filter_v2) to source 'Face Tracker'
08:50:38.170: User removed filter 'Image Mask/Blend' (mask_filter_v2) from source 'Face Tracker'
08:59:18.854: User added filter 'Image Mask/Blend' (mask_filter_v2) to source 'Face Tracker'
09:01:18.874: warning: deprecated pixel format used, make sure you did set range correctly
09:01:19.278: warning: deprecated pixel format used, make sure you did set range correctly
09:01:27.593: warning: deprecated pixel format used, make sure you did set range correctly
09:04:15.400: [obs-face-tracker] ftf_preset_load: loading preset 
09:04:15.401: [obs-face-tracker] ftf_preset_load: preset  does not exist
09:04:46.231: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:04:50.196: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:07:06.180: User Removed source 'Face Tracker' (face_tracker_source) from scene 'Powerpoint'
09:07:06.203: [obs-face-tracker] face_tracker_base: joining the thread...
09:07:06.210: [obs-face-tracker] face_tracker_base: joined the thread.
09:07:06.314: [obs-face-tracker] face_tracker_base: joining the thread...
09:07:06.316: [obs-face-tracker] face_tracker_base: joined the thread.
09:07:06.356: [obs-face-tracker] face_tracker_base: joining the thread...
09:07:06.365: [obs-face-tracker] face_tracker_base: joined the thread.
09:07:06.448: [obs-face-tracker] face_tracker_base: joining the thread...
09:07:06.450: [obs-face-tracker] face_tracker_base: joined the thread.
09:07:06.542: [obs-face-tracker] face_detector_base: stopping the thread...
09:07:07.004: [obs-face-tracker] face_detector_base: stopped the thread...
09:07:18.342: [obs-face-tracker] face_detector_base: starting the thread.
09:07:18.343: User added filter 'Face Tracker PTZ' (face_tracker_ptz) to source 'Video Capture Device'
09:07:18.374: [obs-face-tracker] received frame format=4
09:07:23.771: [obs-face-tracker] ftf_preset_load: loading preset 
09:07:23.771: [obs-face-tracker] ftf_preset_load: preset  does not exist
09:07:28.244: [obs-face-tracker] face_tracker_base: starting a new thread.
09:07:28.682: [obs-face-tracker] face_tracker_base: starting a new thread.
09:07:30.857: [obs-face-tracker] face_tracker_base: starting a new thread.
09:07:31.748: [obs-face-tracker] ftf_preset_load: loading preset 
09:07:31.748: [obs-face-tracker] ftf_preset_load: preset  does not exist
09:07:33.146: [obs-face-tracker] face_tracker_base: starting a new thread.
09:07:35.585: [obs-face-tracker] face_tracker_base: starting a new thread.
09:07:42.251: [obs-face-tracker] ftf_preset_load: loading preset 
09:07:42.251: [obs-face-tracker] ftf_preset_load: preset  does not exist
09:08:00.136: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:08:03.278: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:08:05.953: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:08:08.124: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:08:09.200: [obs-face-tracker] loading file ../../data/obs-plugins/obs-face-tracker/shape_predictor_5_face_landmarks.dat
09:08:32.549: ---------------------------------
09:08:32.550: [DShow Device: 'Video Capture Device'] settings updated: 
09:08:32.550: 	video device: Integrated Camera
09:08:32.550: 	video path: \\?\usb#vid_04f2&pid_b61e&mi_00#6&10400b6&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
09:08:32.550: 	resolution: 1280x720
09:08:32.550: 	flip: 0
09:08:32.550: 	fps: 30.00 (interval: 333333)
09:08:32.550: 	format: YUY2
09:08:52.604: User removed filter 'Face Tracker PTZ' (face_tracker_ptz) from source 'Video Capture Device'
09:08:52.604: [obs-face-tracker] face_tracker_base: joining the thread...
09:08:52.605: [obs-face-tracker] face_tracker_base: joined the thread.
09:08:52.657: [obs-face-tracker] face_tracker_base: joining the thread...
09:08:52.658: [obs-face-tracker] face_tracker_base: joined the thread.
09:08:52.705: [obs-face-tracker] face_tracker_base: joining the thread...
09:08:52.705: [obs-face-tracker] face_tracker_base: joined the thread.
09:08:52.764: [obs-face-tracker] face_tracker_base: joining the thread...
09:08:52.765: [obs-face-tracker] face_tracker_base: joined the thread.
09:08:52.874: [obs-face-tracker] face_tracker_base: joining the thread...
09:08:52.875: [obs-face-tracker] face_tracker_base: joined the thread.
09:08:52.944: [obs-face-tracker] face_detector_base: stopping the thread...
09:08:52.945: [obs-face-tracker] face_detector_base: stopped the thread...
09:09:01.219: [obs-face-tracker] face_detector_base: starting the thread.
09:09:01.219: User added filter 'Face Tracker' (face_tracker_filter) to source 'Video Capture Device'
09:09:04.863: [obs-face-tracker] ftf_preset_load: loading preset 
09:09:04.863: [obs-face-tracker] ftf_preset_load: preset  does not exist
09:09:10.574: [obs-face-tracker] face_tracker_base: starting a new thread.
09:09:10.888: [obs-face-tracker] face_tracker_base: starting a new thread.
09:09:12.873: [obs-face-tracker] face_tracker_base: starting a new thread.
09:09:15.086: [obs-face-tracker] face_tracker_base: starting a new thread.
09:09:17.089: [obs-face-tracker] face_tracker_base: starting a new thread.
09:09:19.226: [obs-face-tracker] face_tracker_base: starting a new thread.
commented

Could it be the assert at the start of transform_image? If that assert fails, would it log the message?

I will add try {} catch (...) {} blocks in the code.

10:16:58.590: warning: deprecated pixel format used, make sure you did set range correctly

This message came from libswscale in FFmpeg. Maybe, OBS Studio call something.

Possibly starting multiple threads to do the same thing?

There are multiple threads but not intended to do the same thing.
Usually two correlation trackers (face_tracker_base in the log) will be generated for each face.
One tracker is configured with a new detected face and preparing to start correlation tracking.
The other tracker is running correlation tracking to return the location of the face and landmarks.

The assertions in dlib is enabled. Also added try catch blocks and some invalid-data checks.
Could you try this build?
https://dev.azure.com/norihiro0169/obs-plugintemplate/_build/results?buildId=1153&view=artifacts&pathAsName=false
(I think you need to login with Github account or Microsoft account.)