VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. when i need to join 2 jpgs, i got this working
    ffmpeg.exe -y -i %1 -i %2 -filter_complex vstack out.bmp


    question 1
    how can i make this work by using list.txt?

    FOR %%V IN (%*) DO ( @echo file '%%~V' >> m:\LIST.TXT )
    ffmpeg.exe -y -f concat -safe 0 -i m:\list.txt -filter_complex hstack out.bmp

    ---------------------------------------------------------------------

    question 2
    i need to join 2 jpgs that have different sizes.
    (w1,h1) + (w2,h2) = new bmp (w1+w2, whichever is larger h1 or h2 )
    Quote Quote  
  2. question 1:
    You cannot use the concat demuxer to stack 2 pictures into 1 picture. It is for appending. (one shown after the other one ends)

    question 2:
    That's stacking horizontally, i.e. hstack filter. For inputs with same height:
    ffmpeg -i "input1" -i "input2" -filter_complex "[0:v][1:v]hstack=inputs=2[out]" -map "[out]" "output.bmp"

    If you want from different heights you need to scale or pad first. Whatever you want. But automating is difficult. Maybe with some scale2ref trickery.


    https://trac.ffmpeg.org/wiki/FilteringGuide
    Last edited by sneaker; 24th Jun 2017 at 07:43.
    Quote Quote  
  3. >question 2 automating is difficult
    ok i will forget it

    AA=
    ffmpeg -y -i "%1" -i "%2" -filter_complex "[0:v][1:v]hstack=inputs=2[out]" -map "[out]" "output.bmp"

    BB=
    ffmpeg.exe -y -i %1 -i %2 -filter_complex hstack out.bmp or
    ffmpeg.exe -y -i %1 -i %2 -filter_complex vstack out.bmp

    i can understand BB=, but i dont have energy to understand AA=, and BB= seems does the same thing as AA=
    ok i resize them to a common resolution 1st then i will use hstack and vstack, one of them will be correct

    ---------------------------------------------
    I am trying to resize an image with an aspect keep

    CC= ffmpeg -i "%1" -vf scale=w=1920:h=1870:force_original_aspect_ratio=de crease out.bmp
    runs but doesnt do what i want

    DD=
    ffmpeg -i "%1" -vf scale="'if(gt(a,4/3),1920,-1)':'if(gt(a,4/3),-1,1080)'" out.bmp
    ffmpeg -i "%1" -vf scale="'if(gt(a,1.8),1920,-1)':'if(gt(a,1.8),-1,1080)'" out.bmp
    ffmpeg -i "%1" -vf scale="'if(gt(a,1),1920,-1)':'if(gt(a,1),-1,2880)'" out.bmp

    DD= runs but none of them does what i want.

    ---------------------------------------------
    I am trying to resize with an aspect keep

    EE=
    11. ffmpeg -i "%1" -vf scale=1920:-1 out1.bmp
    22. ffmpeg -i "%1" -vf scale=-1:1080 out2.bmp

    EE=works nicely but the one of them (11. or 22.) will always overshoot. is there a way to find which one fits in the given resolutions?
    Quote Quote  
  4. Originally Posted by sommers View Post
    runs but doesnt do what i want
    [...]
    DD= runs but none of them does what i want.
    What do you want?
    Quote Quote  
  5. i need to find which direction i need to use -1, w or h without manually looking at the input image in order to fit the final image within the resolutions.
    EE= worked but i have to remove one of them manually.
    Quote Quote  
  6. But what is your problem with CC or DD?
    Quote Quote  
  7. AA=ffmpeg -i "%1" -vf scale=w=1920:h=1080:force_original_aspect_ratio=de crease out.bmp
    BB=ffmpeg -i "%1" -vf scale="'if(gt(a,4/3),1920,-1)':'if(gt(a,4/3),-1,1080)'" out.bmp
    CC=ffmpeg -i "%1" -vf scale="'if(gt(a,1.8),1920,-1)':'if(gt(a,1.8),-1,1080)'" out.bmp
    DD=ffmpeg -i "%1" -vf scale="'if(gt(a,1),1920,-1)':'if(gt(a,1),-1,1080)'" out.bmp

    AA= works
    BB=1920 x 1343 doesnt work, overshooting, but it was not so bad
    CC=1920x671 works
    DD=1920X1343 doesnt work, overstooting, but it was not so bad

    i must have been blind.

    why do BB= and DD= have the same result?

    4/3= 1.33 = 640/480
    1.8= 1920/1080
    1 = 1000/1000

    i choose AA=, thanks for making me redo this with certainty.

    for BB=,CC=,DD= even if they were made to work, i couldnt find the aspect ratio manually 1.33 1.8 and etc.

    in gt(a, aspect ratio), that was for the aspect ratio right?
    Last edited by sommers; 25th Jun 2017 at 10:17.
    Quote Quote  
  8. I assume "gt" means "greater than". "a" is the aspect ratio of the input. It is math.
    gt(a, 1) means "is a greater than 1?"
    For a=1920/1343: yes. Every time the width is bigger than the height width/height will be bigger than 1. (elementary school math)

    1920/1343 is ~1,43. So it is also bigger than 4/3(~=1.3). So you get the same result.
    Quote Quote  



Similar Threads

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