Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKV Framerate changed #757

Closed
karussellbremser opened this issue May 24, 2021 · 7 comments
Closed

MKV Framerate changed #757

karussellbremser opened this issue May 24, 2021 · 7 comments
Labels
bug ffmpeg Problem resides in ffmpeg or usage of ffmpeg

Comments

@karussellbremser
Copy link

When cutting some seconds from the beginning of an MKV file, the resulting cut file has altered Framerate information: The original was 23.976fps CFR, the cut file is 24.000fps VFR. Shouldn't they be untouched? Using latest Lossless Cut 3.36.0 on Windows 10.

MediaInfo general and video portions (I blanked the some irrelevant values):

Original:
"track": [ { "@type": "General", "UniqueID": ----, "VideoCount": "1", "AudioCount": "1", "MenuCount": "1", "FileExtension": "mkv", "Format": "Matroska", "Format_Version": "4", "FileSize": "14503321545", "Duration": "5960.299", "OverallBitRate_Mode": "VBR", "OverallBitRate": "19466569", "FrameRate": "23.976", "FrameCount": "142904", "StreamSize": "2289020", "IsStreamable": "Yes", "Title": ----, "Movie": ----, "Encoded_Date": ----, "File_Created_Date": ----, "File_Created_Date_Local": ----, "File_Modified_Date": ----, "File_Modified_Date_Local": ----, "Encoded_Application": "mkvmerge v42.0.0 ('Overtime') 64-bit", "Encoded_Library": "libebml v1.3.10 + libmatroska v1.5.2" }, { "@type": "Video", "StreamOrder": "0", "ID": "1", "UniqueID": ----, "Format": "AVC", "Format_Profile": "High", "Format_Level": "4.1", "Format_Settings_CABAC": "Yes", "Format_Settings_RefFrames": "3", "Format_Settings_GOP": "M=3, N=12", "CodecID": "V_MPEG4/ISO/AVC", "Duration": "5960.288000000", "BitRate_Mode": "VBR", "BitRate": "17902528", "BitRate_Maximum": "32294400", "Width": "1920", "Height": "1080", "Stored_Height": "1088", "Sampled_Width": "1920", "Sampled_Height": "1080", "PixelAspectRatio": "1.000", "DisplayAspectRatio": "1.778", "FrameRate_Mode": "CFR", "FrameRate": "23.976", "FrameCount": "142904", "Standard": "NTSC", "ColorSpace": "YUV", "ChromaSubsampling": "4:2:0", "BitDepth": "8", "ScanType": "Progressive", "Delay": "0.000", "StreamSize": "13338028481", "Language": "en", "Default": "Yes", "Forced": "No", "BufferSize": "29999616", "colour_description_present": "Yes", "colour_description_present_Source": "Stream", "colour_range": "Limited", "colour_range_Source": "Stream", "colour_primaries": "BT.709", "colour_primaries_Source": "Stream", "transfer_characteristics": "BT.709", "transfer_characteristics_Source": "Stream", "matrix_coefficients": "BT.709", "matrix_coefficients_Source": "Stream" },

after cutting:
"track": [ { "@type": "General", "UniqueID": ----, "VideoCount": "1", "AudioCount": "1", "MenuCount": "1", "FileExtension": "mkv", "Format": "Matroska", "Format_Version": "4", "FileSize": "14503827608", "Duration": "5949.829", "OverallBitRate_Mode": "VBR", "OverallBitRate": "19501505", "FrameRate": "24.000", "FrameCount": "142904", "StreamSize": "2795083", "IsStreamable": "Yes", "Title": ----, "Movie": ----, "Encoded_Date": ----, "File_Created_Date": ----, "File_Created_Date_Local": ----, "File_Modified_Date": ----, "File_Modified_Date_Local": ----, "Encoded_Application": "Lavf58.45.100", "Encoded_Library": "Lavf58.45.100", "extra": { "ErrorDetectionType": "Per level 1" } }, { "@type": "Video", "StreamOrder": "0", "ID": "1", "UniqueID": ----, "Format": "AVC", "Format_Profile": "High", "Format_Level": "4.1", "Format_Settings_CABAC": "Yes", "Format_Settings_RefFrames": "4", "CodecID": "V_MPEG4/ISO/AVC", "Duration": "5949.819000000", "BitRate_Mode": "VBR", "BitRate": "17902528", "BitRate_Maximum": "37499904", "Width": "1920", "Height": "1080", "Stored_Height": "1088", "Sampled_Width": "1920", "Sampled_Height": "1080", "PixelAspectRatio": "1.000", "DisplayAspectRatio": "1.778", "FrameRate_Mode": "VFR", "FrameRate": "24.000", "FrameRate_Original": "23.976", "FrameCount": "142904", "ColorSpace": "YUV", "ChromaSubsampling": "4:2:0", "BitDepth": "8", "ScanType": "Progressive", "Delay": "0.042", "StreamSize": "13338028481", "Language": "en", "Default": "Yes", "Forced": "No", "BufferSize": "30000000 / 30000000", "colour_description_present": "Yes", "colour_description_present_Source": "Container", "colour_range": "Limited", "colour_range_Source": "Container", "colour_primaries": "BT.709", "colour_primaries_Source": "Container", "transfer_characteristics": "BT.709", "transfer_characteristics_Source": "Container", "matrix_coefficients": "BT.709", "matrix_coefficients_Source": "Container" },

@karussellbremser
Copy link
Author

karussellbremser commented May 25, 2021

After some investigating, I believe this issue partly to be the result of issue 756: The original amount of frames (as this value is not altered) is divided by the correctly shortened runtime, which results in a higher calculated framerate. (This doesn't explain though why the framerate is changed from CFR (constant framerate) to VFR (variable framerate).)

@mifi
Copy link
Owner

mifi commented Aug 24, 2021

LosslessCut doesn't really do anything with this metadata, so this is all in ffmpeg's hands.

@mifi
Copy link
Owner

mifi commented Aug 24, 2021

You could try to reproduce the issue by running the ffmpeg commands from the command line (Help -> bottom -> last ffmpeg commands) and then selectively remove options and see if it changes anything.

@mifi mifi added ffmpeg Problem resides in ffmpeg or usage of ffmpeg bug labels Aug 24, 2021
@mifi
Copy link
Owner

mifi commented Feb 12, 2022

See also #1027

@mifi
Copy link
Owner

mifi commented Apr 4, 2022

I did some testing in #1096 (comment) and it seems like it's happening even with the simplest ffmpeg command ffmpeg -i in.mkv -t x -c copy out.mkv - did you ever find any workaround for it?

@karussellbremser
Copy link
Author

My workaround is using TMPGEnc MPEG Smart Renderer 6, sorry.

@mifi
Copy link
Owner

mifi commented May 21, 2022

closing in favor of #1096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ffmpeg Problem resides in ffmpeg or usage of ffmpeg
Projects
None yet
Development

No branches or pull requests

2 participants