bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.78k stars 1.4k forks source link

Playback does not work when recording path is non-default #3173

Open davidrylance opened 3 months ago

davidrylance commented 3 months ago

Dear Mediamtx developers and maintainers,

This is a fantastic project. Thank you!

Which version are you using?

v1.5.1

Which operating system are you using?

Describe the issue

I enabled recording and I verified that mp4 files are created and saved.

Then I enabled playback and wanted to use it as:

curl -L  'http://.../list?path=my_cam'

but I got:

ERR [playback] lstat /recordings/my_cam: no such file or directory

in logs.

Describe how to replicate the issue

Please use configuration like this:

playback: yes

pathDefaults:
  record: no
  playback: yes
  recordFormat: fmp4
  recordPartDuration: 100ms
  recordSegmentDuration: 1h
  recordDeleteAfter: 0s

paths:
  my_cam:
    source: 'rtsp://...'
    record: true
    recordPath: '/var/...' # custom
  my_cam2:
    source: 'rtsp://...'
    record: false
    # ...

Let it to save some mp4 files and then run:

curl -L  'http://.../list?path=my_cam'

Did you attach the server logs?

yes

ERR [playback] lstat /recordings/my_cam: no such file or directory

Did you attach a network dump?

no

aler9 commented 2 months ago

Hello, i tested your configuration, but in my case everything worked as expected. This is the overall configuration, i used two different recordPaths for two different cameras:


pathDefaults:
  record: no
  playback: yes
  recordFormat: fmp4
  recordPartDuration: 100ms
  recordSegmentDuration: 1h
  recordDeleteAfter: 0s

paths:
  my_camera1:
    source: rtsp://my_camera1
    recordPath: /var/mycamera/%Y-%m-%d_%H-%M-%S-%f

  my_camera2:
    source: rtsp://my_camera2
    recordPath: /lib/mycamera/%Y-%m-%d_%H-%M-%S-%f

if i request camera 1

http://localhost:9996/list?path=my_camera1

the server points to the expected path /var/mycamera

lstat /var/mycamera: no such file or directory

if i request camera 2

http://localhost:9996/list?path=my_camera2

the server points to the expected path /lib/mycamera

lstat /lib/mycamera: no such file or directory

are you able to perform another test? what are the exact values of recordingPath inside your configuration?