file size information also with yt-dlp (also if video and audio separate stream are given) rather than total cache
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Expected behavior of the wanted feature
As I open a youtube video, it will be expected to give the filesize of video (like yt-dlp -f 22), even if audio video stream are separate (yt-dlp -f=136+139) than it will be expected to show the audio and vidoe size separately.
It will be best to do it by mpv script, I don't find any mpv script related that I am trying to develop if you give some hint or to include in main mpv.
Alternative behavior of the wanted feature
What we have now -
As I used previous version of mpv, it will give the filesize information, even if with yt-dlp with one audio+video stream (like yt-dlp -f 22/18) it will give the total file size to download but there is no file size shown if combined audio-video (like yt-dlp -f 136+139) is played with mpv.
However as recent mpv replaced file size option with Total Cache when pressing i button
Log File
[cplayer] Command line options: '-v' '-v'
[cplayer] mpv v0.38.0-667-g5f768a688b Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
[cplayer] built on Aug 2 2024 16:29:44
[cplayer] libplacebo version: v6.338.2
[cplayer] FFmpeg version: 6.1.1-3ubuntu5
[cplayer] FFmpeg library versions:
[cplayer] libavcodec 60.31.102
[cplayer] libavdevice 60.3.100
[cplayer] libavfilter 9.12.100
[cplayer] libavformat 60.16.100
[cplayer] libavutil 58.29.100
[cplayer] libswresample 4.12.100
[cplayer] libswscale 7.5.100
[cplayer] Configuration:
[cplayer] List of enabled features: alsa build-date caca cplugins cuda-hwaccel cuda-interop debug dmabuf-interop-gl dmabuf-wayland drm dvbin egl egl-drm egl-wayland egl-x11 ffmpeg ffnvcodec gbm gl glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libplacebo linux-fstatfs lua52 memfd-create memrchr pipewire posix posix-shm ppoll pthread-condattr-setclock pulse rubberband rubberband-3 sixel sndio sndio-1-9 uchardet vaapi vaapi-drm vaapi-wayland vaapi-x11 vdpau vector vk-khr-display vt.h vulkan vulkan-interop wayland wayland-protocols-1-32 x11 xv zimg zimg-st428 zlib
[global] home path: '' -> '/home/kush/.config/mpv'
[global] user path: '~~home/' -> '/home/kush/.config/mpv'
[global] user path: '~~old_home/' -> '/home/kush/.mpv'
[global] config path: 'encoding-profiles.conf' -/-> '/home/kush/.config/mpv/encoding-profiles.conf'
[global] config path: 'encoding-profiles.conf' -/-> '/home/kush/.mpv/encoding-profiles.conf'
[global] config path: 'encoding-profiles.conf' -> '/usr/local/etc/mpv/encoding-profiles.conf'
[cplayer] Reading config file /usr/local/etc/mpv/encoding-profiles.conf
[bdmv/bluray] Opening /usr/local/etc/mpv/encoding-profiles.conf
[file] Opening /usr/local/etc/mpv/encoding-profiles.conf
[file] resize stream to 131072 bytes, drop 0 bytes
[file] Stream opened successfully.
[cplayer] Applying profile 'default'...
[global] config path: 'mpv.conf' -> '/home/kush/.config/mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/kush/.config/mpv/config'
[global] config path: 'mpv.conf' -/-> '/home/kush/.mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/kush/.mpv/config'
[global] config path: 'mpv.conf' -/-> '/usr/local/etc/mpv/mpv.conf'
[global] config path: 'config' -/-> '/usr/local/etc/mpv/config'
[cplayer] Reading config file /home/kush/.config/mpv/mpv.conf
[bdmv/bluray] Opening /home/kush/.config/mpv/mpv.conf
[file] Opening /home/kush/.config/mpv/mpv.conf
[file] resize stream to 131072 bytes, drop 0 bytes
[file] Stream opened successfully.
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'screenshot-directory' = '/mnt/store/images/mpv' (flags = 4)
[cplayer] Setting option 'border' = 'no' (flags = 4)
[cplayer] Setting option 'panscan' = '0' (flags = 4)
[cplayer] Setting option 'geometry' = '50%:50%' (flags = 4)
[cplayer] Setting option 'saturation' = '60' (flags = 4)
[cplayer] Setting option 'hwdec' = 'vaapi-copy' (flags = 4)
[cplayer] Setting option 'script-opts' = 'ytdl_hook-ytdl_path=yt-dlp' (flags = 4)
[cplayer] Setting option 'ytdl-format' = 'bv[height<=720][ext=webm]+wa[ext=webm]/22/18' (flags = 4)
[cplayer] Setting option 'ytdl-raw-options' = 'playlist-end=20' (flags = 4)
[cplayer] Setting option 'ytdl-raw-options-append' = 'cookies-from-browser=firefox' (flags = 4)
[cplayer] Setting option 'save-position-on-quit' = 'no' (flags = 4)
[cplayer] Setting option 'osd-font-size' = '30' (flags = 4)
[cplayer] Setting option 'osd-border-size' = '1' (flags = 4)
[cplayer] Setting option 'osd-bar' = 'no' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'v' = '' (flags = 8)
[global] config path: 'input.conf' -> '/home/kush/.config/mpv/input.conf'
[global] config path: 'input.conf' -/-> '/home/kush/.mpv/input.conf'
[global] config path: 'input.conf' -/-> '/usr/local/etc/mpv/input.conf'
[global] user path: '/home/kush/.config/mpv/input.conf' -> '/home/kush/.config/mpv/input.conf'
[bdmv/bluray] Opening /home/kush/.config/mpv/input.conf
[file] Opening /home/kush/.config/mpv/input.conf
[file] resize stream to 131072 bytes, drop 0 bytes
[file] Stream opened successfully.
[input] Parsing input config file /home/kush/.config/mpv/input.conf
[input] Input config file /home/kush/.config/mpv/input.conf parsed: 14 binds
[osc] Loading lua script @osc.lua...
[ytdl_hook] Loading lua script @ytdl_hook.lua...
[stats] Loading lua script @stats.lua...
[osc] loading mp.defaults
[console] Loading lua script @console.lua...
[auto_profiles] Loading lua script @auto_profiles.lua...
[ytdl_hook] loading mp.defaults
[select] Loading lua script @select.lua...
[stats] loading mp.defaults
[auto_profiles] loading mp.defaults
[cplayer] mpv v0.38.0-667-g5f768a688b Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
[cplayer] built on Aug 2 2024 16:29:44
[cplayer] libplacebo version: v6.338.2
[cplayer] FFmpeg version: 6.1.1-3ubuntu5
[cplayer] FFmpeg library versions:
[cplayer] libavcodec 60.31.102
[cplayer] libavdevice 60.3.100
[select] loading mp.defaults
[console] loading mp.defaults
[osc] loading @osc.lua
[ytdl_hook] loading @ytdl_hook.lua
[stats] loading @stats.lua
[auto_profiles] loading @auto_profiles.lua
[console] loading @console.lua
[ytdl_hook] reading options for ytdl_hook
[global] config path: 'script-opts/ytdl_hook.conf' -/-> '/home/kush/.config/mpv/script-opts/ytdl_hook.conf'
[global] config path: 'script-opts/ytdl_hook.conf' -/-> '/home/kush/.mpv/script-opts/ytdl_hook.conf'
[global] config path: 'script-opts/ytdl_hook.conf' -/-> '/usr/local/etc/mpv/script-opts/ytdl_hook.conf'
[ytdl_hook] script-opts/ytdl_hook.conf not found.
[global] config path: 'lua-settings/ytdl_hook.conf' -/-> '/home/kush/.config/mpv/lua-settings/ytdl_hook.conf'
[global] config path: 'lua-settings/ytdl_hook.conf' -/-> '/home/kush/.mpv/lua-settings/ytdl_hook.conf'
[global] config path: 'lua-settings/ytdl_hook.conf' -/-> '/usr/local/etc/mpv/lua-settings/ytdl_hook.conf'
[ytdl_hook] lua-settings/ytdl_hook.conf not found.
[stats] reading options for stats
[global] config path: 'script-opts/stats.conf' -/-> '/home/kush/.config/mpv/script-opts/stats.conf'
[global] config path: 'script-opts/stats.conf' -/-> '/home/kush/.mpv/script-opts/stats.conf'
[global] config path: 'script-opts/stats.conf' -/-> '/usr/local/etc/mpv/script-opts/stats.conf'
[stats] script-opts/stats.conf not found.
[global] config path: 'lua-settings/stats.conf' -/-> '/home/kush/.config/mpv/lua-settings/stats.conf'
[global] config path: 'lua-settings/stats.conf' -/-> '/home/kush/.mpv/lua-settings/stats.conf'
[global] config path: 'lua-settings/stats.conf' -/-> '/usr/local/etc/mpv/lua-settings/stats.conf'
[stats] lua-settings/stats.conf not found.
[select] loading @select.lua
[cplayer] libavfilter 9.12.100
[cplayer] libavformat 60.16.100
[cplayer] libavutil 58.29.100
[cplayer] libswresample 4.12.100
[cplayer] libswscale 7.5.100
[cplayer] Usage: mpv [options] [url|path/]filename
[cplayer]
[cplayer] Basic options:
[cplayer] --start= seek to given (percent, seconds, or hh:mm:ss) position
[cplayer] --no-audio do not play sound
[cplayer] --no-video do not play video
[cplayer] --fs fullscreen playback
[cplayer] --sub-file= specify subtitle file to use
[cplayer] --playlist= specify playlist file
[cplayer]
[cplayer] --list-options list all mpv options
[cplayer] --h= print options which contain the given string in their name
[select] Exiting...
[ytdl_hook] Exiting...
[cplayer] Run command: define-section, flags=64, args=[name="showhide", contents="mouse_move script-binding osc/__keybinding1\nmouse_leave script-binding osc/__keybinding2\n", flags="force"]
[cplayer] Run command: define-section, flags=64, args=[name="showhide_wc", contents="mouse_move script-binding osc/__keybinding3\nmouse_leave script-binding osc/__keybinding4\n", flags="force"]
[cplayer] Run command: enable-section, flags=64, args=[name="showhide", flags="allow-hide-cursor+allow-vo-dragging"]
[cplayer] Run command: enable-section, flags=64, args=[name="showhide_wc", flags="allow-hide-cursor+allow-vo-dragging"]
[cplayer] Run command: define-section, flags=64, args=[name="input", contents="mbtn_left script-binding osc/__keybinding5\nshift+mbtn_left script-binding osc/__keybinding6\nmbtn_right script-binding osc/__keybinding7\nmbtn_mid script-binding osc/__keybinding8\nwheel_up script-binding osc/__keybinding9\nwheel_down script-binding osc/__keybinding10\nmbtn_left_dbl ignore\nshift+mbtn_left_dbl ignore\nmbtn_right_dbl ignore\n", flags="force"]
[cplayer] Run command: enable-section, flags=64, args=[name="input", flags=""]
[cplayer] Run command: define-section, flags=64, args=[name="window-controls", contents="mbtn_left script-binding osc/__keybinding11\n", flags="force"]
[cplayer] Run command: enable-section, flags=64, args=[name="window-controls", flags=""]
[osc] reading options for osc
[global] config path: 'script-opts/osc.conf' -/-> '/home/kush/.config/mpv/script-opts/osc.conf'
[global] config path: 'script-opts/osc.conf' -/-> '/home/kush/.mpv/script-opts/osc.conf'
[global] config path: 'script-opts/osc.conf' -/-> '/usr/local/etc/mpv/script-opts/osc.conf'
[osc] script-opts/osc.conf not found.
[global] config path: 'lua-settings/osc.conf' -/-> '/home/kush/.config/mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/osc.conf' -/-> '/home/kush/.mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/osc.conf' -/-> '/usr/local/etc/mpv/lua-settings/osc.conf'
[osc] lua-settings/osc.conf not found.
[cplayer] Set property: user-data/osc/visibility="auto" -> 1
[cplayer] Run command: disable-section, flags=64, args=[name="input"]
[cplayer] Run command: disable-section, flags=64, args=[name="window-controls"]
[cplayer] Set property: user-data/osc/margins={"r":0,"b":0,"l":0,"t":0} -> 1
[cplayer] Run command: del, flags=64, args=[name="user-data/osc"]
[osc] Exiting...
[console] reading options for console
[global] config path: 'script-opts/console.conf' -/-> '/home/kush/.config/mpv/script-opts/console.conf'
[global] config path: 'script-opts/console.conf' -/-> '/home/kush/.mpv/script-opts/console.conf'
[global] config path: 'script-opts/console.conf' -/-> '/usr/local/etc/mpv/script-opts/console.conf'
[console] script-opts/console.conf not found.
[global] config path: 'lua-settings/console.conf' -/-> '/home/kush/.config/mpv/lua-settings/console.conf'
[global] config path: 'lua-settings/console.conf' -/-> '/home/kush/.mpv/lua-settings/console.conf'
[global] config path: 'lua-settings/console.conf' -/-> '/usr/local/etc/mpv/lua-settings/console.conf'
[console] lua-settings/console.conf not found.
[console] Exiting...
[stats] Exiting...
[auto_profiles] Exiting...
Sample Files
No response
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 with the stats.lua and ytdl_hook.lua scripts shown in the log, then trace how the current Total Cache information is assembled for separate yt-dlp streams. Done should mean that pressing the information key shows video and audio sizes separately, and reports the combined size when appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua
- Domain
- cli, desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100