VideoHelp Forum




+ Reply to Thread
Results 1 to 17 of 17
  1. 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
    Quote Quote  
  2. I don't get entirely what is your goal but as i pointed earlier (different thread) - for image processing i would rather use image editor (GIMP?), for image batch processing i prefer ImageMagick, ffmpeg can be used also for such processing.
    Quote Quote  
  3. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by marcorocchini View Post
    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
    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-
    Quote Quote  
  4. 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
    Quote Quote  
  5. Image
    [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
    thanks, it's perfect this

    pandy for kindness is there a way to reduce a little the video levels for the background image?
    Quote Quote  
  6. Originally Posted by marcorocchini View Post
    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"
    Quote Quote  
  7. 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?
    thanks
    Last edited by marcorocchini; 19th Jan 2025 at 15:15.
    Quote Quote  
  8. Originally Posted by marcorocchini View Post
    yes I mean dimmed to low, but maybe I cannot see the differences in the code
    Difference in code is highlighted (bold black and red) - check for "eq=brightness=-0.1" move slider in command line window.

    Originally Posted by marcorocchini View Post
    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
    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.

    Originally Posted by marcorocchini View Post
    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?
    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.
    Quote Quote  
  9. so, is there a way to d2 2 single processing: 1 for JPG background
    and 1 for TGA ?


    THANKS!!!!!
    Quote Quote  
  10. Originally Posted by marcorocchini View Post
    so, is there a way to d2 2 single processing: 1 for JPG background
    and 1 for TGA ?
    Please explain this in more detailed way.
    Quote Quote  
  11. is possible: 1 commandline ffmpeg to generate .jpg background

    and 1 separate commandline to generate the TGA

    Image
    [Attachment 85019 - Click to enlarge]
    Quote Quote  
  12. 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"
    Quote Quote  
  13. oh wow thanks



    Pandy for kindness - it's to do some proof - is there a way to specify in the commandline "do a interlaced processing" to ffmpeg? or do an output so that is suitable to a interlaced processing?
    Quote Quote  
  14. Originally Posted by marcorocchini View Post
    is there a way to specify in the commandline "do a interlaced processing" to ffmpeg? or do an output so that is suitable to a interlaced processing?
    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).
    Quote Quote  
  15. pandy for kindness: I need to zoom into the background image.

    Consider that in any case it is blurry on output so even if it is cropped in its overall proportions, it is not a problem. Is it possible to make this change on the ffmpeg line?
    Quote Quote  
  16. Originally Posted by marcorocchini View Post
    pandy for kindness: I need to zoom into the background image.

    Consider that in any case it is blurry on output so even if it is cropped in its overall proportions, it is not a problem. Is it possible to make this change on the ffmpeg line?

    Zoom? Dynamic or static?
    Quote Quote  
  17. maybe, considering that is for a static image source, and the target is a static image .jpg I think a static zom
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!