-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request?] Play multiple videos sides by sides #3854
Comments
Maybe it is already possible through --lavfi-complex option. |
Yes, you can make mpv open several files with --external-file or whatever it was, and then stack them together using lavfi-complex. Probably slow. |
There's also https://github.com/Syncplay/syncplay. |
Awesome! “Probably slow” is no issue for me, it’s 1000×800@5fps streams that I have. ;) Thanks both of you for your help. So, if anyone is looking for this, here is what I ended up doing:
I consider this as solved, thanks again! P.S.: Side question, while doing this I’ve discovered that hwdec (VAAPI here) wasn’t working for yuv444p streams (it’s more obvious when written 4 times than one), I suppose this is libva or hardware support issue? |
Non-yuv420p hwaccel support is rare/nonexistent. |
@wiiaboo Thanks. Closing this as solved. :) |
Oh, and one other thing: is there a way to avoid this ugly multiple |
|
I don't think it does separators. |
@wiiaboo That did it, thanks! Wonder why I haven’t tried that… Funny thing: this doesn’t work with hwdec anyway. After converting my videos to yuv420p (well, generating them directly to this format to be exact), I’ve stumbled upon this:
And then mpv stops. But as the doc says:
Let’s use |
@ArchangeGabriel is there a way to do this side by side compare of videos of different resolutions? |
You can use a scale filter to get one to the size of the other, or scale each to half your screen, or whatever. The manual does mention this, but here are a couple examples:
That won't use mpv's own high-quality gpu scaling. You can change the scaling algorithm ffmpeg uses by giving flags to the scale filter:
mpv by default will still re-scale the result if your window size is different from that of the combined videos. You can prevent that with |
I find the filters complex. Is it similar to ffmpeg's |
It is exactly the same as that, AFAIK. Filtergraph syntax is documented in |
The label names (for track selection) are different, otherwise the graph syntax is the same. |
At this moment i have 3 ipcams i would like to view them in the same window but i am having trouble understanding if it is a limitation or the construction of my command.
i can play simultaneously on two cameras. any ideas? |
this is not ffmpeg help channel. vstack default number of inputs is 2 if not specified. |
Are anyone know how to do 4 streams at once? |
|
4 input videos + scaling + sane positioning Based on: https://trac.ffmpeg.org/wiki/Create%20a%20mosaic%20out%20of%20several%20input%20videos f1=file1.mp4
f2=file2.mp4
f3=zz.mp4
f4=last.mp4
xsize=960
ysize=540
scale="${xsize}x${ysize}"
full="$((2*${xsize}))x$((2*${ysize}))"
mpv \
${f0} \
--external-file=${f1} \
--external-file=${f2} \
--external-file=${f3} \
--lavfi-complex="
nullsrc=size=${full} [base];
[vid1] setpts=PTS-STARTPTS, scale=${scale} [upleft];
[vid2] setpts=PTS-STARTPTS, scale=${scale} [upright];
[vid3] setpts=PTS-STARTPTS, scale=${scale} [downleft];
[vid4] setpts=PTS-STARTPTS, scale=${scale} [downright];
[base][upleft] overlay=shortest=1 [tmp1];
[tmp1][upright] overlay=shortest=1:x=${xsize} [tmp2];
[tmp2][downleft] overlay=shortest=1:y=${ysize} [tmp3];
[tmp3][downright] overlay=shortest=1:x=${xsize}:y=${ysize} [vo]
"
|
This will break horribly with timestamp gaps between files, and within files. |
Do you suggest that it would be better to set PTS to something like |
If you do not set it than I guess you will not like output of video. |
Hi everyone,
Maybe this is not the right place for this, or maybe this feature already exist and I’ve missed it or they are existing third-party tool allowing this, in which case I suppose someone will be kind enough to show me the right direction. ;)
I have a use case where I would like to play multiple videos side by side (OK, until there nothing my WM can’t do), but synchronously (and that’s the thing). They all have the same duration and resolution (or at least aspect ratio).
Ideally, I would like to choose how the videos are placed with regard to each other, but I could definitively live with a fixed setup for 2, 3 and 4 streams (which I consider a reasonable limit for the feature to be useful, unless you have a very big screen).
In my case, the splitting for 2 streams would be left/right halves of the screen for instance, but maybe it could be upper/lower ones depending on the aspect ratio in other cases. For 4 streams, 4 corners, but again that could depend on aspect ratio. For 3 stream, maybe 4 corners with a black one. Ditto.
Since this looks like lot of work in mpv for a certainly not high priority feature (if desirable at all), I was wondering whether this splitting could be left at the user responsibility (which can then use whatever — tiling for instance — WM he wants), while providing a way to synchronise multiple mpv instances.
Is there a way to do so? Else, could it be done?
Thanks in advance, and keep doing great work!
The text was updated successfully, but these errors were encountered: