I am battling to find a truly lossless ffmpeg command that goes from video to images and back to video.
If I pull png's from an mp4, with this command, I get high quality png's that are of identical quality to the original video.
ffmpeg -i 'RHUBARB1.MP4' -r 29.97 -f image2 -vcodec png %05d.png"
The original video is 1280x960 if that is relevant. Those are good quality PNG's. Now I try to put them back into an avi or whatever. I can't remember a history of all my attempts, but the closest I have got is
ffmpeg -i '%05d.png' -s 1280x960 -r 29.97 -vcodec huffyuv -sameq rhubarb2.avi
But rhubarb2 does not have the identical quality to rhubarb1. There is a slight colour shift, and slight banding on the gradients. These are very small changes, but I need to edit the images that I export and then reassemble them.
Am I as close to "lossless" as I can get with ffmpeg, or am I missing a trick of some kind. thanks in advance to anyone who can help.
Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try PlayON and record Netflix, HBO, Hulu, etc! :)
+ Reply to Thread
Results 1 to 13 of 13
try animation codec in RGB
ffmpeg -i '%05d.png' -s 1280x960 -r 29.97 -vcodec qtrle rhubarb2.mov
Better yet, avoid the intermediate stage of PNG if you can. Most image formats are RGB. The quality loss is from RGB<=>Y'CbCr conversions. If you stay in lossless RGB, there will be no quality loss - but you are not starting from RGB.
Your starting mp4 video is in Y'CbCr, so you should stay in Y'CbCr. If you convert to RGB, there is some quality loss ,and even more again when you convert to Y'CbCr format.
Last edited by poisondeathray; 26th Apr 2011 at 09:24.
ffmpeg to a YCbCr format image? The codecs I can see from my friend google are
from what I can read, jpeg seems to have some trick up its sleeve about YCbCr (though I might not be understanding it correctly), but it definitely gives me a poorer quality export than png.
you can't avoid the quality loss, unless you stay in RGB (use an RGB video format)
regular jpeg is lossy, so in addition to colorspace lossess, you incur compression losses
why are you going to png in the first place? perhaps your editing/manipulations can be done in Y'CbCr with other programs
I tried to look all comment and reply but I got no idea what you guy are talking about. I'm trying to make a DCP file for cinema projector. I read a toturial on this website http://bitfilms.blogspot.com/2010/11/making-dcp-entirely-with-open-source.html I got no idea what to start now. I have a Quicktime video and want to convert to PNGs using ffmpeg software but I don't know how to do. Can someone please explain me how to start???
Inside the quote is the instruction on how to convert PNGs from QuickTime that I just copies from other website.
Step 1: export PNGs from source QuickTime movie
Version: SVN-r21770 (compiled locally)
ffmpeg -r 24 -i INMOVIE.mov -f image2 %08d.pngThis marches through the video file outputting a lossless, compressed PNG 24 times per second.
fmpeg is a command line program. So (for example) on a mac, you have to open a program called terminal and type out the command.
If you are on a mac, you would open terminal (which you will find in the applications / utilities) and then type
ffmpeg -r 24 -i INMOVIE.mov -f image2 %08d.png
you must replace the word "INMOVIE.mov" with the actual name of your .mov. And it's path. So if I had a mov on my desktop that I wanted to make png's of it, I would do do this in the terminal, pretending that the name of my .mov is SOMEMOVIE.MOV and my home folder is called VIDGEM
ffmpeg -r 24 -i /Users/vidgem/Desktop/SOMEMOVIE.MOV -f image2 %08d.png
it will then split out your mov into pngs.
Last edited by vidgem; 8th Nov 2011 at 23:47.
Thank you very much vidgem for your replied. Now I got the idea what to start
But one more thing I'm on PC I don't have a MAC. Any chance to get it run on PC or not?
Thanks again for your help.
Many thanks for your time.
My dear Vidgem,
So far I got it run on VMWare MAC OSX Snow Leopard now but it seem that I still have some problem. Because I can not see the output files.
I'm not sure what the exact problem is but I think it is problem with my input video. Can you help me please?
below is the screenshot of my terminal after finished encording.
Thanks for your time.
[Attachment 9616 - Click to enlarge]