Need to check video resolution before transcoding video file

China☆狼群 提交于 2021-02-05 07:32:27

问题


I am converting video files using an elastic transcoder. AWS Lambda function get video file from s3 bucket and convert it according to PresetId.

But, I need to compare video file resolution with PresetId. If the video file resolution is higher than the PresetId video resolution, then convert this video file, otherwise do not need to convert all video files.


回答1:


Do you have access to ffmpeg/ffprobe/ffplay from AWS - is it possible to call them and take their console output? I'm not sure about what's allowed in AWS, but on Desktop you could call ffprobe etc. - it could return text or even JSON. Many ways are suggested here: Getting video dimension / resolution / width x height from ffmpeg

One of the suggested ways:

ffprobe -v error -show_entries stream=width,height -of csv=p=0:s=x input.m4v
1280x720


来源:https://stackoverflow.com/questions/65289628/need-to-check-video-resolution-before-transcoding-video-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!