Multiple side-to-side video streams in one file without transcoding

后端 未结 2 1102
北海茫月
北海茫月 2021-01-07 01:39

I am investigating a possibility to store video streams which are coming from few sources already coded in h264 without video transcoding as the device I would like to use f

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 02:45

    If your player can handle it just make it perform the side-by-side view. No encoding or muxing required.

    mpv video player

    Example using mpv:

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

    The above example assumes each input has the same height. Otherwise you will have to add the scale, scale2ref, pad, and/or crop filters. Simple example using the crop filter to remove 20 pixels from the height:

    mpv --lavfi-complex="[vid1]crop=iw:ih-20[c];[c][vid2]hstack[vo];[aid1][aid2]amix[ao]" input1.mp4 --external-file=input2.mp4
    

    See the mpv documentation and FFmpeg Filters for more info.

提交回复
热议问题