Opencast Video Encoding presentation / presenter side by side

63 views
Skip to first unread message

Alexander Wessel

unread,
Dec 8, 2013, 12:05:57 PM12/8/13
to matterho...@opencast.org

Hi,

 

I’ m a student from the university of applied sciences in Zwickau. We think about introducing opencast on our university. I’m currently  working on a demo setup to get first experience with the system. I’m trying to compose the presenter & presentation video in one file side by side to publish it for download.

 

So  I‘ m looking for a way to use two input videos in my FFmpeg encoding profile. Something like

 

profile.both.http. ffmpeg.command = -i #{in.video1.path} -i #{in.video2.path} …

 

The standard compose operation handler only works on a single file. So is there an out of the box  solution for my problem or do I need a custom operation handler?

 

Thanks for every comment.

 

best regards

 

Alexander

Fernando Alvarez

unread,
Dec 8, 2013, 1:16:19 PM12/8/13
to matterho...@opencast.org
Alexander,

I think the following is similar to what you are looking for:

profile.video-overlay.work.ffmpeg.command = -i #{left.video.path} -i #{right.video.path} -filter_complex "[0:v] scale=max(1920\\,iw):-1 [video]; [1:v] scale=max(1920\\,iw):-1 [screen]; [screen]pad=3840:ih[screen-padded];[screen-padded][video] overlay=shortest=1:x=1920" -c:v libx264 -qscale:v 2 -strict -2 #{out.dir}/#{out.name}#{out.suffix}

Here at Berkeley, we use it as part of the following profile definition which we've added to our fork of Matterhorn in /base/etc/encoding/matterhorn-movies.properties:

# Video overlay (two video streams)
profile.video-overlay.work.name = video overlay
profile.video-overlay.work.input = visual
profile.video-overlay.work.output = audiovisual
profile.video-overlay.work.suffix = -work.#{in.video.suffix}
profile.video-overlay.work.mimetype = video/mp4
profile.video-overlay.work.ffmpeg.command = -i #{left.video.path} -i #{right.video.path} -filter_complex "[0:v] scale=max(1920\\,iw):-1 [video]; [1:v] scale=max(1920\\,iw):-1 [screen]; [screen]pad=3840:ih[screen-padded];[screen-padded][video] overlay=shortest=1:x=1920" -c:v libx264 -qscale:v 2 -strict -2 #{out.dir}/#{out.name}#{out.suffix}

It forms part of our distribution process for YouTube, and appears in our workflow thus:

<operation
  if="${youtube}"
  id="merge-videos"
  fail-on-error="true"
  exception-handler-workflow="error"
  description="Create a side-by-side composition of presenter and presentation videos">
  <configurations>
    <configuration key="source-flavors">presenter/trimmed,presentation/trimmed</configuration>
    <configuration key="target-flavor">presenter/youtube</configuration>
    <configuration key="encoding-profile">video-overlay.work</configuration>
    <configuration key="target-tag">youtubein</configuration>
  </configurations>
</operation>

For an example of the resulting merged media, please see: Biology 1B, 001 - Fall 2013 in YouTube.

Regards,

Fernando

UCB

Lars Kiesow

unread,
Dec 8, 2013, 3:11:51 PM12/8/13
to matterho...@opencast.org
Hi Fernando,
I didn't know that there was such a workflow operation handler and
neither does our documentation:
https://opencast.jira.com/wiki/display/MHTRUNK/Workflow+Operation+Handler

Did you create this handler at the UCB? Or is it in the Matterhorn
Core and the creator did just “forget” to document it?

We don't merge our videos but provide two separate streams. It might,
however, become interesting for a new project.


@Alexander: You can find the fork that Fernando mentioned here:
https://bitbucket.org/opencast-community/matterhorn-berkeley-fork/src/ae8dae2c14fa2f95c4114723377991e90403abe0/etc/encoding/matterhorn-movies.properties?at=master
https://bitbucket.org/opencast-community/matterhorn-berkeley-fork/src/ae8dae2c14fa2f95c4114723377991e90403abe0/etc/workflows/lecture-process-publish-ucb-standard.xml

Regards,
Lars


On Sun, 8 Dec 2013 10:16:19 -0800 (PST)
Fernando Alvarez <fernando....@gmail.com> wrote:

> Alexander,
>
> I think the following is similar to what you are looking for:
>
> [...]
>
> It forms part of our distribution process for YouTube, and appears in
> our workflow thus:
>
> <operation
> if="${youtube}"
> id="merge-videos"
> fail-on-error="true"
> exception-handler-workflow="error"
> description="Create a side-by-side composition of presenter and
> presentation videos">
> <configurations>
> <configuration
> key="source-flavors">presenter/trimmed,presentation/trimmed</configuration>
> <configuration
> key="target-flavor">presenter/youtube</configuration> <configuration
> key="encoding-profile">video-overlay.work</configuration>
> <configuration key="target-tag">youtubein</configuration>
> </configurations> </operation>
>
>
> For an example of the resulting merged media, please see: Biology 1B,
> 001 - Fall
> 2013<http://www.youtube.com/watch?v=KvztsgZYZAg&list=PL-XXv-cvA_iDsUmhP2fwRPE8LpsX_sCxc>
signature.asc

Lars Kiesow

unread,
Dec 8, 2013, 5:23:01 PM12/8/13
to matterho...@opencast.org
Hi Fernando,

I kind of answered my question myself :)

I found the MergeVideosWorkflowOperationHandler to live in your branch
only. I'll probably drag it out and put it into a separate module
usable as extension for 1.4.1 in the next days. That is, if you don't
mind. Or do you have that module already separated from your other code
somewhere?

Regards,
Lars


On Sun, 8 Dec 2013 21:11:51 +0100
Lars Kiesow <lki...@Uni-Osnabrueck.DE> wrote:

> Hi Fernando,
> I didn't know that there was such a workflow operation handler and
> neither does our documentation:
> https://opencast.jira.com/wiki/display/MHTRUNK/Workflow+Operation+Handler
>
> Did you create this handler at the UCB? Or is it in the Matterhorn
> Core and the creator did just “forget” to document it?
>
> We don't merge our videos but provide two separate streams. It might,
> however, become interesting for a new project.
>
>
> @Alexander: You can find the fork that Fernando mentioned here:
> https://bitbucket.org/opencast-community/matterhorn-berkeley-fork/src/ae8dae2c14fa2f95c4114723377991e90403abe0/etc/encoding/matterhorn-movies.properties?at=master
> https://bitbucket.org/opencast-community/matterhorn-berkeley-fork/src/ae8dae2c14fa2f95c4114723377991e90403abe0/etc/workflows/lecture-process-publish-ucb-standard.xml
>
> Regards,
> Lars
>
>
> On Sun, 8 Dec 2013 10:16:19 -0800 (PST)
> Fernando Alvarez <fernando....@gmail.com> wrote:
>
> > Alexander,
> >
> > I think the following is similar to what you are looking for:
> >
> > [...]
> >
> > It forms part of our distribution process for YouTube, and appears
> > in our workflow thus:
> >
> > <operation
> > if="${youtube}"
> > id="merge-videos"
> > fail-on-error="true"
> > exception-handler-workflow="error"
> > description="Create a side-by-side composition of presenter and
> > presentation videos">
> > <configurations>
> > <configuration
> > key="source-flavors">presenter/trimmed,presentation/trimmed</configuration>
> > <configuration
> > key="target-flavor">presenter/youtube</configuration> <configuration
> > key="encoding-profile">video-overlay.work</configuration>
> > <configuration key="target-tag">youtubein</configuration>
> > </configurations> </operation>
> >
> >
> > For an example of the resulting merged media, please see: Biology
> > 1B, 001 - Fall
> > 2013<http://www.youtube.com/watch?v=KvztsgZYZAg&list=PL-XXv-cvA_iDsUmhP2fwRPE8LpsX_sCxc>
signature.asc

Fernando Alvarez

unread,
Dec 8, 2013, 9:51:27 PM12/8/13
to matterho...@opencast.org
Lars,

I was unaware that that handler was not in the base code, otherwise I would have included a reference in my response to Alexander - thanks for catching that! We certainly don't mind you incorporating it into the base code; in fact, now that our latest in-house release has reached feature-freeze for the upcoming semester, we plan to ramp up our contributions to the community.

Regards,

Fernando

Lars Kiesow

unread,
Dec 9, 2013, 10:50:32 AM12/9/13
to matterho...@opencast.org
Hi Fernando,
I just tried to pull the operation handler out of your branch, but I
noticed that it does not work standalone as it requires modifications
of the AbstractWorkflowOperationHandler (which could also be pulled
into the workflow handler) and the matterhorn-composer modules (Which
cannot be pulled out easily).

As you plan to publish them anyway, I'll just let you do it and wait
until it becomes part of the core. You know your code better anyway ;)

Regards,
Lars


On Sun, 8 Dec 2013 18:51:27 -0800 (PST)
signature.asc

Fernando Alvarez

unread,
Dec 9, 2013, 11:04:49 AM12/9/13
to matterho...@opencast.org
Lars,

We haven't put together a list yet of what we'll be contributing in this iteration but I'll be sure to communicate to the rest of the team that this enhancement is of great interest.

Regards,

Fernando

Fernando Alvarez

unread,
Jan 8, 2014, 2:01:25 PM1/8/14
to matterho...@opencast.org
Lars,

Given the functionality described in https://groups.google.com/a/opencast.org/forum/#!searchin/matterhorn/peer$20review/matterhorn/KfD26TFRpA8/k8uTaoQFVAcJ, is there still an interest in Berkeley's code? If so, in what way does it complement Entwine's SWITCH code?

Regards,

Fernando

Lars Kiesow

unread,
Jan 8, 2014, 2:15:11 PM1/8/14
to matterho...@opencast.org
Hi Fernando,
the difference between the code from Entwine and your workflow operation
is that with Entwines code you can only used a predefined filter chain
while you can put two input files into arbitrary ffmpeg command lines
(hope that I remember that correctly).

In other words:
- The Entwine code is much easier to use but can only be used for one
purpose. Still, if you just want to put two video streams on a
canvas and add a logo, you may as well use this.
- Your workflow operation is harder to use but can do real FFmpeg
magic, using arbitrary filters, create custom filter chains, etc.

Thus I still think your handler would be a valuable contribution,
although it is for some people now probably not as important as it was
before. Just create a pull request for it if you have the time.

Regards,
Lars


On Wed, 8 Jan 2014 11:01:25 -0800 (PST)
signature.asc
Reply all
Reply to author
Forward
0 new messages