小程序自带video组件无法播放录屏的mp4视频?
发布于 5 年前 作者 xiulan42 12002 次浏览 来自 问答

wxml:

<view style="">
  <video id="video" style="width: 100%;" src="{{fileURL}}" controls autoplay show-mute-btn="true" object-fit="fill" enable-auto-rotation="true" title="{{titleName}}"></video>
</view>

MP4视频文件信息(ffprobe):

{
    "streams": [
        {
            "index": 0,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 223232,
            "duration": "4.650667",
            "bit_rate": "3390",
            "max_bit_rate": "128000",
            "nb_frames": "218",
            "disposition": {
                "default": 1,
                "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
            },
            "tags": {
                "creation_time": "2021-03-04T08:39:01.000000Z",
                "language": "eng",
                "handler_name": "Sound Media Handler"
            }
        },
        {
            "index": 1,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "1/80",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 1920,
            "height": 1080,
            "coded_width": 1920,
            "coded_height": 1088,
            "closed_captions": 0,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 42,
            "color_range": "tv",
            "color_space": "smpte170m",
            "color_transfer": "bt470m",
            "color_primaries": "smpte170m",
            "chroma_location": "left",
            "refs": 1,
            "is_avc": "true",
            "nal_length_size": "4",
            "r_frame_rate": "40/1",
            "avg_frame_rate": "40/1",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 5275,
            "duration": "5.275000",
            "bit_rate": "13588094",
            "bits_per_raw_sample": "8",
            "nb_frames": "211",
            "disposition": {
                "default": 1,
                "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
            },
            "tags": {
                "creation_time": "2021-03-04T08:39:01.000000Z",
                "language": "und",
                "handler_name": "Video Media Handler",
                "encoder": "AVC Coding"
            }
        }
    ],
    "format": {
        "filename": "069535620aa94361a75846db00826ee0.mp4",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "5.300000",
        "size": "8967077",
        "bit_rate": "13535210",
        "probe_score": 100,
        "tags": {
            "major_brand": "isom",
            "minor_version": "512",
            "compatible_brands": "isomiso2avc1mp41",
            "creation_time": "2021-03-04T08:39:01.000000Z",
            "encoder": "Lenovo Game Recorder "
        }
    }
}
回到顶部