VLC for Android displays incorrect duration for Opus audio files
Description
When playing certain .opus audio files in VLC for Android, the application displays an incorrect duration of 0:00. Despite this, the audio plays fully without interruption and ends at the correct time, indicating that the files are valid and not corrupted.
However, due to the missing duration display, VLC does not allow seeking (forward/rewind), which limits playback control. This issue occurs intermittently with certain .opus files, while others work correctly. The problem appears to be specific to how VLC handles duration metadata in these files.
Re-encoding an affected file to MP3 using FFmpeg resolves the issue—VLC then shows the correct duration and enables seeking—which further confirms that the problem lies in how VLC processes metadata in some Opus files.
Below is the ffprobe output of one such .opus file:
{ "streams": [ { "index": 0, "codec_name": "opus", "codec_long_name": "Opus (Opus Interactive Audio Codec)", "codec_type": "audio", "sample_fmt": "fltp", "sample_rate": "48000", "channels": 2, "channel_layout": "stereo", "duration_ts": 7225127, "duration": "150.523479", "tags": { "encoder": "Lavc61.19.101 libopus", "album": "Viliam Lane", "title": "Viliam Lane - particles", "artist": "Viliam Lane", "TLEN": "151000" } } ], "format": { "filename": "Viliam Lane - particles(MP3_160K).opus", "format_name": "ogg", "duration": "150.523479", "bit_rate": "318591", "probe_score": 100 } }
Steps to Reproduce
- Identify affected files:
Select a group of .opus files that exhibit the issue.
Identify files that play correctly for comparison.
- Set up the test environment:
Ensure all files are stored in the same location (e.g., main music folder).
Confirm that the files have similar metadata (e.g., duration information).
- Reproduce the issue:
Open VLC on your Android device.
Play a playlist containing the selected files.
Observe which files display the duration as 0:00 and do not allow seeking.
Compare the behavior of files that display duration correctly and permit seeking.
Expected Behavior
VLC should correctly parse and display the duration of valid Opus audio files and allow full playback control, including seeking.
Actual Behavior
The audio plays fully without interruption and ends at the correct time, but the duration is incorrectly displayed as 0:00. This prevents seeking (forward/rewind) in the audio file, making it impossible to skip to different parts of the track. The issue occurs intermittently with certain .opus files, while others function correctly.
Screenshot / Video
App Mode
Smartphone
Device Info
Device: Samsung Galaxy S23
Android Version: 14
VLC Version: 3.6.3