Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename timestamps increasing at 2x wall clock time on Opus-encoded audio streams #4041

Closed
ijessen-mitll opened this issue Dec 12, 2024 · 3 comments · Fixed by #4062
Closed
Labels
bug Something isn't working record playback

Comments

@ijessen-mitll
Copy link
Contributor

Which version are you using?

1.10.0

Which operating system are you using?

Linux amd64 Docker

Describe how to replicate the issue

  1. configure server for recording w/ 1 min segment lengths:
  # Record streams to disk.
  record: yes
  # Path of recording segments.
  # Extension is added automatically.
  # Available variables are %path (path name), %Y %m %d %H %M %S %f %s (time in strftime format)
  recordPath: ./recordings/%path/%Y-%m-%d_%H-%M-%S-%f
  # Format of recorded segments.
  # Available formats are "fmp4" (fragmented MP4) and "mpegts" (MPEG-TS).
  recordFormat: fmp4
  # fMP4 segments are concatenation of small MP4 files (parts), each with this duration.
  # MPEG-TS segments are concatenation of 188-bytes packets, flushed to disk with this period.
  # When a system failure occurs, the last part gets lost.
  # Therefore, the part duration is equal to the RPO (recovery point objective).
  recordPartDuration: 1s
  # Minimum duration of each segment.
  recordSegmentDuration: 1m
  1. start the server
  2. publish Opus-encoded audio-only RTSP stream via ffmpeg:

ffmpeg -i in.wav -f rtsp -c:a libopus rtsp://media-server:8554/streamname

NOTE: I've played around with various options, such as -af aresample=48000 and changing bitrate, bandwidth, etc. None have had any impact.

  1. observe filenames of recordings. first file starts at the correct time stamp, all subsequent filenames reflect 2 min durations, despite the actual content (and creation times) reflecting the true 1 minute segment lengths

NOTE: this behavior goes away when I switch the stream encoding to mu-law.

Server logs

No response

Network dump

No response

@ijessen-mitll
Copy link
Contributor Author

FYI I'm working around this issue for now with the following configuration to issue commands to correct the filenames:

  runOnRecordSegmentCreate: sh -c 'date -u +%Y-%m-%d_%H-%M-%S-%s > $MTX_SEGMENT_PATH.timestamp'
  runOnRecordSegmentComplete: sh -c 'mv $MTX_SEGMENT_PATH $(dirname $MTX_SEGMENT_PATH)/$(head -n 1 $MTX_SEGMENT_PATH.timestamp).mp4 && rm $MTX_SEGMENT_PATH.timestamp'

@aler9 aler9 added bug Something isn't working record playback labels Dec 20, 2024
aler9 added a commit that referenced this issue Dec 20, 2024
When a stream contained an Opus, MPEG-4 audio or AC3 track, timespan in
the segment file name was increased at twice the speed.
aler9 added a commit that referenced this issue Dec 20, 2024
When a stream contained an Opus, MPEG-4 audio or AC3 track, timestamp in
the segment file name was increased at twice the speed.
@aler9
Copy link
Member

aler9 commented Dec 20, 2024

Thanks for reporting the issue, this is fixed by #4062

aler9 added a commit that referenced this issue Dec 20, 2024
When a stream contained an Opus, MPEG-4 audio or AC3 track, timestamp in
the segment file name was increasing at twice the speed.
aler9 added a commit that referenced this issue Dec 21, 2024
When a stream contained an Opus, MPEG-4 audio or AC3 track, timestamp in
the segment file name was increasing at twice the speed.
Copy link
Contributor

github-actions bot commented Jan 3, 2025

This issue is mentioned in release v1.11.0 🚀
Check out the entire changelog by clicking here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working record playback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants