jrudess / streamdvr

DVR for streaming entertainment
GNU General Public License v3.0
66 stars 16 forks source link

Streams interrupted and restarted during recording #166

Open revunix opened 3 days ago

revunix commented 3 days ago

Hi,

I’ve noticed that streams are being interrupted and restarted periodically when recording with streamdvr. This issue does not occur when recording the same streams directly with streamlink or using streamdvr. The interruptions seem inconsistent—sometimes the recording lasts for 4 hours, sometimes for only 1 hour, and occasionally there are no interruptions at all. I checked the logs, but there’s nothing indicating why this is happening.

I'm using the following configuration:

name: TWITCH
plugin: ./lib/plugins/basic
siteUrl: https://www.twitch.tv/
urlback: ""
enable: true
m3u8fetch: scripts/m3u8_streamlink.sh
m3u8fetch_args: ["--twitch-proxy-playlist=https://as.luminous.dev/,https://twitch.zzls.xyz"]
recorder: scripts/record_streamlink.sh
recorder_args: ["--twitch-proxy-playlist=https://as.luminous.dev/,https://twitch.zzls.xyz"]
scanInterval: 300
batchSize: 5
noTerminateOffline: false
streamers:
  - - montanablack88
  - - papaplatte
  - - therealknossi
  - - hsu_live
  - - thiseguysessions
    - unpaused

config.yaml

enable:
  daemon: false
recording:
  autoConvertType: mp4
  captureDirectory: "/media/twitch/capturing"
  completeDirectory: "/media/twitch/captured"
  postprocess: "scripts/postprocess_ffmpeg.sh"
  dateFormat: "YYYYMMDD_HHmmss"
  fileNameFormat: "%n_%s_%d"
  includeSiteInDir: false
  streamerSubdir: true
  siteSubdir: true
  keepTsFile: false
  minSize: 0
  maxSize: 0
postprocess: ""
log:
  enable: true
  append: true
tui:
  enable: true
  allowUnicode: true
colors:
  name: magenta
  state: yellow
  offline: blue
  prompt: blue
  file: green
  time: grey
  site: green
  cmd: grey
  debug: yellow
  error: red
proxy:
  enable: false
  server:
debug:
  log: true
  recorder: true
  errortrace: true

Do you have any idea what might be causing this issue? Is there perhaps a difference in how streamdvr processes streams?

Thanks for the help!

revunix commented 2 days ago

Push

jrudess commented 1 day ago

There are two reason this happens.

revunix commented 1 day ago

Thanks for the explanation! I'll test it out and see if it works as expected.

noTerminateOffline: true
jrudess commented 20 hours ago

Thinking about this more, the 'filesize' check was added much later than the first case where streamlink/ffmpeg don't terminate when the broadcast stops. But I think the filesize check probably also solves the same problem that the 1st check was trying to solve. I may change the default to be noTerminateOffline: true.

Also there have been a couple of years of streamlink/ffmpeg releases since people were running into the hung-recording problems, and it may just not be a problem anymore.

revunix commented 2 hours ago

This did not solve the problem.

noTerminateOffline: true