admin管理员组

文章数量:1340291

I am using mpegts js library for live streaming. We aim to play the live stream urls (.ts format) sent by our users.

The interlaced video below gives a black image in chrome but no problem in firefox

Also the values in mpegjs ts are as follows;

Working;

[TSDemuxer] > Parsed first PMT: {"pid_stream_type":{"256":27,"257":3,"258":6},"common_pids":{"h264":256,"mp3":257},"pes_private_data_pids":{"258":true},"timed_id3_pids":{},"synchronous_klv_pids":{},"asynchronous_klv_pids":{},"scte_35_pids":{},"smpte2038_pids":{},"program_number":1,"version_number":0,"pcr_pid":256}

Not Working;

[TSDemuxer] > Parsed first PMT: {"pid_stream_type":{"256":27,"257":3},"common_pids":{"h264":256,"mp3":257},"pes_private_data_pids":{},"timed_id3_pids":{},"synchronous_klv_pids":{},"asynchronous_klv_pids":{},"scte_35_pids":{},"smpte2038_pids":{},"program_number":1,"version_number":0,"pcr_pid":256}

The only difference between the two is the value 258:6

I can run it in Firefox with the same code, but not in Chrome.

I am not familiar with codecs, remux and demux so I don't know where to start

UPDATE

When I compared the video, I saw that one is field_order: tt in ffprobe and the other is progressive

Below is a comparison of 2 videos

Working video;

{
    "programs": [
        {
            "program_id": 1,
            "program_num": 1,
            "nb_streams": 2,
            "pmt_pid": 4096,
            "pcr_pid": 256,
            "tags": {
                "service_name": "Service01",
                "service_provider": "FFmpeg"
            },
            "streams": [
                {
                    "index": 0,
                    "codec_name": "h264",
                    "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                    "profile": "High",
                    "codec_type": "video",
                    "codec_tag_string": "[27][0][0][0]",
                    "codec_tag": "0x001b",
                    "width": 1280,
                    "height": 720,
                    "coded_width": 1280,
                    "coded_height": 720,
                    "closed_captions": 0,
                    "film_grain": 0,
                    "has_b_frames": 2,
                    "sample_aspect_ratio": "1:1",
                    "display_aspect_ratio": "16:9",
                    "pix_fmt": "yuv420p",
                    "level": 31,
                    "color_range": "tv",
                    "color_space": "bt709",
                    "color_transfer": "bt709",
                    "color_primaries": "bt709",
                    "chroma_location": "left",
                    "field_order": "progressive",
                    "refs": 1,
                    "is_avc": "false",
                    "nal_length_size": "0",
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x100",
                    "r_frame_rate": "25/1",
                    "avg_frame_rate": "25/1",
                    "time_base": "1/90000",
                    "start_pts": 133200,
                    "start_time": "1.480000",
                    "duration_ts": 2710800,
                    "duration": "30.120000",
                    "bits_per_raw_sample": "8",
                    "extradata_size": 51,
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                },
                {
                    "index": 1,
                    "codec_name": "aac",
                    "codec_long_name": "AAC (Advanced Audio Coding)",
                    "profile": "LC",
                    "codec_type": "audio",
                    "codec_tag_string": "[15][0][0][0]",
                    "codec_tag": "0x000f",
                    "sample_fmt": "fltp",
                    "sample_rate": "48000",
                    "channels": 2,
                    "channel_layout": "stereo",
                    "bits_per_sample": 0,
                    "initial_padding": 0,
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x101",
                    "r_frame_rate": "0/0",
                    "avg_frame_rate": "0/0",
                    "time_base": "1/90000",
                    "start_pts": 127200,
                    "start_time": "1.413333",
                    "duration_ts": 2693760,
                    "duration": "29.930667",
                    "bit_rate": "131241",
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                }
            ]
        }
    ],
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_tag_string": "[27][0][0][0]",
            "codec_tag": "0x001b",
            "width": 1280,
            "height": 720,
            "coded_width": 1280,
            "coded_height": 720,
            "closed_captions": 0,
            "film_grain": 0,
            "has_b_frames": 2,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 31,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "chroma_location": "left",
            "field_order": "progressive",
            "refs": 1,
            "is_avc": "false",
            "nal_length_size": "0",
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x100",
            "r_frame_rate": "25/1",
            "avg_frame_rate": "25/1",
            "time_base": "1/90000",
            "start_pts": 133200,
            "start_time": "1.480000",
            "duration_ts": 2710800,
            "duration": "30.120000",
            "bits_per_raw_sample": "8",
            "extradata_size": 51,
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_tag_string": "[15][0][0][0]",
            "codec_tag": "0x000f",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "initial_padding": 0,
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x101",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 127200,
            "start_time": "1.413333",
            "duration_ts": 2693760,
            "duration": "29.930667",
            "bit_rate": "131241",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        }
    ],
    "chapters": [

    ],
    "format": {
        "filename": ".\\working.ts",
        "nb_streams": 2,
        "nb_programs": 1,
        "nb_stream_groups": 0,
        "format_name": "mpegts",
        "format_long_name": "MPEG-TS (MPEG-2 Transport Stream)",
        "start_time": "1.413333",
        "duration": "30.186667",
        "size": "5310060",
        "bit_rate": "1407259",
        "probe_score": 50
    }
}

Not working;

{
    "programs": [
        {
            "program_id": 1,
            "program_num": 1,
            "nb_streams": 2,
            "pmt_pid": 4096,
            "pcr_pid": 256,
            "tags": {
                "service_name": "Service01",
                "service_provider": "FFmpeg"
            },
            "streams": [
                {
                    "index": 0,
                    "codec_name": "h264",
                    "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                    "profile": "High",
                    "codec_type": "video",
                    "codec_tag_string": "[27][0][0][0]",
                    "codec_tag": "0x001b",
                    "width": 1920,
                    "height": 1080,
                    "coded_width": 1920,
                    "coded_height": 1080,
                    "closed_captions": 0,
                    "film_grain": 0,
                    "has_b_frames": 1,
                    "sample_aspect_ratio": "1:1",
                    "display_aspect_ratio": "16:9",
                    "pix_fmt": "yuv420p",
                    "level": 40,
                    "color_range": "tv",
                    "color_space": "bt709",
                    "color_transfer": "bt709",
                    "color_primaries": "bt709",
                    "chroma_location": "left",
                    "field_order": "tt",
                    "refs": 1,
                    "is_avc": "false",
                    "nal_length_size": "0",
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x100",
                    "r_frame_rate": "25/1",
                    "avg_frame_rate": "25/1",
                    "time_base": "1/90000",
                    "start_pts": 136800,
                    "start_time": "1.520000",
                    "duration_ts": 2703600,
                    "duration": "30.040000",
                    "bits_per_raw_sample": "8",
                    "extradata_size": 91,
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                },
                {
                    "index": 1,
                    "codec_name": "mp2",
                    "codec_long_name": "MP2 (MPEG audio layer 2)",
                    "codec_type": "audio",
                    "codec_tag_string": "[3][0][0][0]",
                    "codec_tag": "0x0003",
                    "sample_fmt": "fltp",
                    "sample_rate": "48000",
                    "channels": 2,
                    "channel_layout": "stereo",
                    "bits_per_sample": 0,
                    "initial_padding": 0,
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x101",
                    "r_frame_rate": "0/0",
                    "avg_frame_rate": "0/0",
                    "time_base": "1/90000",
                    "start_pts": 127492,
                    "start_time": "1.416578",
                    "duration_ts": 2697840,
                    "duration": "29.976000",
                    "bit_rate": "256000",
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                }
            ]
        }
    ],
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_tag_string": "[27][0][0][0]",
            "codec_tag": "0x001b",
            "width": 1920,
            "height": 1080,
            "coded_width": 1920,
            "coded_height": 1080,
            "closed_captions": 0,
            "film_grain": 0,
            "has_b_frames": 1,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 40,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "chroma_location": "left",
            "field_order": "tt",
            "refs": 1,
            "is_avc": "false",
            "nal_length_size": "0",
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x100",
            "r_frame_rate": "25/1",
            "avg_frame_rate": "25/1",
            "time_base": "1/90000",
            "start_pts": 136800,
            "start_time": "1.520000",
            "duration_ts": 2703600,
            "duration": "30.040000",
            "bits_per_raw_sample": "8",
            "extradata_size": 91,
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        },
        {
            "index": 1,
            "codec_name": "mp2",
            "codec_long_name": "MP2 (MPEG audio layer 2)",
            "codec_type": "audio",
            "codec_tag_string": "[3][0][0][0]",
            "codec_tag": "0x0003",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "initial_padding": 0,
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x101",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 127492,
            "start_time": "1.416578",
            "duration_ts": 2697840,
            "duration": "29.976000",
            "bit_rate": "256000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        }
    ],
    "chapters": [

    ],
    "format": {
        "filename": ".\\notworking.ts",
        "nb_streams": 2,
        "nb_programs": 1,
        "nb_stream_groups": 0,
        "format_name": "mpegts",
        "format_long_name": "MPEG-TS (MPEG-2 Transport Stream)",
        "start_time": "1.416578",
        "duration": "30.143422",
        "size": "24900600",
        "bit_rate": "6608566",
        "probe_score": 50
    }
}

I am using mpegts js library for live streaming. We aim to play the live stream urls (.ts format) sent by our users.

The interlaced video below gives a black image in chrome but no problem in firefox

Also the values in mpegjs ts are as follows;

Working;

[TSDemuxer] > Parsed first PMT: {"pid_stream_type":{"256":27,"257":3,"258":6},"common_pids":{"h264":256,"mp3":257},"pes_private_data_pids":{"258":true},"timed_id3_pids":{},"synchronous_klv_pids":{},"asynchronous_klv_pids":{},"scte_35_pids":{},"smpte2038_pids":{},"program_number":1,"version_number":0,"pcr_pid":256}

Not Working;

[TSDemuxer] > Parsed first PMT: {"pid_stream_type":{"256":27,"257":3},"common_pids":{"h264":256,"mp3":257},"pes_private_data_pids":{},"timed_id3_pids":{},"synchronous_klv_pids":{},"asynchronous_klv_pids":{},"scte_35_pids":{},"smpte2038_pids":{},"program_number":1,"version_number":0,"pcr_pid":256}

The only difference between the two is the value 258:6

I can run it in Firefox with the same code, but not in Chrome.

I am not familiar with codecs, remux and demux so I don't know where to start

UPDATE

When I compared the video, I saw that one is field_order: tt in ffprobe and the other is progressive

Below is a comparison of 2 videos

Working video;

{
    "programs": [
        {
            "program_id": 1,
            "program_num": 1,
            "nb_streams": 2,
            "pmt_pid": 4096,
            "pcr_pid": 256,
            "tags": {
                "service_name": "Service01",
                "service_provider": "FFmpeg"
            },
            "streams": [
                {
                    "index": 0,
                    "codec_name": "h264",
                    "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                    "profile": "High",
                    "codec_type": "video",
                    "codec_tag_string": "[27][0][0][0]",
                    "codec_tag": "0x001b",
                    "width": 1280,
                    "height": 720,
                    "coded_width": 1280,
                    "coded_height": 720,
                    "closed_captions": 0,
                    "film_grain": 0,
                    "has_b_frames": 2,
                    "sample_aspect_ratio": "1:1",
                    "display_aspect_ratio": "16:9",
                    "pix_fmt": "yuv420p",
                    "level": 31,
                    "color_range": "tv",
                    "color_space": "bt709",
                    "color_transfer": "bt709",
                    "color_primaries": "bt709",
                    "chroma_location": "left",
                    "field_order": "progressive",
                    "refs": 1,
                    "is_avc": "false",
                    "nal_length_size": "0",
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x100",
                    "r_frame_rate": "25/1",
                    "avg_frame_rate": "25/1",
                    "time_base": "1/90000",
                    "start_pts": 133200,
                    "start_time": "1.480000",
                    "duration_ts": 2710800,
                    "duration": "30.120000",
                    "bits_per_raw_sample": "8",
                    "extradata_size": 51,
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                },
                {
                    "index": 1,
                    "codec_name": "aac",
                    "codec_long_name": "AAC (Advanced Audio Coding)",
                    "profile": "LC",
                    "codec_type": "audio",
                    "codec_tag_string": "[15][0][0][0]",
                    "codec_tag": "0x000f",
                    "sample_fmt": "fltp",
                    "sample_rate": "48000",
                    "channels": 2,
                    "channel_layout": "stereo",
                    "bits_per_sample": 0,
                    "initial_padding": 0,
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x101",
                    "r_frame_rate": "0/0",
                    "avg_frame_rate": "0/0",
                    "time_base": "1/90000",
                    "start_pts": 127200,
                    "start_time": "1.413333",
                    "duration_ts": 2693760,
                    "duration": "29.930667",
                    "bit_rate": "131241",
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                }
            ]
        }
    ],
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_tag_string": "[27][0][0][0]",
            "codec_tag": "0x001b",
            "width": 1280,
            "height": 720,
            "coded_width": 1280,
            "coded_height": 720,
            "closed_captions": 0,
            "film_grain": 0,
            "has_b_frames": 2,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 31,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "chroma_location": "left",
            "field_order": "progressive",
            "refs": 1,
            "is_avc": "false",
            "nal_length_size": "0",
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x100",
            "r_frame_rate": "25/1",
            "avg_frame_rate": "25/1",
            "time_base": "1/90000",
            "start_pts": 133200,
            "start_time": "1.480000",
            "duration_ts": 2710800,
            "duration": "30.120000",
            "bits_per_raw_sample": "8",
            "extradata_size": 51,
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_tag_string": "[15][0][0][0]",
            "codec_tag": "0x000f",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "initial_padding": 0,
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x101",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 127200,
            "start_time": "1.413333",
            "duration_ts": 2693760,
            "duration": "29.930667",
            "bit_rate": "131241",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        }
    ],
    "chapters": [

    ],
    "format": {
        "filename": ".\\working.ts",
        "nb_streams": 2,
        "nb_programs": 1,
        "nb_stream_groups": 0,
        "format_name": "mpegts",
        "format_long_name": "MPEG-TS (MPEG-2 Transport Stream)",
        "start_time": "1.413333",
        "duration": "30.186667",
        "size": "5310060",
        "bit_rate": "1407259",
        "probe_score": 50
    }
}

Not working;

{
    "programs": [
        {
            "program_id": 1,
            "program_num": 1,
            "nb_streams": 2,
            "pmt_pid": 4096,
            "pcr_pid": 256,
            "tags": {
                "service_name": "Service01",
                "service_provider": "FFmpeg"
            },
            "streams": [
                {
                    "index": 0,
                    "codec_name": "h264",
                    "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                    "profile": "High",
                    "codec_type": "video",
                    "codec_tag_string": "[27][0][0][0]",
                    "codec_tag": "0x001b",
                    "width": 1920,
                    "height": 1080,
                    "coded_width": 1920,
                    "coded_height": 1080,
                    "closed_captions": 0,
                    "film_grain": 0,
                    "has_b_frames": 1,
                    "sample_aspect_ratio": "1:1",
                    "display_aspect_ratio": "16:9",
                    "pix_fmt": "yuv420p",
                    "level": 40,
                    "color_range": "tv",
                    "color_space": "bt709",
                    "color_transfer": "bt709",
                    "color_primaries": "bt709",
                    "chroma_location": "left",
                    "field_order": "tt",
                    "refs": 1,
                    "is_avc": "false",
                    "nal_length_size": "0",
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x100",
                    "r_frame_rate": "25/1",
                    "avg_frame_rate": "25/1",
                    "time_base": "1/90000",
                    "start_pts": 136800,
                    "start_time": "1.520000",
                    "duration_ts": 2703600,
                    "duration": "30.040000",
                    "bits_per_raw_sample": "8",
                    "extradata_size": 91,
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                },
                {
                    "index": 1,
                    "codec_name": "mp2",
                    "codec_long_name": "MP2 (MPEG audio layer 2)",
                    "codec_type": "audio",
                    "codec_tag_string": "[3][0][0][0]",
                    "codec_tag": "0x0003",
                    "sample_fmt": "fltp",
                    "sample_rate": "48000",
                    "channels": 2,
                    "channel_layout": "stereo",
                    "bits_per_sample": 0,
                    "initial_padding": 0,
                    "ts_id": "1",
                    "ts_packetsize": "188",
                    "id": "0x101",
                    "r_frame_rate": "0/0",
                    "avg_frame_rate": "0/0",
                    "time_base": "1/90000",
                    "start_pts": 127492,
                    "start_time": "1.416578",
                    "duration_ts": 2697840,
                    "duration": "29.976000",
                    "bit_rate": "256000",
                    "disposition": {
                        "default": 0,
                        "dub": 0,
                        "original": 0,
                        "comment": 0,
                        "lyrics": 0,
                        "karaoke": 0,
                        "forced": 0,
                        "hearing_impaired": 0,
                        "visual_impaired": 0,
                        "clean_effects": 0,
                        "attached_pic": 0,
                        "timed_thumbnails": 0,
                        "non_diegetic": 0,
                        "captions": 0,
                        "descriptions": 0,
                        "metadata": 0,
                        "dependent": 0,
                        "still_image": 0,
                        "multilayer": 0
                    }
                }
            ]
        }
    ],
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_tag_string": "[27][0][0][0]",
            "codec_tag": "0x001b",
            "width": 1920,
            "height": 1080,
            "coded_width": 1920,
            "coded_height": 1080,
            "closed_captions": 0,
            "film_grain": 0,
            "has_b_frames": 1,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 40,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "chroma_location": "left",
            "field_order": "tt",
            "refs": 1,
            "is_avc": "false",
            "nal_length_size": "0",
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x100",
            "r_frame_rate": "25/1",
            "avg_frame_rate": "25/1",
            "time_base": "1/90000",
            "start_pts": 136800,
            "start_time": "1.520000",
            "duration_ts": 2703600,
            "duration": "30.040000",
            "bits_per_raw_sample": "8",
            "extradata_size": 91,
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        },
        {
            "index": 1,
            "codec_name": "mp2",
            "codec_long_name": "MP2 (MPEG audio layer 2)",
            "codec_type": "audio",
            "codec_tag_string": "[3][0][0][0]",
            "codec_tag": "0x0003",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "initial_padding": 0,
            "ts_id": "1",
            "ts_packetsize": "188",
            "id": "0x101",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 127492,
            "start_time": "1.416578",
            "duration_ts": 2697840,
            "duration": "29.976000",
            "bit_rate": "256000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0,
                "non_diegetic": 0,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0,
                "multilayer": 0
            }
        }
    ],
    "chapters": [

    ],
    "format": {
        "filename": ".\\notworking.ts",
        "nb_streams": 2,
        "nb_programs": 1,
        "nb_stream_groups": 0,
        "format_name": "mpegts",
        "format_long_name": "MPEG-TS (MPEG-2 Transport Stream)",
        "start_time": "1.416578",
        "duration": "30.143422",
        "size": "24900600",
        "bit_rate": "6608566",
        "probe_score": 50
    }
}
Share Improve this question edited Mar 4 at 20:55 VC.One 16k4 gold badges27 silver badges61 bronze badges asked Feb 27 at 7:39 ciaksoyciaksoy 591 silver badge14 bronze badges 2
  • I think this PR will fix your issue. But it is still in draft state. So you need to fork the repo and merge it or manually add the code. – Raghavendra N Commented Mar 2 at 7:33
  • @ciaksoy A question about a "not working video" needs an example of that same problematic file (or some bytes of it). Can you share the bytes of the first TS file that you receive and try sending to your player? (see Google for tutorials about how to save an Array or Buffer as a file). – VC.One Commented Mar 5 at 15:27
Add a comment  | 

1 Answer 1

Reset to default 0

Your issue is likely due to keyframe handling rather than the BT.709 color space. Both Chrome and Firefox support H.264 (avc1.640028), and BT.709 color space is standard for HD video. The key difference is how these browsers decode video streams.

Chrome's Media Source Extensions (MSE) expects an IDR (Instantaneous Decoder Refresh) keyframe at the start of the stream. If your TS segment starts in the middle of a GOP (Group of Pictures), Chrome may refuse to decode it, while Firefox might handle it more gracefully.

Also bare in mind that Chrome does not natively support .ts files in <video>. If you're using mpegts.js for transmuxing TS into MP4, Chrome's stricter decoding path may be rejecting the stream due to missing metadata or keyframe alignment.

Configure your encoder to use closed GOPs and force IDR frames at segment starts. ffprobe -select_streams v -show_frames -show_entries frame=pict_type input.ts | grep pict_type

If the first keyframe isn't IDR, Chrome will likely fail.

本文标签: javascriptMpegts js avc1640028 Interlaced video not playing on ChromeStack Overflow