MediaInfoLib icon indicating copy to clipboard operation
MediaInfoLib copied to clipboard

EIA-608 subtitles not detected in MKV file while TS works

Open ptr727 opened this issue 7 months ago • 2 comments

I understand that the media is only scanned for 30s looking for EIA-608 subs, but I found that subs are not detected in some long media files, but are detected if I trim the first 30s of the same file.

Maybe there is more to just 30s, or maybe my test to mux to TS is not valid, or maybe a bug?

Testing on Win11, using CLI.

MediaInfo.exe --version
MediaInfo Command line,
MediaInfoLib - v25.03
MediaInfo.exe --Output=JSON '.\H264_AAC (2).mkv'
{
    "creatingLibrary": {
        "name": "MediaInfoLib",
        "version": "25.03",
        "url": "https://mediaarea.net/MediaInfo"
    },
    "media": {
        "@ref": "D:\\CC\\H264_AAC (2).mkv",
        "track": [
            {
                "@type": "General",
                "UniqueID": "1276950059678257242263597685740268099",
                "VideoCount": "1",
                "AudioCount": "1",
                "FileExtension": "mkv",
                "Format": "Matroska",
                "Format_Version": "2",
                "FileSize": "810376285",
                "Duration": "1709.950",
                "OverallBitRate_Mode": "VBR",
                "OverallBitRate": "3791345",
                "FrameRate": "23.976",
                "FrameCount": "40998",
                "IsStreamable": "No",
                "File_Created_Date": "2025-04-18 18:51:09.486 UTC",
                "File_Created_Date_Local": "2025-04-18 11:51:09.486",
                "File_Modified_Date": "2017-10-10 02:41:50.543 UTC",
                "File_Modified_Date_Local": "2017-10-09 19:41:50.543",
                "Encoded_Application": "Lavf54.63.104",
                "Encoded_Library": "Lavf54.63.104"
            },
            {
                "@type": "Video",
                "StreamOrder": "0",
                "ID": "1",
                "UniqueID": "1",
                "Format": "AVC",
                "Format_Profile": "High",
                "Format_Level": "4",
                "Format_Settings_CABAC": "Yes",
                "Format_Settings_RefFrames": "4",
                "CodecID": "V_MPEG4/ISO/AVC",
                "Duration": "1709.960",
                "BitRate_Mode": "VBR",
                "BitRate_Maximum": "4509952",
                "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",
                "FrameRate_Num": "24000",
                "FrameRate_Den": "1001",
                "FrameCount": "40998",
                "ColorSpace": "YUV",
                "ChromaSubsampling": "4:2:0",
                "BitDepth": "8",
                "ScanType": "Progressive",
                "Delay": "0.200",
                "Delay_Source": "Container",
                "Language": "en",
                "Default": "No",
                "Forced": "No",
                "BufferSize": "5412000"
            },
            {
                "@type": "Audio",
                "StreamOrder": "1",
                "ID": "2",
                "UniqueID": "2",
                "Format": "AAC",
                "Format_AdditionalFeatures": "LC",
                "CodecID": "A_AAC-2",
                "Duration": "1709.950",
                "Channels": "2",
                "ChannelPositions": "Front: L R",
                "ChannelLayout": "L R",
                "SamplesPerFrame": "1024",
                "SamplingRate": "48000",
                "SamplingCount": "82077600",
                "FrameRate": "46.875",
                "Compression_Mode": "Lossy",
                "Delay": "0.200",
                "Delay_Source": "Container",
                "Video_Delay": "0.000",
                "Language": "en",
                "Default": "Yes",
                "Forced": "No"
            }
        ]
    }
}
ffmpeg.exe -hide_banner -report -loglevel error -i '.\H264_AAC (2).mkv' -map 0:v:0 -c:v:0 copy -a53cc 1 -an -sn -y -t 30 -f mpegts tmp.ts
{
    "creatingLibrary": {
        "name": "MediaInfoLib",
        "version": "25.03",
        "url": "https://mediaarea.net/MediaInfo"
    },
    "media": {
        "@ref": "D:\\CC\\H264_AAC (2).temp.ts",
        "track": [
            {
                "@type": "General",
                "ID": "1",
                "VideoCount": "1",
                "TextCount": "1",
                "MenuCount": "1",
                "FileExtension": "ts",
                "Format": "MPEG-TS",
                "FileSize": "14020664",
                "Duration": "30.278107088",
                "OverallBitRate_Mode": "VBR",
                "OverallBitRate": "3704502",
                "FrameRate": "23.976",
                "FrameCount": "723",
                "StreamSize": "746743",
                "File_Created_Date": "2025-04-19 20:12:38.804 UTC",
                "File_Created_Date_Local": "2025-04-19 13:12:38.804",
                "File_Modified_Date": "2025-04-19 20:12:38.816 UTC",
                "File_Modified_Date_Local": "2025-04-19 13:12:38.816",
                "extra": {
                    "OverallBitRate_Precision_Min": "3704440",
                    "OverallBitRate_Precision_Max": "3704564"
                }
            },
            {
                "@type": "Video",
                "StreamOrder": "0-0",
                "ID": "256",
                "MenuID": "1",
                "Format": "AVC",
                "Format_Profile": "High",
                "Format_Level": "4",
                "Format_Settings_CABAC": "Yes",
                "Format_Settings_RefFrames": "4",
                "CodecID": "27",
                "Duration": "30.155",
                "BitRate_Mode": "VBR",
                "BitRate": "3521500",
                "BitRate_Maximum": "4509952",
                "Width": "1920",
                "Height": "1080",
                "Stored_Height": "1088",
                "Sampled_Width": "1920",
                "Sampled_Height": "1080",
                "PixelAspectRatio": "1.000",
                "DisplayAspectRatio": "1.778",
                "FrameRate": "23.976",
                "FrameRate_Num": "24000",
                "FrameRate_Den": "1001",
                "FrameCount": "723",
                "ColorSpace": "YUV",
                "ChromaSubsampling": "4:2:0",
                "BitDepth": "8",
                "ScanType": "Progressive",
                "Delay": "1.400000000",
                "Delay_Source": "Container",
                "StreamSize": "13273921",
                "BufferSize": "5412000"
            },
            {
                "@type": "Text",
                "StreamOrder": "0-0",
                "ID": "256-CC1",
                "MenuID": "1",
                "Format": "EIA-608",
                "MuxingMode": "SCTE 128 / DTVCC Transport",
                "MuxingMode_MoreInfo": "Muxed in Video #1",
                "Duration": "30.155",
                "Duration_Start2End": "23.649000",
                "Duration_Start_Command": "5.904000",
                "Duration_Start": "6.530000",
                "Duration_End": "30.179000",
                "BitRate_Mode": "CBR",
                "Delay": "1.400000000",
                "Delay_Source": "Container",
                "Video_Delay": "0.000",
                "StreamSize": "0",
                "Events_Total": "10",
                "Events_PopOn": "10",
                "Lines_Count": "25",
                "Lines_MaxCountPerEvent": "3",
                "FirstDisplay_Delay_Frames": "124",
                "FirstDisplay_Type": "PopOn",
                "extra": {
                    "CaptionServiceName": "CC1",
                    "CaptionServiceDescriptor_IsPresent": "No"
                }
            },
            {
                "@type": "Menu",
                "StreamOrder": "0",
                "ID": "4096",
                "MenuID": "1",
                "Format": "AVC",
                "Duration": "29.905000000",
                "Delay": "0.700000000",
                "List_StreamKind": "1",
                "List_StreamPos": "0",
                "ServiceName": "Service01",
                "ServiceProvider": "FFmpeg",
                "ServiceType": "digital television",
                "extra": {
                    "pointer_field": "0",
                    "section_length": "18"
                }
            }
        ]
    }
}

Note EIA-608 is now detected?

ptr727 avatar Apr 19 '25 20:04 ptr727

I did some more experimentation, and I suspect the issue is the TS vs. MKV container.
If I repeat the same test, but use matroska instead of mpegts as container, the CC's are not detected.
So this looks more like a problem with MKV not being supported vs. the duration/soze of the content?

ffmpeg.exe -hide_banner -report -loglevel error -i '.\H264_AAC (2).mkv' -map 0:v:0 -c:v:0 copy -a53cc 1 -an -sn -y -t 30 -f matroska tmp.mkv
MediaInfo.exe --Output=JSON '.\tmp.mkv'
{
    "creatingLibrary": {
        "name": "MediaInfoLib",
        "version": "25.03",
        "url": "https://mediaarea.net/MediaInfo"
    },
    "media": {
        "@ref": ".\\tmp.mkv",
        "track": [
            {
                "@type": "General",
                "UniqueID": "286030497414563313903320596319953219468",
                "VideoCount": "1",
                "FileExtension": "mkv",
                "Format": "Matroska",
                "Format_Version": "4",
                "FileSize": "13551947",
                "Duration": "30.154",
                "OverallBitRate_Mode": "VBR",
                "OverallBitRate": "3595396",
                "StreamSize": "269684",
                "IsStreamable": "Yes",
                "File_Created_Date": "2025-04-19 23:50:31.807 UTC",
                "File_Created_Date_Local": "2025-04-19 16:50:31.807",
                "File_Modified_Date": "2025-04-19 23:50:31.839 UTC",
                "File_Modified_Date_Local": "2025-04-19 16:50:31.839",
                "Encoded_Application": "Lavf61.7.100",
                "Encoded_Library": "Lavf61.7.100",
                "extra": {
                    "ErrorDetectionType": "Per level 1"
                }
            },
            {
                "@type": "Video",
                "StreamOrder": "0",
                "ID": "1",
                "UniqueID": "1742207311127987798",
                "Format": "AVC",
                "Format_Profile": "High",
                "Format_Level": "4",
                "Format_Settings_CABAC": "Yes",
                "Format_Settings_RefFrames": "4",
                "CodecID": "V_MPEG4/ISO/AVC",
                "Duration": "30.154000000",
                "BitRate_Mode": "VBR",
                "BitRate": "3523848",
                "BitRate_Maximum": "4509952",
                "Width": "1920",
                "Height": "1080",
                "Stored_Height": "1088",
                "Sampled_Width": "1920",
                "Sampled_Height": "1080",
                "PixelAspectRatio": "1.000",
                "DisplayAspectRatio": "1.778",
                "FrameRate_Mode": "VFR",
                "FrameRate_Num": "24000",
                "FrameRate_Den": "1001",
                "FrameRate_Original": "23.976",
                "ColorSpace": "YUV",
                "ChromaSubsampling": "4:2:0",
                "BitDepth": "8",
                "ScanType": "Interlaced",
                "ScanType_Original": "Progressive",
                "ScanOrder": "TFF",
                "Delay": "0.000",
                "Delay_Source": "Container",
                "StreamSize": "13282263",
                "Language": "en",
                "Default": "No",
                "Forced": "No",
                "BufferSize": "5412000"
            }
        ]
    }
}

Note EIA-608 is not detected?

ptr727 avatar Apr 19 '25 23:04 ptr727

Maybe there is more to just 30s, or maybe my test to mux to TS is not valid, or maybe a bug?

Checking the code, we didn't implemented yet the support of more than 1 stream kind in a track for MKV, in addition to no seek in the middle of the stream.


Accepted.

Warning: non-paid feature request are set to low priority, we don't know when we have time to handle it. If you desire to accelerate the development, don't hesitate to contact us for a quotation.

JeromeMartinez avatar Apr 20 '25 09:04 JeromeMartinez