我试图找出通过Carrierwave上传的视频是否使用H.264进行编码。到目前为止,我尝试了MiniExiftool gem,因为它让我可以读取文件的元数据。但是,我没有在任何地方看到它。也许就在那里,我只是错过了它。任何帮助,建议或指导?我很感激。这是我使用MiniExiftool.new @file.path
时得到的结果。
=> #<MiniExiftool:0x007f7f82884628 @opts={:numerical=>false, :composite=>true, :
ignore_minor_errors=>false, :replace_invalid_chars=>false, :timestamps=>Time}, @
values={"exiftoolversion"=>8.9, "filesize"=>"35 MB", "filemodifydate"=>2014-04-2
8 18:46:51 +0000, "filepermissions"=>"rw-r--r--", "filetype"=>"MP4", "mimetype"=
>"video/mp4", "majorbrand"=>"MP4 Base Media v1 [IS0 14496-12:2003]", "minorvers
ion"=>"0.0.0", "compatiblebrands"=>["isom", "3gp4"], "movieheaderversion"=>0, "c
reatedate"=>2014-04-23 14:56:19 +0000, "modifydate"=>2014-04-23 14:56:19 +0000,
"timescale"=>1000, "duration"=>"14.28 s", "preferredrate"=>1, "preferredvolume"=
>"100.00%", "previewtime"=>"0 s", "previewduration"=>"0 s", "postertime"=>"0 s",
"selectiontime"=>"0 s", "selectionduration"=>"0 s", "currenttime"=>"0 s", "next
trackid"=>3, "trackheaderversion"=>0, "trackcreatedate"=>2014-04-23 14:56:19 +00
00, "trackmodifydate"=>2014-04-23 14:56:19 +0000, "trackid"=>1, "trackduration"=
>"13.90 s", "tracklayer"=>0, "trackvolume"=>"0.00%", "imagewidth"=>1920, "imageh
eight"=>1080, "graphicsmode"=>"srcCopy", "opcolor"=>"0 0 0", "compressorid"=>"av
c1", "sourceimagewidth"=>1920, "sourceimageheight"=>1080, "xresolution"=>72, "yr
esolution"=>72, "bitdepth"=>24, "videoframerate"=>29.998, "matrixstructure"=>"1
0 0 0 1 0 0 0 1", "mediaheaderversion"=>0, "mediacreatedate"=>2014-04-23 14:56:1
9 +0000, "mediamodifydate"=>2014-04-23 14:56:19 +0000, "mediatimescale"=>48000,
"mediaduration"=>"14.28 s", "handlertype"=>"Audio Track", "handlerdescription"=>
"SoundHandle", "balance"=>0, "audioformat"=>"mp4a", "audiochannels"=>2, "audiobi
tspersample"=>16, "audiosamplerate"=>48000, "moviedatasize"=>36819481, "avgbitra
te"=>"20.6 Mbps", "imagesize"=>"1920x1080", "rotation"=>0}, @changed_values={},
@errors={}, @filename="/home/user/uploads/dbrvp74x6r.mp4", @output="[{\n \"SourceFile\": \"home/user/uploads/dbrvp74x6r.mp4\",\n \"ExifToolVersion\": 8.90,\n \"FileName\": \"dbrvp74x6r.mp4\",\n
\"Directory\": \"home/user/uploads\",\n \"FileSize\": \"35 MB\",\n \"FileModifyDate\": \"2014:0
4:28 18:46:51+00:00\",\n \"FilePermissions\": \"rw-r--r--\",\n \"FileType\": \
"MP4\",\n \"MIMEType\": \"video/mp4\",\n \"MajorBrand\": \"MP4 Base Media v1
[IS0 14496-12:2003]\",\n \"MinorVersion\": \"0.0.0\",\n \"CompatibleBrands\":
[\"isom\",\"3gp4\"],\n \"MovieHeaderVersion\": 0,\n \"CreateDate\": \"2014:04:
23 14:56:19\",\n \"ModifyDate\": \"2014:04:23 14:56:19\",\n \"TimeScale\": 100
0,\n \"Duration\": \"14.28 s\",\n \"PreferredRate\": 1,\n \"PreferredVolume\"
: \"100.00%\",\n \"PreviewTime\": \"0 s\",\n \"PreviewDuration\": \"0 s\",\n
\"PosterTime\": \"0 s\",\n \"SelectionTime\": \"0 s\",\n \"SelectionDuration\"
: \"0 s\",\n \"CurrentTime\": \"0 s\",\n \"NextTrackID\": 3,\n \"TrackHeaderV
ersion\": 0,\n \"TrackCreateDate\": \"2014:04:23 14:56:19\",\n \"TrackModifyDa
te\": \"2014:04:23 14:56:19\",\n \"TrackID\": 1,\n \"TrackDuration\": \"13.90
s\",\n \"TrackLayer\": 0,\n \"TrackVolume\": \"0.00%\",\n \"ImageWidth\": 192
0,\n \"ImageHeight\": 1080,\n \"GraphicsMode\": \"srcCopy\",\n \"OpColor\": \
"0 0 0\",\n \"CompressorID\": \"avc1\",\n \"SourceImageWidth\": 1920,\n \"Sou
rceImageHeight\": 1080,\n \"XResolution\": 72,\n \"YResolution\": 72,\n \"Bit
Depth\": 24,\n \"VideoFrameRate\": 29.998,\n \"MatrixStructure\": \"1 0 0 0 1
0 0 0 1\",\n \"MediaHeaderVersion\": 0,\n \"MediaCreateDate\": \"2014:04:23 14
:56:19\",\n \"MediaModifyDate\": \"2014:04:23 14:56:19\",\n \"MediaTimeScale\"
: 48000,\n \"MediaDuration\": \"14.28 s\",\n \"HandlerType\": \"Audio Track\",
\n \"HandlerDescription\": \"SoundHandle\",\n \"Balance\": 0,\n \"AudioFormat
\": \"mp4a\",\n \"AudioChannels\": 2,\n \"AudioBitsPerSample\": 16,\n \"Audio
SampleRate\": 48000,\n \"MovieDataSize\": 36819481,\n \"AvgBitrate\": \"20.6 M
bps\",\n \"ImageSize\": \"1920x1080\",\n \"Rotation\": 0\n}]
答案 0 :(得分:0)
是的,这个视频是h.264。 "CompressorID": "avc1"
。 AVC =高级视频编码= h.264