Hey guys I am learning to develop a website that converts videos to youtube quality (or close enough) 480p and 1080p, I am not much familiar with ffmpeg and struggling with its documentation.

I have these functions,

video_480p      = subprocess.call([FFMPEG_PATH, '-i', input_file, '-codec:v', 'libx264', '-crf', '20', '-preset', 'medium',
                '-b:v', '1000k', '-maxrate', '1000k', '-bufsize', '2000k','-vf', 'scale=-2:480', '-codec:a', 'aac', '-b:a',
                 '128k', '-strict', '-2', file_480p])

similarly I have another function,

new_video       = subprocess.call([FFMPEG_PATH, '-i', input_file, '-codec:v', 'libx264', '-crf', '20', '-preset', 'medium',
                '-b:v', '1000k', '-maxrate', '1000k', '-bufsize', '2000k','-vf', 'scale=-2:1080', '-codec:a', 'aac', '-b:a',
                 '128k', '-strict', '-2', output_file])

Both these functions, transcode the video, but returns low quality videos, Can anyone provide me with the right settings for 480p and 1080p which is similar or close to youtube quality?




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.