mpv-player / mpv-player/mpv

The `format:stereo-in` filter doesn't work when encoding videos

Open
#15,225 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

mpv Information
mpv 0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
libplacebo version: v6.338.2
FFmpeg version: 6.1.2
FFmpeg library versions:
   libavcodec      60.31.102
   libavdevice     60.3.100
   libavfilter     9.12.100
   libavformat     60.16.100
   libavutil       58.29.100
   libswresample   4.12.100
   libswscale      7.5.100
Important Information
Fedora 40, built mpv manually from 0.39.0.
Reproduction Steps

First play the video normally. You will see correctly rendered subtitles (they will be duplicated at the top and bottom halves of the video):

mpv --no-config --vf="format:stereo-in=ab2l" <videofile>

Now use mpv as an encoder. The filter now fails and the subtitles only render once (at the bottom of the screen).

mkfifo /tmp/mpv-enc
mpv --no-config --o=/tmp/mpv-enc --of=nut --ovc=rawvideo --oac=pcm_s16le --vf="format:stereo-in=ab2l" <videofile>

To see the streaming video of the second example, open a second terminal and run mpv /tmp/mpv-enc after having started the "stream" above.

Expected Behavior

Since I am re-encoding 3D videos and burning-in the subtitles, I need the subtitles to appear in 3D format, which is the purpose of that filter. But it's not working in encoding mode. :(

Actual Behavior

The filter is ignored. I see from the log that the filter/its metadata is being inserted, but the correct subtitle rendering code isn't being activated in mpv's encoding mode.

Log File

output2.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:
  • 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.
  • 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 issue with the two mpv commands in the report and compare the attached output2.txt log for playback versus encoding. Trace where the format:stereo-in=ab2l metadata and subtitle rendering diverge between those modes; done means encoded output renders the subtitles in the requested duplicated 3D layout.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.