Merge Videos Side-by-Side

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Merge Videos Side-by-Side

Post by Rye »

video 1 Birate: 2931 kBit/s (.avi) (1652kBit/s according to FFMPEG, rgb24 instead of yuv420p according to FFMPEG)
video 2 Bitrate: 2931 kBit/s (.avi) (1100KBit/s according to FFMPEG, rgb24 instead of yuv420p according to FFMPEG)

combined Bitrate 200 kBit/s... (.avi)
Last edited by Rye on 2013-08-18T08:29:41-07:00, edited 1 time in total.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Merge Videos Side-by-Side

Post by Rye »

DELETE ME
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Merge Videos Side-by-Side

Post by snibgo »

So you have doubled the number of pixels but divided the bitrate by at least ten. Other things (eg codec) being equal, that will significantly reduce quality.
snibgo's IM pages: im.snibgo.com
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Merge Videos Side-by-Side

Post by Rye »

By doubled you mean "put side by side ?"

What setting needs to be changed in order to get the picture nonblurry ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Merge Videos Side-by-Side

Post by snibgo »

I haven't seen any of your videos, frames or commands, so can't diagnose any problems.

Each new frame contains twice as many pixels as either original. But your new video bitrate (measured in bits per second) is less than the original, by a factor of at least ten. Hence the compression (measured in bits/pixel) decreases by a factor of at least 20. Video compression is lossy, so this is almost guaranteed to reduce quality.

If you increase the bitrate, the quality may improve.
snibgo's IM pages: im.snibgo.com
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Merge Videos Side-by-Side

Post by Rye »

So… how do I have to change this code:

Code: Select all

ffmpeg -r 25 -b 2000 -i c%d.png combined.avi
in order to achieve higher bitrate ?

Since the pictures used right "before" the merge are crisp.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Merge Videos Side-by-Side

Post by snibgo »

Re-read the posts by rich2005 upthread. Also type "ffmpeg -h" for options.
snibgo's IM pages: im.snibgo.com
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Merge Videos Side-by-Side

Post by Rye »

Well even if I use this command (modified bitrate):

Code: Select all

ffmpeg -r 30 -b 2931 -i c%d.png test.avi
I still get a avi file with horrible quality. Not being comparable to the source stills used.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
rich2005
Posts: 32
Joined: 2012-04-09T11:07:36-07:00
Authentication code: 8675308

Re: Merge Videos Side-by-Side

Post by rich2005 »

As snibgo says there are many options that come with ffmpeg and 'avi' is just a wrapper format. Includes everything from uncompressed video thro' xvid to mp4's which unless you specify something, is what you get.

I have just popped IM into a Win7 VM and the ffmpeg that comes with it is more than adequate.

Tried a few options including motion jpeg, surprisingly that was not so good.

I would try a command line

ffmpeg -i c%d.png -r (your framerate here) -b 30k -qscale 1 combined.avi

the input -i imagefiles comes at the beginning now to allow the quality setting qscale to apply to the output. A syntax thing. The output file will be maybe 3 times larger than before but hopefully without those artifacts.
Post Reply