要获得文件的大小,我可以这样做:
$ mediainfo '--Inform=Video;%Width%x%Height%' ~/Desktop/lawandorder.mov
1920x1080但是,如果我给出一个url而不是一个文件,它将返回None:
$ mediainfo '--Inform=Url;%Width%x%Height%' 'http://url/lawandorder.mov'
(none)如何正确地将url传递给MediaInfo
发布于 2011-09-11 22:13:44
您还可以在运行mediainfo之前使用curl | head部分下载该文件。
下面是一个从web获取12MB文件大小的示例,其中只需要从一开始下载一小部分(小于10KB):
curl --silent http://www.jhepple.com/support/SampleMovies/MPEG-2.mpg \
| head --bytes 10K > temp.mpg
mediainfo '--Inform=Video;%Width%x%Height%' temp.mpg发布于 2011-09-11 16:35:20
为此,我需要使用'--with-libcurl‘选项从源代码重新编译。
$ ./CLI_Compile.sh --with-libcurl
$ cd MediaInfo/Project/GNU/CLI
$ make install然后我使用这个命令通过http获取视频尺寸:
$ mediainfo '--Inform=Video;%Width%x%Height%' 'http://url/lawandorder.mov'请注意,这需要相当长的时间才能返回结果。如果文件不是本地的,我建议使用ffmpeg。
https://stackoverflow.com/questions/7376477
复制相似问题