0

I created a video from a bunch of images off my camera using FFMPEG. I set it to 10fps. The output video looks fine. As soon as I upload it to Facebook or Youtube the quality is reduced significantly.

Here is the command I used to create the video:

ffmpeg -framerate 10 -pattern_type glob -i 'resized/*.JPG' -s:v 1280x720 -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p out.mp4

Each image has been resized to 1000x1500 pixels.

Screenshot from video from ffmpeg: https://www.dropbox.com/s/r3v30lj15a5hl6a/local.png?dl=0 Screenshot from video from Youtube: https://www.dropbox.com/s/qrur54r7xsnnrxs/youtube.png?dl=0

If you look carefully you can see the Youtube one is missing a lot of sharpness and detail. It looks much worse when playing through the video.

FYI - I know nothing about video encoding, I just googled for the ffmpeg command so most likely I am doing something silly.

Thank you!

1

YouTube re-encodes whatever you give it. The process is lossy so there will be a quality reduction. All you can do is give it a very high quality:

ffmpeg -framerate 10 -pattern_type glob -i 'resized/*.JPG' -vf scale=1280:-2 -c:v libx264 -crf 17 out.mp4
  • Use -crf 17 or -crf 18 for higher quality.

  • Try without -pix_fmt yuv420p. I'm not sure what YouTube uses for pixel format conversion, but perhaps it will look better than the FFmpeg swscale if they are using something different.

  • No need for -profile:v high. Let the encoder choose. You usually only need to set a profile when your target device is limited in profile support.

  • Great, thanks I will give it a shot. – Aydin Hassan Nov 14 '19 at 19:52
  • Wouldn't 4:2:2 be a better option? – stib Nov 15 '19 at 12:18
  • @stib It is unknown if the OP additionally wanted to play the output in non-FFmpeg based players. Also, the JPG input pixel formats may be 4:4:4, so choosing 4:2:2 would not be ideal in that case if a user wanted to let ffmpeg automatically choose the "best" pixel format (yuvj444p in this case) and make YouTube do the conversion. – llogan Nov 23 '19 at 21:37
  • Of course. I realise I misread "try without" and thought you'd suggested "try with". – stib Nov 25 '19 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.