Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 Doom9's Forum [FFmpeg] image conversions - batch file
 Register FAQ Calendar Search Today's Posts Mark Forums Read

 23rd September 2011, 12:22 #1  |  Link Dogway Registered User   Join Date: Nov 2009 Posts: 1,041 [FFmpeg] image conversions - batch file My intention is to make a handy batch file for encoding images. Mainly I will be converting from jpeg to png, so I run a few tests. What I found out is that first, jpeg decoding is wrong, I think because it relies on mjpeg for decoding which is chroma subsampled. And second: the target png weights much more than say, saving from avspmod or photoshop. I would like to know how to do this on ffmpeg or maybe some kind of avs2png, ultimately I want to right click on an image and run the batch file. Last edited by Dogway; 26th September 2011 at 16:32.
 23rd September 2011, 16:52 #2  |  Link smok3 brontosaurusrex     Join Date: Oct 2001 Posts: 2,395 avisynth to png sequence or jpeg to png? what exactly are you trying to do? __________________ certain other member
 23rd September 2011, 17:38 #3  |  Link Dogway Registered User   Join Date: Nov 2009 Posts: 1,041 I dont care as long as I can convert a jpg to png, through avisynth or directly fed. I just thought that variable input would be more difficult through avisynth...
 23rd September 2011, 18:07 #4  |  Link smok3 brontosaurusrex     Join Date: Oct 2001 Posts: 2,395 a bit of overkill, but how about http://www.imagemagick.org/script/co...processing.php convert file.jpg file.png (is the basic syntax) (imagemagick runs on mac, win, linux, so anything learned on desktops can be than easily used on for example linux servers) p.s. my quick test shows that default png compression is better than the one found in gimp, unless there is some sort of chroma bug... p.s.2. png compression is slow and demanding on full HD pictures __________________ certain other member
 23rd September 2011, 18:10 #5  |  Link Dogway Registered User   Join Date: Nov 2009 Posts: 1,041 I didn't know imagemagick had a command line tool. I will try that, in expect I dont need to install anything.
 23rd September 2011, 18:14 #6  |  Link smok3 brontosaurusrex     Join Date: Oct 2001 Posts: 2,395 you will certainly need to install imagemagick. __________________ certain other member
 23rd September 2011, 18:16 #7  |  Link Dogway Registered User   Join Date: Nov 2009 Posts: 1,041 I used the portable version and it works, compression to png is alongside PS, avspmod, etc. But yes, its overkill, I hoped to make it work on ffmpeg... pd: maybe the encoder avspmod internally uses for conversion Last edited by Dogway; 23rd September 2011 at 18:20.
 25th September 2011, 14:36 #8  |  Link Chikuzen typo lover     Join Date: May 2009 Posts: 597 Code: @echo off c:\path\to\ffmpeg -i "%~1" -vcodec png "%~dpn1.png" save this bat into "Send To" folder. __________________ my repositories
 25th September 2011, 18:31 #9  |  Link Dogway Registered User   Join Date: Nov 2009 Posts: 1,041 Thanks chikuzen, that was my first option, but jpeg decoding seems wrong, and png compression is... unusual. Maybe there is some option in ffmpeg we are missing.

 Tags batch, ffmpeg, jpeg, png