HI
I'm a cat
please have patience
SO, I wonder:
in a folder I have some files of photos (some .jpg mostly) I need to build a batch procedure so:
-->for any single source photo file I get another of them but saved in .TGA 32 bit with alpha channel
-->for any single source photo file I get the same image most blurred (c.d. fuzzy effects?) as background to apply the moving movement on key of the correspondant file
thanks
+ Reply to Thread
Results 1 to 17 of 17
-
-
Irfanview.
First see how it works from the program level (batch processing). Then you write a script like here on the forum.
https://irfanview-forum.de/forum/program/command-line-and-scripts/command-line-options/11051- -
all images in folder will be converted accordingly to your information, ffmpeg and input images (jpg in my script, add extensions at will) should be in the same folder, result files are stored in new folders BACK and TGA
Code:@setlocal @set FFMPG=%CD% @set PATH=%FFMPG%;%PATH% @set OUTDIR1="TGA" @if not exist %OUTDIR1% (mkdir %OUTDIR1%) @set OUTDIR2="BACK" @if not exist %OUTDIR2% (mkdir %OUTDIR2%) @set /A nfile=0 @FOR %%a IN (*.jpg) DO (@echo converting "%%~nxa" @ffmpeg.exe -sn -an -hide_banner -v 16 -stats -y -i "%%a" -filter_complex [0:v]split=2[IN_TGA][IN_BACK];[IN_TGA]zscale=w=-2:h=1080:f=spline36:r=full:d=ordered[OUT_TGA];[IN_BACK]zscale=w=480:h=270:f=spline36:r=1:d=0,avgblur=19,zscale=w=1920:h=1080:f=1:r=1:d=1[OUT_BACK] -map [OUT_TGA] -pix_fmt bgra -frames:v 1 -f image2 -update 1 -c:v targa -rle 0 "%OUTDIR1%\%%~na.tga" -map [OUT_BACK] -frames:v 1 -f image2 -update 1 -c:v mjpeg -q:v 1 -huffman 1 -intra_matrix 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 "%OUTDIR2%\%%~na.jpg" @set /A nfile+=1) @echo . @echo . @echo . @echo Done! Converted %nfile% file(s) @echo . @echo . @echo . @endlocal @pause
-
[Attachment 84989 - Click to enlarge]
oh my! it seems a super beautiful processing
Code:--- Video --- Size 1920 X 1080 No fielding 24 bit RGB-888-s from .JPG
pandy for kindness is there a way to reduce a little the video levels for the background image? -
You mean less brighten. dimmed video ?
Try:
Code:@ffmpeg.exe -sn -an -hide_banner -v 16 -stats -y -i "%%a" -filter_complex [0:v]split=2[IN_TGA][IN_BACK];[IN_TGA]zscale=w=-2:h=1080:f=spline36:r=full:d=ordered[OUT_TGA];[IN_BACK]zscale=w=480:h=270:f=spline36:r=1:d=0,eq=brightness=-0.1,avgblur=19,zscale=w=1920:h=1080:f=1:r=1:d=1[OUT_BACK] -map [OUT_TGA] -pix_fmt bgra -frames:v 1 -f image2 -update 1 -c:v targa -rle 0 "%OUTDIR1%\%%~na.tga" -map [OUT_BACK] -frames:v 1 -f image2 -update 1 -c:v mjpeg -q:v 1 -huffman 1 -intra_matrix 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 "%OUTDIR2%\%%~na.jpg"
-
yes I mean dimmed to low, but maybe I cannot see the differences in the code
And another thing: is there a way to don't change the resolution of output TGA image? I mean if the TGA can keep the same resolution of input file
and: if I try to use a image source that have height=1080 maybe ffmpeg return an error, could be?
for example this 2 attached jpg of same image:
https://www.swisstransfer.com/d/f2545c44-da65-4553-ac9b-56b774d25067
catlearn1.jpg is processed OK
catlearn2.jpg is not processed: because it have Height=1080
it' possible to process at any resolutions?
thanksLast edited by marcorocchini; 19th Jan 2025 at 15:15.
-
Difference in code is highlighted (bold black and red) - check for "eq=brightness=-0.1" move slider in command line window.
Yes, replace "[IN_TGA]zscale=w=-2:h=1080:f=spline36:r=full:d=ordered[OUT_TGA]" to "[IN_TGA]null[OUT_TGA]" - it should work.
Conditional ffmpeg is probably not possible from simple script like this - perhaps some shell / bash it could be possible or external apps but i can't help you on this - my "coding" skills are way to low. -
so, is there a way to d2 2 single processing: 1 for JPG background
and 1 for TGA ?
THANKS!!!!! -
is possible: 1 commandline ffmpeg to generate .jpg background
and 1 separate commandline to generate the TGA
[Attachment 85019 - Click to enlarge] -
So if i understand correctly you wish to perform ffmpeg conversion twice.
Yes, check bellow:
Code:@ffmpeg.exe -sn -an -hide_banner -v 32 -stats -y -i "%%a" -vf zscale=w=480:h=270:f=spline36:r=1:d=0,avgblur=19,zscale=w=1920:h=1080:f=1:r=1:d=1 -frames:v 1 -f image2 -update 1 -c:v mjpeg -q:v 1 -huffman 1 -intra_matrix 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 "%OUTDIR2%\%%~na.jpg"
Code:@ffmpeg.exe -sn -an -hide_banner -v 32 -stats -y -i "%%a" -vf zscale=w=-2:h=1080:f=spline36:r=full:d=ordered -pix_fmt bgra -frames:v 1 -f image2 -update 1 -c:v targa -rle 0 "%OUTDIR1%\%%~na.tga"
-
ffmpeg is not easy to control from batch even if there is some possibility to modify on the fly how ffmpeg works.
To process interlaced video you need to add required filters (like deinterlacing - there is few of them available in ffmpeg).
So interlaced processing is possible similarly to Avisynth (in fact ffmpeg may accept Avisynth scripts as source if compiled with Avisynth support). -
maybe, considering that is for a static image source, and the target is a static image .jpg I think a static zom
Similar Threads
-
AVI capture: multiple files or single file more practical?
By Ad_astra in forum Video ConversionReplies: 3Last Post: 30th Dec 2024, 18:27 -
Best software for creating a video with a single image and a long MP3 file?
By djmloody27 in forum EditingReplies: 1Last Post: 12th Mar 2024, 04:25 -
Mass Convert JPG to PNG
By Anakin in forum ComputerReplies: 18Last Post: 11th May 2023, 21:42 -
Outputting Frame Sequence Images to Create A Single Image
By imaginethat in forum EditingReplies: 31Last Post: 19th Jan 2022, 08:25 -
Batch file to extract/convert all tx3g files in an .mp4 file
By olpdog in forum SubtitleReplies: 1Last Post: 23rd Aug 2020, 18:40