View Issue Details

IDProjectCategoryView StatusLast Update
0001112OBS-StudioMedia Sourcepublic2019-04-16 02:58
ReporterAdamJAssigned To 
PrioritynoneSeverityminorReproducibilityalways
Status confirmedResolutionopen 
PlatformOBS StudioOSWindowsOS Version10
Product Version20.1.3 
Target VersionFixed in Version 
Summary0001112: rtsp source (Samsung IP camera) hangs after successfully starting recording on versions above 20.0.1
DescriptionEvery time I upgrade to a version above 20.0.1, the media sources which are multiple different Samsung smartcams (connected by IP - rtsp://USER:PASSWORD@XXX.XXX.XXX.XXX:554/onvif/profile4/media.smp), will start recording or streaming as normal. After 10+ minutes, the image in the preview and the recorded video stays still and freeze. This happens on different machines using different Samsung smartcams
Steps To ReproduceAdd media source using rtsp connection with IP address of camera - (rtsp://USER:PASSWORD@XXX.XXX.XXX.XXX:554/onvif/profile4/media.smp)

Start recording and leave the recording to run until the frozen image appears and is also reflected in the recorded file. (Usually after 10 mins of recording)
Additional InformationLog File

18:16:46.206: CPU Name: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
18:16:46.206: CPU Speed: 3093MHz
18:16:46.206: Physical Cores: 4, Logical Cores: 4
18:16:46.206: Physical Memory: 3983MB Total, 2195MB Free
18:16:46.206: Windows Version: 10.0 Build 16299 (revision: 192; 64-bit)
18:16:46.206: Running as administrator: false
18:16:46.206: Aero is Enabled (Aero is always on for windows 8 and above)
18:16:46.206: Windows 10 Gaming Features:
18:16:46.206: Game Bar: Off
18:16:46.206: Game DVR Allowed: Yes
18:16:46.206: Game DVR: On
18:16:46.206: Game DVR Background Recording: Off
18:16:46.224: Game Mode: Off
18:16:46.224: Portable mode: false
18:16:46.338: OBS 20.1.3 (64bit, windows)
18:16:46.338: ---------------------------------
18:16:46.360: ---------------------------------
18:16:46.360: audio settings reset:
18:16:46.360: samples per sec: 44100
18:16:46.360: speakers: 2
18:16:46.406: ---------------------------------
18:16:46.406: Initializing D3D11...
18:16:46.406: Available Video Adapters:
18:16:46.408: Adapter 1: Intel(R) HD Graphics
18:16:46.408: Dedicated VRAM: 33554432
18:16:46.408: Shared VRAM: 1711276032
18:16:46.408: output 1: pos={0, 0}, size={1280, 1024}, attached=true
18:16:46.503: Loading up D3D11 on adapter Intel(R) HD Graphics (0)
18:16:46.510: D3D11 loaded successfully, feature level used: 41216
18:16:47.622: ---------------------------------
18:16:47.623: video settings reset:
18:16:47.623: base resolution: 1280x720
18:16:47.623: output resolution: 1280x720
18:16:47.623: downscale filter: Bicubic
18:16:47.623: fps: 30/1
18:16:47.623: format: NV12
18:16:47.623: Audio monitoring device:
18:16:47.623: name: Default
18:16:47.623: id: default
18:16:47.623: ---------------------------------
18:16:47.670: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded
18:16:47.843: [AMF] Encountered Exception during AMF initialization: Unable to load 'amfrt64.dll', error code 126.
18:16:47.843: Failed to initialize module 'enc-amf.dll'
18:16:48.467: LoadLibrary failed for 'nvEncodeAPI64.dll': The specified module could not be found.
18:16:48.467: (126)
18:16:49.530: Couldn't find VLC installation, VLC video source disabled
18:16:49.639: No blackmagic support
18:16:50.388: ---------------------------------
18:16:50.388: Loaded Modules:
18:16:50.388: win-wasapi.dll
18:16:50.388: win-mf.dll
18:16:50.388: win-dshow.dll
18:16:50.388: win-decklink.dll
18:16:50.388: win-capture.dll
18:16:50.388: vlc-video.dll
18:16:50.388: text-freetype2.dll
18:16:50.388: rtmp-services.dll
18:16:50.388: obs-x264.dll
18:16:50.388: obs-vst.dll
18:16:50.388: obs-transitions.dll
18:16:50.388: obs-text.dll
18:16:50.388: obs-qsv11.dll
18:16:50.388: obs-outputs.dll
18:16:50.388: obs-filters.dll
18:16:50.388: obs-ffmpeg.dll
18:16:50.388: image-source.dll
18:16:50.388: frontend-tools.dll
18:16:50.388: enc-amf.dll
18:16:50.388: coreaudio-encoder.dll
18:16:50.388: ---------------------------------
18:16:50.388: ==== Startup complete ===============================================
18:16:50.393: All scene data cleared
18:16:50.393: ------------------------------------------------
18:16:50.506: WASAPI: Device 'Line In (Realtek High Definition Audio)' initialized
18:16:50.506: [Media Source 'Fire Camera']: settings:
18:16:50.506: input: rtsp://USER:PASS@XXX.XXX.XXX.XXX:554/onvif/profile4/media.smp ****IP and credentials hidden for security****
18:16:50.506: input_format:
18:16:50.506: is_looping: no
18:16:50.506: is_hw_decoding: yes
18:16:50.506: is_clear_on_media_end: no
18:16:50.506: restart_on_activate: no
18:16:50.506: close_when_inactive: yes
18:16:50.509: Switched to scene 'Fire'
18:16:50.509: ------------------------------------------------
18:16:50.509: Loaded scenes:
18:16:50.509: - scene 'Fire':
18:16:50.509: - source: 'Fire Camera' (ffmpeg_source)
18:16:50.509: ------------------------------------------------
18:16:52.664: adding 23 milliseconds of audio buffering, total audio buffering is now 23 milliseconds
18:16:53.797: ---------------------------------
18:16:53.797: [x264 encoder: 'recording_h264'] preset: veryfast
18:16:53.797: [x264 encoder: 'recording_h264'] profile: high
18:16:53.797: [x264 encoder: 'recording_h264'] settings:
18:16:53.797: rate_control: CBR
18:16:53.797: bitrate: 2500
18:16:53.797: buffer size: 2500
18:16:53.797: crf: 0
18:16:53.797: fps_num: 30
18:16:53.797: fps_den: 1
18:16:53.797: width: 1280
18:16:53.797: height: 720
18:16:53.797: keyint: 250
18:16:53.797:
18:16:53.812: [Media Foundation AAC: 'Track1']: encoder created
18:16:53.812: bitrate: 160
18:16:53.812: channels: 2
18:16:53.812: sample rate: 44100
18:16:53.812: bits-per-sample: 16
18:16:53.812:
18:16:53.826: ==== Recording Start ===============================================
18:16:53.826: [ffmpeg muxer: 'adv_file_output'] Writing file 'C:/Users/enginerooms/Desktop/Recordings/2018-01-16 18-16-53.mp4'...
20:04:10.151: [ffmpeg muxer: 'adv_file_output'] Output of file 'C:/Users/enginerooms/Desktop/Recordings/2018-01-16 18-16-53.mp4' stopped
20:04:10.152: Output 'adv_file_output': stopping
20:04:10.152: Output 'adv_file_output': Total frames output: 193045
20:04:10.152: Output 'adv_file_output': Total drawn frames: 193089
20:04:10.154: Video stopped, number of skipped frames due to encoding lag: 9/193074 (0.0%)
20:04:10.209: ==== Recording Stop ================================================
20:04:21.345: ==== Shutting down ==================================================
20:04:21.389: Switched to scene '(null)'
20:04:21.445: WASAPI: Device 'Line In (Realtek High Definition Audio)' Terminated
20:04:21.451: All scene data cleared
20:04:21.451: ------------------------------------------------
20:04:21.827: Freeing OBS context data
20:04:22.141: == Profiler Results =============================
20:04:22.141: run_program_init: 4568.73 ms
20:04:22.141: ┣OBSApp::AppInit: 27.525 ms
20:04:22.141: ┃ ┗OBSApp::InitLocale: 5.205 ms
20:04:22.141: ┗OBSApp::OBSInit: 4437.86 ms
20:04:22.141: ┣obs_startup: 20.783 ms
20:04:22.141: ┗OBSBasic::OBSInit: 4264.03 ms
20:04:22.141: ┣OBSBasic::InitBasicConfig: 0.925 ms
20:04:22.141: ┣OBSBasic::ResetAudio: 0.151 ms
20:04:22.141: ┣OBSBasic::ResetVideo: 1262.51 ms
20:04:22.141: ┣OBSBasic::InitOBSCallbacks: 0.005 ms
20:04:22.141: ┣OBSBasic::InitHotkeys: 0.044 ms
20:04:22.141: ┣obs_load_all_modules: 2764.52 ms
20:04:22.141: ┃ ┣obs_init_module(coreaudio-encoder.dll): 2.147 ms
20:04:22.141: ┃ ┣obs_init_module(enc-amf.dll): 29.798 ms
20:04:22.141: ┃ ┣obs_init_module(frontend-tools.dll): 2.414 ms
20:04:22.141: ┃ ┣obs_init_module(image-source.dll): 0.024 ms
20:04:22.141: ┃ ┣obs_init_module(obs-ffmpeg.dll): 2.113 ms
20:04:22.141: ┃ ┣obs_init_module(obs-filters.dll): 0.046 ms
20:04:22.142: ┃ ┣obs_init_module(obs-outputs.dll): 0.024 ms
20:04:22.142: ┃ ┣obs_init_module(obs-qsv11.dll): 359.134 ms
20:04:22.142: ┃ ┣obs_init_module(obs-text.dll): 0.657 ms
20:04:22.142: ┃ ┣obs_init_module(obs-transitions.dll): 0.015 ms
20:04:22.142: ┃ ┣obs_init_module(obs-vst.dll): 0.003 ms
20:04:22.142: ┃ ┣obs_init_module(obs-x264.dll): 0.002 ms
20:04:22.142: ┃ ┣obs_init_module(rtmp-services.dll): 13.866 ms
20:04:22.142: ┃ ┣obs_init_module(text-freetype2.dll): 0.385 ms
20:04:22.142: ┃ ┣obs_init_module(vlc-video.dll): 0.115 ms
20:04:22.142: ┃ ┣obs_init_module(win-capture.dll): 0.298 ms
20:04:22.142: ┃ ┣obs_init_module(win-decklink.dll): 1.125 ms
20:04:22.142: ┃ ┣obs_init_module(win-dshow.dll): 104.052 ms
20:04:22.142: ┃ ┣obs_init_module(win-mf.dll): 47.741 ms
20:04:22.142: ┃ ┣obs_init_module(win-wasapi.dll): 0.015 ms
20:04:22.142: ┃ ┗reset_win32_symbol_paths: 1.989 ms
20:04:22.142: ┣OBSBasic::ResetOutputs: 1.52 ms
20:04:22.142: ┣OBSBasic::CreateHotkeys: 0.068 ms
20:04:22.142: ┣OBSBasic::InitService: 0.643 ms
20:04:22.142: ┣OBSBasic::InitPrimitives: 0.77 ms
20:04:22.142: ┗OBSBasic::Load: 118.549 ms
20:04:22.142: obs_hotkey_thread(25 ms): min=0.004 ms, median=0.01 ms, max=1.971 ms, 99th percentile=0.073 ms, 100% below 25 ms
20:04:22.142: audio_thread(Audio): min=0 ms, median=0.396 ms, max=613.365 ms, 99th percentile=0.929 ms
20:04:22.154: ┗receive_audio: min=0.002 ms, median=0.33 ms, max=613.299 ms, 99th percentile=0.826 ms
20:04:22.154: ┣buffer_audio: min=0 ms, median=0.001 ms, max=0.138 ms, 99th percentile=0.004 ms
20:04:22.154: ┗do_encode: min=0.183 ms, median=0.325 ms, max=613.293 ms, 99th percentile=0.819 ms
20:04:22.154: ┗encode(Track1): min=0.167 ms, median=0.253 ms, max=1.072 ms, 99th percentile=0.75 ms
20:04:22.154: obs_graphics_thread(33.3333 ms): min=0.548 ms, median=1.408 ms, max=65.668 ms, 99th percentile=2.944 ms, 99.9985% below 33.333 ms
20:04:22.154: ┣tick_sources: min=0.001 ms, median=0.007 ms, max=2.176 ms, 99th percentile=0.013 ms
20:04:22.154: ┣render_displays: min=0.001 ms, median=0.566 ms, max=64.71 ms, 99th percentile=1.761 ms
20:04:22.154: ┗output_frame: min=0.426 ms, median=0.822 ms, max=19.304 ms, 99th percentile=1.269 ms
20:04:22.154: ┣gs_context(video->graphics): min=0.231 ms, median=0.396 ms, max=19.303 ms, 99th percentile=0.717 ms
20:04:22.154: ┃ ┣render_video: min=0.129 ms, median=0.245 ms, max=18.092 ms, 99th percentile=0.472 ms
20:04:22.154: ┃ ┃ ┣render_main_texture: min=0.004 ms, median=0.087 ms, max=0.664 ms, 99th percentile=0.218 ms
20:04:22.154: ┃ ┃ ┣render_output_texture: min=0.003 ms, median=0.056 ms, max=0.41 ms, 99th percentile=0.121 ms
20:04:22.154: ┃ ┃ ┣render_convert_texture: min=0.001 ms, median=0.053 ms, max=0.265 ms, 99th percentile=0.106 ms
20:04:22.154: ┃ ┃ ┗stage_output_texture: min=0 ms, median=0.045 ms, max=17.89 ms, 99th percentile=0.079 ms
20:04:22.154: ┃ ┣download_frame: min=0 ms, median=0.01 ms, max=3.993 ms, 99th percentile=0.016 ms
20:04:22.154: ┃ ┗gs_flush: min=0.089 ms, median=0.139 ms, max=1.881 ms, 99th percentile=0.234 ms
20:04:22.155: ┗output_video_data: min=0.002 ms, median=0.434 ms, max=14.179 ms, 99th percentile=0.597 ms
20:04:22.155: video_thread(video): min=0 ms, median=1.034 ms, max=594.307 ms, 99th percentile=1.535 ms
20:04:22.155: ┗receive_video: min=0 ms, median=1.032 ms, max=594.304 ms, 99th percentile=1.531 ms
20:04:22.155: ┗do_encode: min=0.728 ms, median=1.031 ms, max=594.302 ms, 99th percentile=1.529 ms
20:04:22.155: ┗encode(recording_h264): min=0.691 ms, median=0.984 ms, max=17.628 ms, 99th percentile=1.466 ms
20:04:22.155: =================================================
20:04:22.155: == Profiler Time Between Calls ==================
20:04:22.155: obs_hotkey_thread(25 ms): min=24.172 ms, median=25.284 ms, max=31.274 ms, 68.3535% within ±2% of 25 ms (0.00510579% lower, 31.6414% higher)
20:04:22.155: obs_graphics_thread(33.3333 ms): min=18.001 ms, median=33.333 ms, max=65.691 ms, 99.9861% within ±2% of 33.333 ms (0.00723051% lower, 0.00671404% higher)
20:04:22.155: =================================================
20:04:22.538: Number of memory leaks: 0
TagsNo tags attached.

Relationships

related to 0000875 assignedFenrir Highly Unstable for professional use with RTMP Inputs 
related to 0001317 confirmedFenrir Media Source does not reconnect to remote streams, even when restart playback when active set 

Activities

Jaom

2018-01-27 19:28

reporter   ~0003062

Failing to reconnect a RTSP stream seems to be an old issue. I'm experiencing it too (different camera) and all I was able to find was lots of similar reports.
It's weird as OBS Classic did not have the problem.

Fenrir

2019-02-24 03:36

administrator   ~0003989

Cleaning up old mantis cases, is this issue still present in the current OBS release?

Will close in a few days if no response.

Jaom

2019-02-24 03:58

reporter   ~0003994

It is present when the signal is lost for whatever reason. I've tried "replay playlist" but didn't do much.

Fenrir

2019-02-24 07:18

administrator   ~0004054

There are a bunch of similar cases to this, where Media Source doesn't restart on a connection failure, and must be manually "kicked" before it will start again.

This is a very difficult thing to fix, which is why the issue is still present.

Jaom

2019-02-24 19:11

reporter   ~0004085

Well, I don't know much about these things but if it needs to be "kicked" perhaps all you need is to detect failure, since "kicking" is a solution that would make everyone happy.
There is a workaround:
https://obsproject.com/forum/threads/solved-obs-not-reloading-ip-camera-stream.72290/#post-337403
But it's far from ideal for many reasons.

Fenrir

2019-02-25 01:36

administrator   ~0004112

There's really no programmatic way to detect the failure, which is the problem. It's easy to detect it as a person watching the feed, but in code it's not that simple.

Then you have to answer questions like, do we add a checkbox for automatically reconnecting? How long is the timeout? How many times should it retry connection? Etc. etc.

Solutions that seem simple, rarely are.

Suslik V

2019-02-27 14:45

reporter   ~0004149

In general, "Failure" is when timestamp not increasing (monotonically). Just a note.

Soultrader

2019-04-06 01:07

reporter   ~0004458

this is also happening to me with a reolink ip camera rtsp stream. also same happens when added as a vlc source. am trying a vlc playlist with multiple instances of the camera address, will update

Soultrader

2019-04-07 11:27

reporter   ~0004465

Just FYI - adding the rtsp address as a vlc source on it's own did not work, however adding it several times to the 'playlist' did work - i added it 10 times.

also FYI the streamlabs version of OBS has no issues with losing the rtsp stream at all.

Suslik V

2019-04-12 06:56

reporter   ~0004487

@Soultrader you mean looped playback list of 10 same network sources - if one fails the next should play?

Soultrader

2019-04-12 09:00

reporter   ~0004488

yep, this is how i have it https://www.screencast.com/t/KeXUQdpqcSa

i probably don't need anywhere near as many but it doesn't fail so i leave em in there

oh, and streamlabs is no different, must've had a lucky night with that lol

Soultrader

2019-04-15 09:39

reporter   ~0004501

ahh, nope, even with multiples it now fails - just lasts a bit longer is all.

so this is still an ongoing issue 3 years on.

Fenrir

2019-04-16 02:58

administrator   ~0004502

Potential solution here: https://github.com/obsproject/obs-studio/pull/1573

Issue History

Date Modified Username Field Change
2018-01-17 12:32 AdamJ New Issue
2018-01-22 14:15 Rodney Priority urgent => none
2018-01-22 14:15 Rodney Severity crash => minor
2018-01-27 19:28 Jaom Note Added: 0003062
2019-02-22 22:06 Fenrir Category Media Source Plugin => Media Source
2019-02-24 03:36 Fenrir Assigned To => Fenrir
2019-02-24 03:36 Fenrir Status new => feedback
2019-02-24 03:36 Fenrir Note Added: 0003989
2019-02-24 03:58 Jaom Note Added: 0003994
2019-02-24 07:18 Fenrir Note Added: 0004054
2019-02-24 08:46 Fenrir Relationship added related to 0000875
2019-02-24 08:46 Fenrir Relationship added related to 0001317
2019-02-24 19:11 Jaom Note Added: 0004085
2019-02-25 01:36 Fenrir Note Added: 0004112
2019-02-25 01:36 Fenrir Assigned To Fenrir =>
2019-02-25 01:36 Fenrir Status feedback => confirmed
2019-02-27 14:45 Suslik V Note Added: 0004149
2019-04-06 01:07 Soultrader Note Added: 0004458
2019-04-07 11:27 Soultrader Note Added: 0004465
2019-04-12 06:56 Suslik V Note Added: 0004487
2019-04-12 09:00 Soultrader Note Added: 0004488
2019-04-15 09:39 Soultrader Note Added: 0004501
2019-04-16 02:58 Fenrir Note Added: 0004502