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 )
+ Reply to Thread
Results 1 to 8 of 8
-
-
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/FilteringGuideLast edited by sneaker; 24th Jun 2017 at 07:43.
-
>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? -
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. -
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.
-
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.
Similar Threads
-
how do you join multiple titles?
By Dr_Sanguinary in forum Newbie / General discussionsReplies: 13Last Post: 11th Nov 2024, 13:29 -
Join multiple files by date
By Nemoc in forum EditingReplies: 5Last Post: 8th Jul 2015, 08:08 -
Join videos in multiple sub-folders
By DavidBV in forum EditingReplies: 3Last Post: 20th Feb 2014, 17:25 -
Join Motion JPG (mjpeg/mjpg) without re-encoding
By giroro in forum EditingReplies: 13Last Post: 23rd Sep 2013, 09:25 -
Software which can tell me certain sizes of multiple files
By SE14man in forum Newbie / General discussionsReplies: 3Last Post: 30th Jan 2013, 08:48