View Full Version : [FFmpeg] image conversions - batch file
Dogway
23rd September 2011, 12:22
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.
smok3
23rd September 2011, 16:52
avisynth to png sequence or jpeg to png?
what exactly are you trying to do?
Dogway
23rd September 2011, 17:38
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...
smok3
23rd September 2011, 18:07
a bit of overkill, but how about
http://www.imagemagick.org/script/command-line-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
Dogway
23rd September 2011, 18:10
I didn't know imagemagick had a command line tool. I will try that, in expect I dont need to install anything.
smok3
23rd September 2011, 18:14
you will certainly need to install imagemagick.
Dogway
23rd September 2011, 18:16
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
Chikuzen
25th September 2011, 14:36
@echo off
c:\path\to\ffmpeg -i "%~1" -vcodec png "%~dpn1.png"
save this bat into "Send To" folder.
Dogway
25th September 2011, 18:31
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.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.