Assume I have already a *.MKV video with a variable video bitrate.
Now I want to find out the average video bitrate.
Since it is a variable bitrate popular codec/media information tools like MedieInfo do not show it.
So I could imagine that specialized MKV tools like Handbrake are able to calculate them.
Is this possible? how?
Mkvtoolnix offer a command to add statistic tags with
mkvpropedit --add-track-statistics-tags <file>
However this seems to be only possible at creation time and not afterwards
My Idea is now to open an existing *.mkv video file in Handbrake then set video+audio to NO re-encoding/just copy and let Handbrake
create a new, second MKV video file WITH average variable video bitrate statistic tag.
Is this possible?
Peter
How to calculate average variable video bitrate? Create MKV without re-encoding?
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
-
- Veteran User
- Posts: 4840
- Joined: Wed May 04, 2011 11:06 pm
Re: How to calculate average variable video bitrate? Create MKV without re-encoding?
No it’s not possible with HB, you have to reencode the video with HB.
Re: How to calculate average variable video bitrate? Create MKV without re-encoding?
I was reading this thread, because my output files with 2-Pass Avg Bitrate encoding, did not show any bitrates in MediaInfo, which I find annoying.
I got it working in Handbrake. The adding of the statistics happens in mere seconds, depending on the size of the file. After each encode completes, a command window opens briefly in which mkvpropedit updates the statistics of the just finished file. In MediaInfo the output file shows the audio and video bitrate.
It currently works in Handbrake (tested in v1.5.1) by enabling post encoding in mkvpropedit, which is part of mkvtoolnix.
Set it in Preferences in the tab "When Done" under "Encode Completed"
Link the "send file to:" to your mkvpropedit location, and fill in the arguments line: {destination} --add-track-statistics-tags
Here is a screenshot of how it's working.
https://user-images.githubusercontent.c ... 96fef6.png
I got it working in Handbrake. The adding of the statistics happens in mere seconds, depending on the size of the file. After each encode completes, a command window opens briefly in which mkvpropedit updates the statistics of the just finished file. In MediaInfo the output file shows the audio and video bitrate.
It currently works in Handbrake (tested in v1.5.1) by enabling post encoding in mkvpropedit, which is part of mkvtoolnix.
Set it in Preferences in the tab "When Done" under "Encode Completed"
Link the "send file to:" to your mkvpropedit location, and fill in the arguments line: {destination} --add-track-statistics-tags
Here is a screenshot of how it's working.
https://user-images.githubusercontent.c ... 96fef6.png
Last edited by HandBrake on Fri Nov 11, 2022 8:39 pm, edited 1 time in total.
Reason: Removed img tags. Remote images are not supported.
Reason: Removed img tags. Remote images are not supported.
Re: How to calculate average variable video bitrate? Create MKV without re-encoding?
Interesting.
Can I calculate and add this statistic to a given MKV video file WITHOUT re-encoding it?
Can I calculate and add this statistic to a given MKV video file WITHOUT re-encoding it?
Re: How to calculate average variable video bitrate? Create MKV without re-encoding?
Yep. Mkvpropedit just adds the statistics without re-encoding.
You can use mkvpropedit on any .mkv file.
Open a command window or .bat script in the same folder as mkvpropedit.
Example: Use the command:
In the .bat script you can use multiple lines and do a whole folder.
Excel File
I personally have made a Excel File in which I can past the file names from Explorer.
Select the files in Explorer and push the "Copy Path" button.
Paste the names in Cel A6 and below.
Put a " in cel D1.
Use in Cel B6 the formula ="mkvpropedit "&$D$1&A6&$D$1&" --add-track-statistics-tags"
You can then copy the formula to below.
If you copy the output in column B to a .bat file, it does them all in one window.
You can use mkvpropedit on any .mkv file.
Open a command window or .bat script in the same folder as mkvpropedit.
Example: Use the command:
Code: Select all
mkvpropedit "Q:\Folder\Folder\File1.mkv" --add-track-statistics-tags
Code: Select all
mkvpropedit "Q:\Folder\Folder\File1.mkv" --add-track-statistics-tags
mkvpropedit "Q:\Folder\Folder\File2.mkv" --add-track-statistics-tags
mkvpropedit "Q:\Folder\Folder\File#.mkv" --add-track-statistics-tags
I personally have made a Excel File in which I can past the file names from Explorer.
Select the files in Explorer and push the "Copy Path" button.
Paste the names in Cel A6 and below.
Put a " in cel D1.
Use in Cel B6 the formula ="mkvpropedit "&$D$1&A6&$D$1&" --add-track-statistics-tags"
You can then copy the formula to below.
If you copy the output in column B to a .bat file, it does them all in one window.
Re: How to calculate average variable video bitrate? Create MKV without re-encoding?
@Spaarpott:
works
thank you.
One should mention, that the original video file will be replaced without creating a backup
works
thank you.
One should mention, that the original video file will be replaced without creating a backup
Re: How to calculate average variable video bitrate? Create MKV without re-encoding?
You could argue it appends to the file rather than replacing it altogether, although I suppose there's indeed always the risk of breaking the index