• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

视频的横竖问题

php 搞代码 3年前 (2022-01-25) 13次浏览 已收录 0个评论
文章目录[隐藏]

我们系统中用户上传到视频多数是客户用手机拍摄的,现在存在一个问题,就是PC浏览器上播放的时候,这个视频是横着的。
大家明白我的意思吗? 实际事物是: 1,但是视频看起来就是: 一 。

现在我想把视频变成是跟实际事物一直的状态。

七牛返回的视频元信息中有rotate:90这样的参数,还有高度和宽度。

我的想法:
1、判断高度和宽度,全部转为高>宽
2、我对rotate这个参数不太理解,这个能代表实际和视频的角度差吗? (百度上出来的全部是imagerotate(),没有视频方面的。ffmpeg也没有提到这个,只是说了一些截图之类的问题。)

考虑到有些视频就是手机横着拍摄的,强制转了不是又出现了偏差?

求助有什么办法可以解决这个问题

我提供一个视频的元信息,大家帮我看看咯,谢谢

streams[1].tags.rotate “rotate”: “90”,

<code>{    "streams": [        {            "index": 0,            "codec_name": "aac",            "codec_long_name": "AAC (Advanced Audio Coding)",            "profile": "LC",            "codec_type": "audio",            "codec_time_base": "1/44100",            "codec_tag_string": "mp4a",            "codec_tag": "0x6134706d",     <b>6本文来源gao@dai!ma.com搞$代^码!网7</b><pre>搞gaodaima代码

“sample_fmt”: “fltp”, “sample_rate”: “44100”, “channels”: 1, “channel_layout”: “mono”, “bits_per_sample”: 0, “r_frame_rate”: “0/0”, “avg_frame_rate”: “0/0”, “time_base”: “1/44100”, “start_pts”: 0, “start_time”: “0.000000”, “duration_ts”: 2408448, “duration”: “54.613333”, “bit_rate”: “89406”, “nb_frames”: “2352”, “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 }, “tags”: { “creation_time”: “2015-11-08 14:36:49”, “language”: “und”, “handler_name”: “Core Media Audio” } }, { “index”: 1, “codec_name”: “h264”, “codec_long_name”: “H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10”, “profile”: “Main”, “codec_type”: “video”, “codec_time_base”: “1/1200”, “codec_tag_string”: “avc1”, “codec_tag”: “0x31637661”, “width”: 480, “height”: 272, “has_b_frames”: 0, “sample_aspect_ratio”: “0:1”, “display_aspect_ratio”: “0:1”, “pix_fmt”: “yuv420p”, “level”: 21, “color_range”: “tv”, “color_space”: “bt709”, “color_transfer”: “bt709”, “color_primaries”: “bt709”, “chroma_location”: “left”, “is_avc”: “1”, “nal_length_size”: “4”, “r_frame_rate”: “30000/1001”, “avg_frame_rate”: “490800/16369”, “time_base”: “1/600”, “start_pts”: 0, “start_time”: “0.000000”, “duration_ts”: 32738, “duration”: “54.563333”, “bit_rate”: “710127”, “bits_per_raw_sample”: “8”, “nb_frames”: “1636”, “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 }, “tags”: { “rotate”: “90”, “creation_time”: “2015-11-08 14:36:49”, “language”: “und”, “handler_name”: “Core Media Video” } } ], “format”: { “nb_streams”: 2, “nb_programs”: 0, “format_name”: “mov,mp4,m4a,3gp,3g2,mj2”, “format_long_name”: “QuickTime / MOV”, “start_time”: “0.000000”, “duration”: “54.563333”, “size”: “5488167”, “bit_rate”: “804667”, “probe_score”: 100, “tags”: { “major_brand”: “mp42”, “minor_version”: “1”, “compatible_brands”: “mp41mp42isom”, “creation_time”: “2015-11-08 14:36:49” } }}

回复内容:


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:视频的横竖问题

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址