How to find out the video quality and change it using ffmpeg

I am uploading a video and there is a need to process the video on the server for further publication.

After publishing, users should have access to several video qualities ( well, 360p, 480p, 720p, etc.), depending on what the video was originally.

How to implement this?

Author: JacksScripts, 2017-01-02

1 answers

If you use ffmpeg, the command is:

ffmpeg -i видеофайл

It outputs a lot of lines, interesting lines describing video and audio:

 Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 9838 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
 Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 256 kb/s

Where the video size is 1920x1080, which in this case corresponds to 1080p or FullHD

 0
Author: Crantisz, 2017-01-02 12:01:28