\$\begingroup\$
\$\endgroup\$
3
Here is command line for playing two videos side by side in sync in FFmpeg (ffplay). It can be useful for comaring videos, for example.
ffplay -v warning -f rawvideo -s 800x400 -i /dev/zero -vf 'movie=video1.mkv,scale=400x400 [mv2] ; movie=video2.mkv,scale=400x400 [mv1]; [in][mv1] overlay=0:0 [tmp]; [tmp][mv2] overlay=400:0'
Is there some better way, in particular:
- Without using fake video input;
- More easily extendible, without inventing names for
[tmp]
; - Maybe with automatic geometry calculation, without manual coordinates;
- Input video filenames should be more easily visible and together?
200_success
146k22 gold badges190 silver badges478 bronze badges
-
\$\begingroup\$ That's really cool! I have to admit I never considered doing that using ffplay. Would you consider using multiple instances of ffplay or vlc or mplayer and align the windows either manually or using -geometry? Or does it all have to be in one window? \$\endgroup\$user1149– user11492016年01月22日 21:03:01 +00:00Commented Jan 22, 2016 at 21:03
-
\$\begingroup\$ It should pause and seek in sync. \$\endgroup\$Vi.– Vi.2016年01月23日 03:00:48 +00:00Commented Jan 23, 2016 at 3:00
-
3\$\begingroup\$ This question is being discussed on Meta Code Review. \$\endgroup\$200_success– 200_success2016年03月10日 19:19:44 +00:00Commented Mar 10, 2016 at 19:19
1 Answer 1
\$\begingroup\$
\$\endgroup\$
Partial result
ffmpeg -v warning -i video1.mkv -i video2.mkv -filter_complex '[0:v]scale=400:400,pad=800:400 [0:q]; [1:v]scale=400:400[1:q]; [0:q][1:q]overlay=400:0' -f nut -c:v rawvideo -c:a copy - | mplayer -noconsolecontrols -cache-min 1 -cache 1024000 -
- Dummy video input removed
- Filenames now separate command line aguments, not parts of a longer string
- Still manual geometry
- Still not automatically extendible to more videos
- Preparing and playing video decoupled, now can use other player instead of
mplayer
(unfortunatelympv
orvlc
fails to provide seeking in this scenario) - Audio is preserved
default