exeldro / obs-source-record

GNU General Public License v2.0
347 stars 38 forks source link

No Recordings Saved. #20

Open LordTocs opened 3 years ago

LordTocs commented 3 years ago

This plugin solves a streaming problem I've had so I was very excited to come across it. Sadly it doesn't seem to produce files on my machine.

Things I've tried:

Curiously the log file says "Writing File '\<path to output file>'" but there's no file there.

Here's the full log of me starting up OBS, enabling the filter to record with x264, disabling the filter shortly after, and closing OBS. no_files.txt

I can't seem to think of anything else to fiddle with. If I find some time this week I'll build it from source to fiddle further. Though hopefully something stands out to you.

LordTocs commented 3 years ago

So I built everything from source and had a look around...

Good news I found the problem in the code. Not sure how too fix it though, still really new to the OBS codebase / plugins.

I hadn't selected "Different Audio" checkbox in my filter settings. So the encoder never had receive_audio called. Which caused obs_encoder::first_raw_ts to remain 0. Since first_raw_ts is 0 when receive_video is called it will early out and jump to a label wait_for_audio even though there's no audio coming. (The offending line in OBS is here https://github.com/obsproject/obs-studio/blob/master/libobs/obs-encoder.c#L1029) And since receive video never makes it far enough to call do_encode nothing gets sent to the outputs and so no file is written.

As a work around you can use the "Different Audio" checkbox to record some audio to the file, even if you don't end up needing it in the recording.