Combine multiple videos into one

I have three videos:

  • lecture taken from the camcorder
  • video recording of the computer desktop used in the lecture
  • and video on the board

I want to create the final video with the three components that occupy a specific area of ​​the screen.

Is it open source software that will allow me to do this (mencoder, ffmpeg, virtualdub ..)? What do you recommend?

Or is there a C / C ++ API that will allow me to create something similar programmatically?

Edit
There will be many recorded lectures in the future. This means that I need a general / automatic solution.

I am currently checking if I can write an application with GStreamer to complete this task. Any comments on this?

Solved!
I managed to do this using the GStreamer video mixer element. I use the gst-launch syntax to create the pipeline, and then load it with gst_parse_launch. This is a really effective way to implement complex conveyors.

Here, the pipeline, which receives two incoming video streams and the logo image, mixes them into one stream and duplicates it so that it is simultaneously displayed and stored on disk.

  desktop. ! queue
           ! ffmpegcolorspace
           ! videoscale
           ! video/x-raw-yuv,width=640,height=480
           ! videobox right=-320
           ! ffmpegcolorspace
           ! vmix.sink_0
  webcam. ! queue
          ! ffmpegcolorspace
          ! videoscale
          ! video/x-raw-yuv,width=320,height=240
          ! vmix.sink_1
  logo. ! queue
        ! jpegdec
        ! ffmpegcolorspace
        ! videoscale
        ! video/x-raw-yuv,width=320,height=240
        ! vmix.sink_2
  vmix. ! t.
  t. ! queue
     ! ffmpegcolorspace
     ! ffenc_mpeg2video
     ! filesink location="recording.mpg"
  t. ! queue
     ! ffmpegcolorspace
     ! dshowvideosink
  videotestsrc name="desktop"
  videotestsrc name="webcam"
  multifilesrc name="logo" location="logo.jpg"
  videomixer name=vmix
             sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0
             sink_1::xpos=640 sink_1::ypos=0 sink_1::zorder=1
             sink_2::xpos=640 sink_2::ypos=240 sink_2::zorder=2
  tee name="t"
+5
source share
4 answers

This can be done using ffmpeg; I did it myself. However, it is technically difficult. However, this is what any other software that you can use will do at its core.

:

  • 1 wav
    • 2
    • 3
    • Demux 1 MPEG1
    • Demux 2
    • Demux 3
    • 1 + 2 + 3
    • 1 + 2 + 3
    • 123 123

, - , PCM wav, . , , , MPEG1/h.261.

, . , . bash script ffmpeg. API- ffmpeg, , , .

, . - , , - .

+4

, .

+2
+2

avisynth . .

ffmpeg , , , . C ++ libavformat libavcodec ( ffmpeg), , , . , , , avisynth virtualdub.

-1

All Articles