VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. Which type of jpgs have the better quality?

    1. Making jpegs using this command from ffmpeg: ffmpeg -i input.mkv -vf zscale=min=709:m=170m:rin=limited:r=full,format=(d epends on the video) -qmin 1 -qmax 1 -q:v 1 -start_number 0 output_%06d.jpg

    2. Make png files using ffmpeg and then convert them into jpgs. If so, what tool should I use?

    3. Make jpgs from videos using the Guetzli encoder. If this option is true, how do I do that?
    Quote Quote  
  2. I was not aware of Guetzli existence but seem it is tuned to improve compression so if your goal is not compression efficiency then i see no point in spending more time on encoding...

    To optimize quality you can give a chance to methods described in papers bellow - similar methods was used to produce "optimal" quantization matrices in past (MPEG-2 and MPEG-4/DIVX). No clue if any modern JPG encoder support custom quantization matrices - perhaps i'm too lazy now but i'm OK with general JPG encoders and quality 90+ - for lossless compression using PNG.
    Btw seem Mozilla JPEG Encoder Project is focused on high quality compression and it is substantially faster than Guetzli so i would give a chance firstly to Mozilla.

    https://humansystems.arc.nasa.gov/publications/spie93abw.pdf
    https://human-factors.arc.nasa.gov/publications/aaia93abw.pdf
    https://humanfactors.arc.nasa.gov/publications/RosenholtzWatson1996.pdf
    https://www.ecva.net/papers/eccv_2020/papers_ECCV/papers/123650307-supp.pdf

    Also i have impression that you are pursuing rainbow unicorn but hey, everyone deserve for some hobby so my advice is you should use some objective quality estimation ( https://github.com/google/butteraugli ?) so you can confirm what you see with some visible numbers... - i'm old enough to remember times where JPG was novelty and jpg image decoding took like 30 second or more to be displayed on VGA screen - same for mp3 files where firstly they need to be decoded to uncompressed wav to be able played without hiccups.

    Oh forget - try to use flat quantization matrices in ffmpeg (by flat i understand intra (and inter but not the case for JPG/MJP) quantization matrices made from '8' - seem jpg encoder share same core as MPEG and MJPEG so perhaps you will be able to introduce custom quantization matrices.

    Code:
    ffmpeg.exe -i "I:\test.mp4" -f mpeg2video -c:v:0 mpeg2video -b_strategy 2 -brd_scale 2 -profile:v 4 -intra_matrix "8,8,9,9,10,10,11,11,8,9,9,10,10,11,11,12,9,9,10,10,11,11,12,12,9,10,10,11,11,12,13,13,10,10,11,11,12,13,13,14,10,11,11,12,13,13,14,15,11,11,12,13,13,14,15,15,11,12,12,13,14,15,15,16" -inter_matrix "8,8,9,9,10,10,11,11,8,9,9,10,10,11,11,12,9,9,10,10,11,11,12,12,9,10,10,11,11,12,13,13,10,10,11,11,12,13,13,14,10,11,11,12,13,13,14,15,11,11,12,13,13,14,15,15,11,12,12,13,14,15,15,16" -aspect 16:9 -s 720x480 -r 24000/1001 -g 12 -pix_fmt yuv420p -b:v:0 7990000 -maxrate:v:0 8000000 -dc 10 -bf 2 -q:v 2 -bufsize:v:0 1835008 -packetsize 2048 -muxrate 10080000 -vf scale=718:480,pad=720:480:1:0 -map 0:v:0 -an -passlogfile "I:\ffmpeg" -pass 1 -y "NUL.avi"
    This is excerpt from Manolito MPEG-2 script https://forum.doom9.org/showthread.php?p=1808247#post1808247
    Last edited by pandy; 19th Mar 2024 at 05:11.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!