Open BlohoJo opened 6 months ago
Can yt-dlp be fixed so that it will include the bit rates for the separate video and audio streams?
It is not in yt-dlp, it is in FFmpeg (used by yt-dlp).
Anything that can be done via FFmpeg?
Is it instead possible for yt-dlp to use mkvmerge/libebml for --merge-output-format mkv
?
I just asked ChatGPT 4o for FFmpeg. ("Write an example FFmpeg command line that will mux a video and audio stream to a MKV file, and will automatically determine each indivdual stream's bit rate and then include that metadata for each individual stream's bit rate in the MKV file.") Here is the command line it gave, I don't have time yet to try it out...
ffmpeg -i input_video.mp4 -i input_audio.aac -map 0:v -map 1:a -c copy -metadata:s:v:0 "bit_rate=$(ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 input_video.mp4)" -metadata:s:a:0 "bit_rate=$(ffprobe -v error -select_streams a:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 input_audio.aac)" output.mkv
According to https://github.com/MediaArea/MediaInfo/issues/691#issuecomment-1503960405, --exec "mkvpropedit --add-track-statistics-tags"
should act as a workaround.
Is it instead possible for yt-dlp to use mkvmerge/libebml for --merge-output-format mkv?
I just asked ChatGPT
@BlohoJo Actually try whether it works. ChatGPT often gives nonsense answers and there is no point posting them here unless you can confirm it is valid.
If anyone successfully manages to get ffmpeg to add the data, let us know. Otherwise, there is nothing we can do for now.
These tags are not part of the Matroska spec. As such, FFmpeg does not mux them. https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Track-statistics-tags
There is an open feature request for FFmpeg to write them as well: https://trac.ffmpeg.org/ticket/7467
I just asked ChatGPT 4o for FFmpeg.
No, this does not work. It just adds the BIT_RATE
metadata field. I am not sure if this is even possible with FFmpeg.
Either way, imo. this is not something yt-dlp should do.
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Provide a description that is worded well enough to be understood
Download any video from Youtube using the command line option + argument
--merge-output-format mkv
.Install MediaInfo.
Right click the file and select MediaInfo. Observe that the report will show only "Overall bit rate", there is no bit rate shown for the separate video stream or the audio stream.
Install MKVToolNix. Launch MKVToolNix GUI, drag the downloaded file into the source file window, then start multiplexing to a new file. Right click the created file, then select MediaInfo. Observe that the report shows the bit rates for the separate video stream and audio stream.
Can yt-dlp be fixed so that it will include the bit rates for the separate video and audio streams?
Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)'verbose': True
toYoutubeDL
params instead[debug] Command-line config
) and insert it belowComplete Verbose Output