flutter ffmpeg 获取mov视频信息问题

做项目是需要获取视频信息的宽高,在iPhone上使用原相机录得横竖屏视频,app相册选择视频,通过ffmpeg获取到的宽高始终都是1280*720,下面是详细信息

原相机竖屏
flutter:  {refs: 1, avg_frame_rate: 60600/2021, codec_tag_string: avc1, level: 31, side_data_list: [{displaymatrix:
flutter: 00000000:            0       65536           0
flutter: 00000001:       -65536           0           0
flutter: 00000002:     47185920           0  1073741824
flutter: , rotation: -90, side_data_type: Display Matrix}], color_space: bt709, profile: 100, bit_rate: 2809828, duration: 3.368333, codec_type: video, coded_width: 1280, index: 1, pix_fmt: yuv420p, codec_tag: 0x31637661, codec_long_name: unknown, codec_name: h264, nal_length_size: 4, nb_frames: 101, height: 720, color_primaries: bt709, color_range: tv, disposition: {timed_thumbnails: 0, default: 1, original: 0, attached_pic: 0, comment: 0, forced: 0, karaoke: 0, dub: 0, visual_impaired: 0, hearing_impaired: 0, lyrics: 0, clean_effects: 0}, is_avc: true, chroma_location: left, tags: {language: und, encoder: H.264, creation_time: 2021-03-23T02:14:55.000000Z, rotate: 90, handler_name: Core Media Video}, color_transfer: bt709, r_frame_rate: 30000/1001, start_time: 0.000000, has_b_frames: 1, coded_height: 720, bits_per_raw_sample: 8, time_base: 1/600, duration_ts: 2021, codec_time_base: 2021/121200, width: 1280, start_pts: 0}

app 竖屏
{refs: 1, avg_frame_rate: 9800/327, codec_tag_string: avc1, level: 31, color_space: smpte170m, profile: 100, bit_rate: 6628824, duration: 1.621667, codec_type: video, coded_width: 720, index: 1, pix_fmt: yuvj420p, codec_tag: 0x31637661, codec_long_name: unknown, codec_name: h264, nal_length_size: 4, nb_frames: 49, height: 1280, color_primaries: bt709, color_range: pc, disposition: {timed_thumbnails: 0, default: 1, original: 0, attached_pic: 0, comment: 0, forced: 0, karaoke: 0, dub: 0, visual_impaired: 0, hearing_impaired: 0, lyrics: 0, clean_effects: 0}, is_avc: true, chroma_location: left, tags: {language: und, creation_time: 2021-03-23T02:15:54.000000Z, encoder: H.264, handler_name: Core Media Video}, color_transfer: bt709, r_frame_rate: 30000/1001, start_time: 0.000000, has_b_frames: 1, coded_height: 1280, bits_per_raw_sample: 8, time_base: 1/600, duration_ts: 973, codec_time_base: 327/19600, width: 720, start_pts: 0}

原相机横屏
{refs: 1, avg_frame_rate: 11000/367, codec_tag_string: avc1, level: 31, color_space: bt709, profile: 100, bit_rate: 2580878, duration: 3.670000, codec_type: video, coded_width: 1280, index: 1, pix_fmt: yuv420p, codec_tag: 0x31637661, codec_long_name: unknown, codec_name: h264, nal_length_size: 4, nb_frames: 110, height: 720, color_primaries: bt709, color_range: tv, disposition: {timed_thumbnails: 0, default: 1, original: 0, attached_pic: 0, comment: 0, forced: 0, karaoke: 0, dub: 0, visual_impaired: 0, hearing_impaired: 0, lyrics: 0, clean_effects: 0}, is_avc: true, chroma_location: left, tags: {language: und, creation_time: 2021-03-23T02:16:25.000000Z, encoder: H.264, handler_name: Core Media Video}, color_transfer: bt709, r_frame_rate: 30000/1001, start_time: 0.000000, has_b_frames: 1, coded_height: 720, bits_per_raw_sample: 8, time_base: 1/600, duration_ts: 2202, codec_time_base: 367/22000, width: 1280, start_pts: 0}

app 横屏
{refs: 1, avg_frame_rate: 34200/1141, codec_tag_string: avc1, level: 31, color_space: smpte170m, profile: 100, bit_rate: 6722923, duration: 1.901667, codec_type: video, coded_width: 720, index: 1, pix_fmt: yuvj420p, codec_tag: 0x31637661, codec_long_name: unknown, codec_name: h264, nal_length_size: 4, nb_frames: 57, height: 1280, color_primaries: bt709, color_range: pc, disposition: {timed_thumbnails: 0, default: 1, original: 0, attached_pic: 0, comment: 0, forced: 0, karaoke: 0, dub: 0, visual_impaired: 0, hearing_impaired: 0, lyrics: 0, clean_effects: 0}, is_avc: true, chroma_location: left, tags: {language: und, creation_time: 2021-03-23T02:16:56.000000Z, encoder: H.264, handler_name: Core Media Video}, color_transfer: bt709, r_frame_rate: 30000/1001, start_time: 0.016667, has_b_frames: 1, coded_height: 1280, bits_per_raw_sample: 8, time_base: 1/600, duration_ts: 1141, codec_time_base: 1141/68400, width: 720, start_pts: 10}

安卓通过宽高去做横竖屏播放就会出错,改为先转码为MP4,在去获取视频的宽高,得到正确的结果

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 夜莺2517阅读 127,834评论 1 9
  • 版本:ios 1.2.1 亮点: 1.app角标可以实时更新天气温度或选择空气质量,建议处女座就不要选了,不然老想...
    我就是沉沉阅读 11,866评论 1 6
  • 我是黑夜里大雨纷飞的人啊 1 “又到一年六月,有人笑有人哭,有人欢乐有人忧愁,有人惊喜有人失落,有的觉得收获满满有...
    陌忘宇阅读 12,756评论 28 53
  • 兔子虽然是枚小硕 但学校的硕士四人寝不够 就被分到了博士楼里 两人一间 在学校的最西边 靠山 兔子的室友身体不好 ...
    待业的兔子阅读 7,541评论 2 9

友情链接更多精彩内容