--screenshot-template='%{title}' only half expanded (to `${?media-title: ….jpg`
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 021c5de Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
built on May 26 2024 16:07:27
libplacebo version: v7.349.0
FFmpeg version: git-2024-05-26-63697d3
FFmpeg library versions:
libavutil 59.20.100
libavcodec 61.5.104
libavformat 61.3.104
libswscale 8.2.100
libavfilter 10.2.102
libswresample 5.2.100
and
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
- Linux version: Ubuntu 24.04.1 LTS
- Kernel Version: 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024
- GPU Model: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 0b)
- Mesa/GPU Driver Version: OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.1
- Window Manager and Version: xfce 4.18
- Source mpv: ubuntu & fruit repo
- Introduced in version: unknown
Reproduction Steps
Trying to find a suitable screenshot template, i stumbled over this glitch that %{title} is only being half expanded.
To reproduce, play any file with mpv -v --screenshot-template='%{title}' and press s to take a snap than check the name.
example: mpv --no-config -v --screenshot-template='%{title}' --gpu-debug --log-file=output.mpv.txt https://www.youtube.com/watch?v=3cdt-aECOCg
Expected Behavior
That the title is filled into the filename.
Actual Behavior
Actual file name created is ${?media-title:${media-title}}${!media-title:No file} - mpv.jpg
Log File
- v0.37: output.mpv.txt
- v0.38-021c5de: output.mpv.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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the --screenshot-template option and the screenshot action triggered by the s key, using the linked output.mpv.txt logs to follow how %{title} is expanded. Reproduce with the command shown and verify that the resulting filename contains the media title rather than the unexpanded conditional template.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100