How to play multiple videos side-by-side synchronized?

40

22

I've got 3 videos, all 3 have the same time, same amount of frames, and they only differ in terms of encoding quality.

Now I need them to run side-by-side in synchronized fashion for evaluation purposes. Meaning when I press "play" BOTH! videos should start. Analogically for stop, forward, backward.

Anyone know any player capable of doing that? By that I mean playing more than 1 video side-by-side...

Platform: Win7

Grumpy ol' Bear

Posted 2010-05-10T11:12:24.337

Reputation: 5 313

1"I've got 3 videos" -> "when I press "play" BOTH! videos should start" -> I think you mean all 3 should start? – jiggunjer – 2015-12-09T01:49:22.633

8Invest in some finger weights and train yourself to click very quickly. – ta.speot.is – 2010-05-10T11:15:38.963

You're missing the point: I need a player capable of displaying more than 1 video. – Grumpy ol' Bear – 2010-05-10T15:28:00.017

4I think perhaps he was joking... – Joe Taylor – 2011-07-21T08:13:56.783

you can schedule a task to open them all at once. – Uğur Gümüşhan – 2013-02-13T23:33:30.943

Answers

13

VLC on Windows (1.1.10 or later):

  • Tools → Preferences
  • Show Settings → All
  • Click Advanced (Click Playlist for VLC 2.1.5)
  • Uncheck "Allow only one running instance"
  • Uncheck "Use only one instance when started from file manager"

VLC on OS X does not provide the same set of options. You can however run multiple instances from the Terminal with open -a VLC.

Kiran

Posted 2010-05-10T11:12:24.337

Reputation: 186

1That's open -n -a vlc for Mac. – Paul Tomblin – 2015-10-29T01:49:10.867

11This doesn't answer the question (windows 7, not OS X). He could maybe start 3 videos with a batch file, but there would be no way to pause them all etc. – jiggunjer – 2015-12-09T02:10:31.907

32

If anyone is still interested in this the current version of VLC is able to do this very well without any kind of scripting or add-on. As far as I know however you can only play two files synchronously, not 3.

  1. To accomplish this simply open VLC and select Media>Open Multiple Files.
  2. Inside the multiple file windows select add to add the first file.
  3. After this click on the, "Show more options," checkbox followed by the, "Play another media synchronously," checkbox at the bottom of the window.
  4. Select browse next to, "Extra media," to add the second file.
  5. Hit play and the two media files will play simultaneously with a single control window.

Tim L

Posted 2010-05-10T11:12:24.337

Reputation: 501

Works perfectly on OSX :) – Navin – 2016-01-29T07:16:05.860

2this works only for 2 videos not 3 – Wakan Tanka – 2016-12-08T09:00:07.537

2

If you want 3 videos, before step 5: on the Open Media window, go to the Edit Options field at the bottom of the window. Note that your 2nd video file is in the box like :input-slave=file:///C:/Users/me/Documents/someVideo.mov:file-caching=300. After the filename put a # then the next filename in the same format, e.g. :input-slave=file:///C:/Users/me/Documents/someVideo.mov#file:///C:/Users/me/Documents/yetAnother.mov :file-caching=300. Then when you click Play it will play all three files in sync. See reference: https://wiki.videolan.org/VLC_command-line_help/

– Rory – 2017-12-29T12:03:23.573

2Didn't work for version 3.0.5, but it did work for version 2.2.4. – badjr – 2018-12-31T04:48:52.693

2For 3.0.7 this seems to work as follows - after you click Play the main video starts playing, Right click Video -> Video Track -> Track 2. This opens a separate window with the second vid. They're both controlled by the controls in the original window. – Terry Brown – 2019-06-11T19:10:45.593

17

Bino is a cross-platform media player commonly recommended for stereoscopic file playback. Among other features, it supports synchronized playback of multiple streams.

The interface may seem a bit primitive or confusing at first, but all you need to do is

  1. Drag your two video files into Bino
  2. Select "Separate streams, left first" input option and "Left/right" output option

Voilà, you got synchronized playback. The kind where a single set of playback controls is used for all streams so you wouldn't have to "Invest in some finger weights and train yourself to click very quickly" as @ta.speot.is suggests.

As a bonus, it supports rendering anaglyph 3D.

o.v.

Posted 2010-05-10T11:12:24.337

Reputation: 571

2The OP asked for having three videos side-by-side, not two. As far as I can see, Bino only supports two videos. (Additionally, for me the "Separate streams, left first" option is greyed out) – Simon Forsberg – 2015-06-16T16:05:26.167

2Files need to be the same size and code or the option will be greyed out. – Ashley – 2016-11-19T17:03:16.590

6

You can do this with mpv if you don't mind using the command-line:

3 videos side-by-side (stacked horizontally)

enter image description here

mpv --lavfi-complex="[vid1][vid2][vid3]hstack=inputs=3[vo];[aid1][aid2][aid3]amix=inputs=3[ao]" input1.mkv --external-files="input2.mkv;input3.mkv"

2 videos

mpv --lavfi-complex="[vid1][vid2]hstack[vo];[aid1][aid2]amix[ao]" input1.mkv --external-file=input2.mkv

Notes

  • In Windows use ; to separate each file name in --external-files (as shown in the 3 videos example). In Linux and macOS use :. Alternatively, use two instances of --external-file instead such as: --external-file=input2.mkv --external-file=input3.mkv.

  • Files must all be the same height. If they are not then add the scale, pad, and/or crop filters. See the mpv documentation and FFmpeg Filters for more info.

llogan

Posted 2010-05-10T11:12:24.337

Reputation: 31 929

4

After doing what Kiran said, open all your videos and run the following AutoHotKey script

ScriptVersion = 1.1
#Singleinstance,force

GoSub, MainProgram
return

mainprogram:
    SetTitleMatchMode, 2
    WinGet, id, list, - VLC media player,, Program Manager
    Windows = 
    Loop, %id%
    {
        StringTrimRight, this_id, id%a_index%, 0
        Windows := this_id . "," . Windows
    }
    StringTrimRight, Windows, Windows, 1

    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
    SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

    ~]::LoopControlSend(Windows, "]")
    ~[::LoopControlSend(Windows, "[")
    ~j::LoopControlSend(Windows, "j")
    ~k::LoopControlSend(Windows, "k")
    ~space::LoopControlSend(Windows, "{space}")

    ~+left::LoopControlSend(Windows, "+{left}")
    ~!left::LoopControlSend(Windows, "!{left}")
    ~^left::LoopControlSend(Windows, "^{left}")
    ~+right::LoopControlSend(Windows, "+{right}")
    ~!right::LoopControlSend(Windows, "!{right}")
    ~^right::LoopControlSend(Windows, "^{right}")
    ~^up::LoopControlSend(Windows, "^{up}")
    ~^down::LoopControlSend(Windows, "^{down}")

    ; for active windows only. use this to adjust speed when out of sync
    ~left::ActiveWindowSend(Windows, "+{left}")
    ~right::ActiveWindowSend(Windows, "+{right}")
    ~up::ActiveWindowSend(Windows, "^{left}")
    ~down::ActiveWindowSend(Windows, "^{right}")
return

LoopControlSend(Windows, x)
{
    WinGet, active_id, ID, A

    is_valid_window = 0
    Loop,Parse,Windows,CSV
    {
        if active_id = %A_LoopField%
        {
            is_valid_window = 1
            break
        }
    }

    if is_valid_window
    {
        Loop,Parse,Windows,CSV
        {
            if active_id <> %A_LoopField%
            {
                ControlSend, , %x%, Ahk_Id %A_LoopField%
            }
        }
    }
}

ActiveWindowSend(Windows, x)
{
    WinGet, active_id, ID, A

    is_valid_window = 0
    Loop,Parse,Windows,CSV
    {
        if active_id = %A_LoopField%
        {
            is_valid_window = 1
            break
        }
    }

    if is_valid_window
    {
        SendInput, %x%
    }
}

This script sends your keystrokes to all running instances of VLC media player. It doesn't work if you use a mouse.

These things should work:

  • forward: Ctrl + right / Alt + right / Shift + right
  • backward: Ctrl + left / Alt + left / Shift + left
  • play/pause: space
  • speed up: ]
  • speed down: [

You can easily add in other keystrokes below the line: ~^down::LoopControlSend(Windows, "^{down}")

This doesn't sync the videos perfectly, so you can use the following 4 keys: left, right, up, down to control the active window only.

  • left very short backward jump
  • right very short forward jump
  • up medium backward jump
  • down medium forward jump

If you prefer choosing the programs manually, use the following code instead

;Modified from MultipleSend by jgpaiva

ScriptVersion = 1.1
#Singleinstance,force

GoSub, MainProgram
return

Guiescape:
GuiClose:
    gui,destroy
    exitapp  

mainprogram:
    ;start by populating the listview.
    Gui, 1:default
    Gui, Add, Text, ,Select the windows to send the text.`nSelect several by pressing ctrl while selecting.`nAfter you've finished the selection`, press Submit.
    Gui, Add, ListView,w400 h500 vMyListView, Name of the Window | Window Class |Window ID
    WinGet, id, list,,, Program Manager
    Loop, %id%
    {
        StringTrimRight, this_id, id%a_index%, 0
        WinGetClass, this_class, ahk_id %this_id%
        WinGetTitle, this_title, ahk_id %this_id%
        If This_Title =
            continue
        if % LV_Add("",This_Title,This_Class,This_ID) = 0
            msgbox, bug
    } 
    Gui, Add, Button, default,Submit
    Gui,  Show
return

ButtonSubmit:
    NextRow := -1
    Windows =
    Loop,% LV_GetCount("Selected")
    {
    NextRow:=LV_GetNext(NextRow)
    LV_GetText(Text, NextRow,3)
    Windows := Text . "," . Windows
    }
    StringTrimRight, Windows, Windows, 1
    Gui,1:Destroy

    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
    SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

    ~]::LoopControlSend(Windows, "]")
    ~[::LoopControlSend(Windows, "[")
    ~j::LoopControlSend(Windows, "j")
    ~k::LoopControlSend(Windows, "k")
    ~space::LoopControlSend(Windows, "{space}")

    ~+left::LoopControlSend(Windows, "+{left}")
    ~!left::LoopControlSend(Windows, "!{left}")
    ~^left::LoopControlSend(Windows, "^{left}")
    ~+right::LoopControlSend(Windows, "+{right}")
    ~!right::LoopControlSend(Windows, "!{right}")
    ~^right::LoopControlSend(Windows, "^{right}")

    ~^up::LoopControlSend(Windows, "^{up}")
    ~^down::LoopControlSend(Windows, "^{down}")

    ; for active windows only. use this to adjust speed when out of sync
    ~left::ActiveWindowSend(Windows, "+{left}")
    ~right::ActiveWindowSend(Windows, "+{right}")
    ~up::ActiveWindowSend(Windows, "^{left}")
    ~down::ActiveWindowSend(Windows, "^{right}")
return

LoopControlSend(Windows, x)
{
    WinGet, active_id, ID, A

    is_valid_window = 0
    Loop,Parse,Windows,CSV
    {
        if active_id = %A_LoopField%
        {
            is_valid_window = 1
            break
        }
    }

    if is_valid_window
    {
        Loop,Parse,Windows,CSV
        {
            if active_id <> %A_LoopField%
            {
                ControlSend, , %x%, Ahk_Id %A_LoopField%
            }
        }
    }
}

ActiveWindowSend(Windows, x)
{
    WinGet, active_id, ID, A

    is_valid_window = 0
    Loop,Parse,Windows,CSV
    {
        if active_id = %A_LoopField%
        {
            is_valid_window = 1
            break
        }
    }

    if is_valid_window
    {
        SendInput, %x%
    }
}

user52874

Posted 2010-05-10T11:12:24.337

Reputation: 41

Holy cow AHK is amazing. How about this....lets say I have 14 VLC instances running oacross two broswers....is there a script that can tile all the videos across both browsers (so basically, look at # videos per screen, screen resolution, and tile them in some intelligent way)? – tbone – 2018-09-08T06:52:35.877

3

google probably already told you, you could buy a couple proprietary software who could do that, but just in case : videocompare, tmpgenc, vidlord...

This one's free : http://forum.doom9.org/showthread.php?t=138430

(working download links at the end of the thread)

Untested because my wine setup is completely screwed right now. It doesn't do side by side but stacked playback (unless you have a very good lcd you won't be seeing the same thing by playing the same vid in two opposite corners of the screen anyway)

If you think you really need side by side you can use avisynth to do what zimmer said.

clip1 = DirectShowSource("C:\MyEncode1.foo", audio=false)
clip2 = DirectShowSource("C:\MyEncode2.foo", audio=false)
StackVertical(clip1,clip2)

(reference forum.doom9.org/showthread.php?t=139769)

You don't need to do an encode (wich would add its own encoding artifacts anyway), just make a project that would produce an encode of the two vids playing together and skip through the file.

user36755

Posted 2010-05-10T11:12:24.337

Reputation: 46

3

I have the same problem but I have not seen any satisfactory solutions online so far (and believe me I had done a thorough search). At last I come up with my own solution that do not require any extra $. Although this is an old question, I hope my workaround will still be useful.

First, in VLC player, go to Tools->Preferences. Make sure to unchecked 'Allow only one running instance' and 'Pause on the last frame of a video'.

Then, type/edit the following commands in a text file. Open a windows command prompt, and run the commands by copy-and-paste (or save the text and run it as a batch file):

set VLCplayer="C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"
set VLCoptions=--repeat
set VIDEOdir="D:\path to your video directory"
set Video1="calibration1.mj2"
set Video2="calibration2.mj2"
set Video3="calibration3.mj2"

REM check the commands for misplaced spaces or missing '/' or '"' before running
ECHO cd %VIDEOdir%
ECHO %VLCplayer% %VLCoptions% %Video1%
ECHO %VLCplayer% %VLCoptions% %Video2%
ECHO %VLCplayer% %VLCoptions% %Video3%

cd %VIDEOdir%
%VLCplayer% %VLCoptions% %Video1%
%VLCplayer% %VLCoptions% %Video2%
%VLCplayer% %VLCoptions% %Video3%

This will open up three VLC instances, each with one of the three videos and all playing in a very synchronized fashion, at least to your eye. However, the three instances will be overlapping each other initially. You will need to click on the title bar of each of the instance to move them around without interrupting the playback so that you can see them playing side-by-side on your screen. This is rather annoying but I consider it a very small inconvenience.

I have tried but it is not possible to control all the instances with hotkeys for stop, forward, backward etc. However, the option '--repeat' will put the videos in a loop, so you can just wait for them to start over.

For very long videos, it may be best to merge the videos in a side-by-side composition into one video using e.g. ffmpeg: https://ffmpeg.org/pipermail/ffmpeg-user/2013-June/015662.html and http://ffmpeg.org/pipermail/ffmpeg-user/2013-June/015712.html This command only describes how to merge two videos, but I believe (i.e. I have not test it) you can run the command multiple times to incorporate multiple video files.

wtong

Posted 2010-05-10T11:12:24.337

Reputation: 77

1

I image you can use an AutoHotKey script to send a "Play" shortcut to all three players in a very short amount of time.

Whether they are able to start playing at exactly the same time is a different matter. Even if they are able to start straight away, I imagine there will be some fighting for the hard drive. Might want to make a RAM disk if this is an important evaluation.

ta.speot.is

Posted 2010-05-10T11:12:24.337

Reputation: 13 727

You're missing the point: I need a player capable of displaying more than 1 video. – Grumpy ol' Bear – 2010-05-10T15:27:07.303

Any media player where you can open up more than one instance, eg VLC – ta.speot.is – 2010-05-11T01:20:34.650

3Not really taspeotis. Because I have to manually start each application which in turn translates into NOT synchronous. – Grumpy ol' Bear – 2010-05-15T08:38:41.207

-1

Many players will be able to output a picture of a single frame in the video.

You could choose multiple points in your videos to compare different types of image (clouds, smoke, trees, grass, motion are good for encoding comparisons) and take the same frames from each of your videos.

You can then make comparisons on a static image rather than trying to spot differences in motion. You can compare on a pixel by pixel basis if you want.

Ensure you don't use JPG as the output though as this is a lossy format and will introduce its own artefacts.

Shevek

Posted 2010-05-10T11:12:24.337

Reputation: 15 408

2You're missing the point: I need a player capable of displaying more than 1 video. – Grumpy ol' Bear – 2010-05-10T15:26:16.247

1@NoCanDo: I understand that, this is just an alternative option for you to compare video encoding results should you not find a suitable answer. – Shevek – 2010-05-10T16:00:59.637

-1

If this is not something you do very often, I would use a video editing software like vegas to build one video with all of them showing.

Youtube video example of how to do that.

zimmer62

Posted 2010-05-10T11:12:24.337

Reputation: 1 343

2That's a very inconvenient way to do that. Still better than nothing so far. – Grumpy ol' Bear – 2010-05-10T15:28:43.930

Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill – 2017-11-29T13:21:35.663