Hello all
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.
+ Reply to Thread
Results 1 to 13 of 13
-
-
try animation codec in RGB
-vcodec qtrle
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.
-
Thanks for taking the time to help. How do I export using ffmpeg to a YCbCr format image? The codecs I can see from my friend google are
-vcodec ppm
-vcodec png
-vcodec mjpeg
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
Tool: ffmpeg
Version: SVN-r21770 (compiled locally)
Command:
ffmpeg -r 24 -i INMOVIE.mov -f image2 %08d.png
This 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. -
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]
Similar Threads
-
FFmpeg Command Lines for Converting Video to Various Devices??
By raymng in forum Video ConversionReplies: 3Last Post: 27th Feb 2012, 00:23 -
Avisynth: PNG sequences on MP4 video
By KBII in forum SubtitleReplies: 0Last Post: 7th Feb 2012, 04:08 -
ffmpeg generate audio/add to video help please, command line
By surfmonkee in forum LinuxReplies: 3Last Post: 11th Sep 2011, 16:17 -
Help with FFMPEG command lines
By ricardouk in forum Video ConversionReplies: 11Last Post: 17th May 2008, 12:27 -
FFMPEG audio/video desynchronized (converting video server side)
By Lleoun in forum Newbie / General discussionsReplies: 1Last Post: 18th Apr 2008, 07:19