iphone - 如何从视频中提取方向信息?

标签 iphone ruby-on-rails ruby iphone-sdk-3.0 ffmpeg

在网上浏览了大量文档后,iPhone 似乎总是以 480x360 的纵横比拍摄视频,并在视频 rails 上应用一个变换矩阵。 (480x360 可能会发生变化,但对于给定的设备始终相同)

这是在iOS项目中修改ffmpeg源并访问矩阵http://www.seqoy.com/correct-orientation-for-iphone-recorded-movies-with-ffmpeg/的方法

这是在 iOS-4 中找到转换矩阵的更简洁的方法
How to detect (iPhone SDK) if a video file was recorded in portrait orientation, or landscape.

如何在以下任一选项中提取视频的方向 -
- iOS 3.2
- ffmpeg(通过命令行服务器端)
- ruby

任何帮助将不胜感激。

最佳答案

由于大多数相机将它们的旋转/方向存储在 exif 元数据中,我建议使用 exifttool 和名为 mini_exiftool 的 ruby 包装 gem 这是积极维护。

安装 exiftool:
apt-get exiftool || brew install exiftool || port install exiftool
或使用任何可用的包管理器

安装 mini_exiftool:
gem install mini_exiftool
试试看:

irb>
require 'mini_exiftool'
movie = MiniExiftool.new('test_movie.mov')
movie.orientation #=> 90

干杯

关于iphone - 如何从视频中提取方向信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41305992/

相关文章:

iphone - 我的 UITabBarController 的 didSelectViewController 方法没有被调用?

iphone - 有没有办法在应用程序中通用设置背景颜色或导航栏?

iphone - CoreText 中的行距和段落对齐

ruby-on-rails - PG::UndefinedTable: 错误: 表 "table-name"不存在

ruby - 由 ruby​​zip 压缩的 xlsx 无法被 Excel 读取

mysql - 通过ruby脚本防止SQL注入(inject)

ios - NSURLErrorDomain错误-1021

ruby-on-rails - form_for [@nested, @resource], remote => true 响应 format.html rails 3.2.6

ruby-on-rails - 在发布具有多个文件字段的表单时从 nginx 获取 400 状态

ruby-on-rails - rails 3 : can't call an ActiveRecord query with the #send method (NoMethodError)