mpv-player / mpv-player/mpv

Error "Invalid audio PTS" when playing FLAC audio stream in conjunction with "--length="

Open
#16,416 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

os:linux
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

mpv Information
mpv 0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
libplacebo version: v6.338.2
FFmpeg version: 6.1.1-3ubuntu5
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Other Information
### System Information

  Host: mint Kernel: 6.8.0-51-generic arch: x86_64 bits: 64 compiler: gcc
    v: 13.3.0 clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/casper/vmlinuz boot=casper
  Desktop: Cinnamon v: 6.4.6 tk: GTK v: 3.24.41 wm: Muffin v: 6.4.1 tools:
    avail: cinnamon-screensaver vt: 7 dm: LightDM v: 1.30.0
    Distro: Linux Mint 22.1 Xia base: Ubuntu 24.04 noble

Graphics:
  Device-1: NVIDIA GP108 [GeForce GT 1030] vendor: Gigabyte driver: nouveau
    v: kernel alternate: nvidiafb non-free: 545.xx+ status: current (as of
    2024-04; EOL~2026-12-xx) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-2021 pcie: gen: 1 speed: 2.5 GT/s lanes: 4 link-max: gen: 3
    speed: 8 GT/s ports: active: DVI-D-1 empty: HDMI-A-1 bus-ID: 01:00.0
    chip-ID: 10de:1d01 class-ID: 0300 temp: 38.0 C
  Display: x11 server: X.Org v: 21.1.11 with: Xwayland v: 23.2.6 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: nouveau gpu: nouveau
    display-ID: :0 screens: 1
  API: EGL v: 1.5 hw: drv: nvidia nouveau platforms: device: 0 drv: nouveau
    device: 1 drv: swrast gbm: drv: nouveau surfaceless: drv: nouveau x11:
    drv: nouveau inactive: wayland
  API: OpenGL v: 4.5 compat-v: 4.3 vendor: mesa v: 24.0.9-0ubuntu0.3
    glx-v: 1.4 direct-render: yes renderer: NV138 device-ID: 10de:1d01
    memory: 1.94 GiB unified: no

Audio:
  Device-1: Intel NM10/ICH7 Family High Definition Audio
    vendor: ASUSTeK P5KPL-VM driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
    chip-ID: 8086:27d8 class-ID: 0403
  API: ALSA v: k6.8.0-51-generic status: kernel-api
    tools: alsactl,alsamixer,amixer
  Server-1: PipeWire v: 1.0.5 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl

Info:
  services: csd-power, power-profiles-daemon, upowerd Init: systemd v: 255
    target: graphical (5) default: graphical tool: systemctl
Source of mpv:

http://archive.ubuntu.com/ubuntu noble/universe amd64 mpv amd64 0.37.0-1ubuntu4

Latest known working version:

N/A

Issue started after the following happened:

It has never worked

Expected Behavior

When I issue command mpv --term-status-msg='${path}\naudio-bitrate:${audio-bitrate}' --length=15 'https://streams.radiomast.io/ref-lossless-ogg-flac-stereo' > ~/mpv-term-status-msg-1.log 2>&1, I expect it to play for more than a split second.

Notes

This is a Radio Mast Audio reference stream, that's supposed to always produce sound. This stream CAN be played in Firefox native audio player. The "--length=15" switch is used in my radio station test script, to detect silent radio stations.

Actual Behavior

When I issue command mpv --term-status-msg='${path}\naudio-bitrate:${audio-bitrate}' --length=15 'https://streams.radiomast.io/ref-lossless-ogg-flac-stereo' > ~/mpv-term-status-msg-1.log 2>&1, it plays only for a split second.

When I change "--length=15" to "--length=60", it still plays only for a split second.

When I leave out the "--length=15" switch, and issue mpv --term-status-msg='${path}\naudio-bitrate:${audio-bitrate}' 'https://streams.radiomast.io/ref-lossless-ogg-flac-stereo' > ~/mpv-term-status-msg-2.log 2>&1 the stream plays OK

When I issue command mpv --gpu-debug --log-file=mpv-gpu-debug.log 'https://streams.radiomast.io/ref-lossless-ogg-flac-stereo' the stream plays OK as well.

I tried installing the newest MPV package mpv_0.40.0-dmo1, but failed, due to uncorrectable package dependencies.

Probable cause

The "--length=" switch does not work correctly, when playing a FLAC audio stream.

Log Files

mpv-gpu-debug.log

mpv-term-status-msg-1.log

mpv-term-status-msg-2.log

Suggestion

Perhaps the switch "--skip-correct-audio-pts", proposed by @digitalone1 in post Avoid stream jumping due to incorrect audio PTS #15425 can be implemented?

I carefully read all instruction and confirm that I did the following:
  • [unable] I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • [n/a] I attached the backtrace in the case of a crash.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the exact mpv command with --length=15 against the Radio Mast FLAC stream and compare it with the command without --length. Read the attached mpv-term-status-msg-1.log and mpv-term-status-msg-2.log, then review issue #15425 for related audio PTS behavior. Done means the stream plays beyond a split second while --length still limits playback as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.