I am working on a project that provides video streaming to the users over the internet on web-browsers as well as mobile devices.
I am using following sample FFMPEG
command to transcode
the video:
ffmpeg -y -i inputvideo.mp4 -async 1 -metadata:s:v:0 start_time=0
-s 1280x720 -vcodec libx264 -strict experimental -pix_fmt yuv420p
-profile:v baseline -movflags +faststart -acodec aac -profile:a aac_low
-b:v 2000k -refs 6 -coder 1 -sc_threshold 40 -flags +loop -me_range 16
-subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k outputvideo.mp4
The command is generated dynamically using programming language after getting the video details once uploaded. What am I doing is, just reset bit-rate, height and width of the video using following settings:
If height >= 720
then set it to 720
, width will be automatically set according to height and bit-rate
will be 5000k
,
If height >= 480
then set it to 480
, width will be automatically set according to height and bit-rate
will be 2500k
,
If height >= 360
then set it to 360
, width will be automatically set according to height and bit-rate
will be 1000k
I got this logic from this link.
However, I want to downgrade the quality of video by 25-30% more as still videos are of greater size than I suppose to get after transcoding and it will cost the data charges more.
While searching for it, I found another link and it have different bit rate than the one I am using. I am not sure which one is better.
Can anyone suggest me how to downsizing the videos more by 25-30% more than current setting without more affecting the quality of video?