ffmpeg command for video encoding side by side

478 views
Skip to first unread message

Alexander Wessel

unread,
Dec 16, 2013, 5:13:18 PM12/16/13
to matterho...@opencast.org

Hi guys,


I’m currently working on the video encoding to get the presenter and presentation video side by side. A few days ago, Fernando gave me the advice to use the code from the Berkley forge. I was able to adopt the necessary java classes to my system and now I can call ffmpeg with two video file arguments.


The current problem is that my ffmpeg command contains double quotes for the filter and it works fine on the shell but when opencast fire the command to ffmpeg I get the following error:


[AVFilterGraph @ 0x1dc36a0] No such filter: '"'


This is my ffmpeg command:


ffmpeg -i dozentKurz.flv -i vgaKurz.flv -filter_complex "[0:v]setpts=PTS-STARTPTS, pad=iw*2:ih[bg];[1:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=main_w/2[out]" -map "[out]" -map 0:a -r 25 -vcodec libx264 -qscale 3 -deinterlace -acodec libfaac -ab 128k -ar 44100 output.mp4

 

and this the ffmpeg promt:

 

ffmpeg version 2.0.2 Copyright (c) 2000-2013 the FFmpeg developers 

major_brand     : isom

minor_version   : 512

compatible_brands: isomiso2avc1mp41

encoder         : Lavf55.21.100

major_brand     : isom

minor_version   : 512

compatible_brands: isomiso2avc1mp41

encoder         : Lavf55.21.100

[AVFilterGraph @ 0x1dc36a0] No such filter: '"'

Error configuring filters.

 

What did I miss?

 

Best regards,

Alexander

 

Alexander Bias

unread,
Dec 18, 2013, 2:15:21 AM12/18/13
to matterho...@opencast.org
Dear Alexander,

we have also the need for combining two videos side-by-side in Matterhorn and have thougt for quite some time now about this.

There were ideas about using the CLI operation handler (which isn't usable as it is nearly undocumented) or Teltek's Execute Service (which we didn't get running on 1.4.x up to now unfortunately) or taking some custom code from another adopter like you try to do now.

Some days ago, we were happy to read on the Dev's list that Entwine has an "official" solution ready and that they will be contributing it to Matterhorn core now. I think you could have a look at https://opencast.jira.com/browse/MH-10006 to see if this contribution solves your problem withing fiddling with ffmpeg command lines.

Best regards
Alexander Bias

University of Ulm
Communication and Information Centre (kiz)
Information systems department
> --
> You received this message because you are subscribed to the Google Groups "Matterhorn Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to matterhorn-use...@opencast.org.
> To post to this group, send email to matterho...@opencast.org.
> Visit this group at http://groups.google.com/a/opencast.org/group/matterhorn-users/.

Rubén Pérez

unread,
Dec 19, 2013, 6:09:47 AM12/19/13
to matterho...@opencast.org
Dear list,

While I'm glad to see the code contribution made by Entwine on this topic, I'm surprised by Alexander's statement that "they couldn't make the Execute Service work in 1.4". We have been using it for a while without issues. I'll be more than glad to give you a hand to make it work (if there's something wrong with the service, it's good we can fix it).

Re. your ffmpeg problems, you probably need to escape the quotes and the inverted slashes escaping the quotes, so you'll probably have to experiment with \\" \\\" or even \\\\", depending on the extent to which Matterhorn is "interpreting" the encoding profile.

Best regards

Rubén Pérez Vázquez



2013/12/18 Alexander Bias <alexand...@uni-ulm.de>

Alexander Bias

unread,
Dec 20, 2013, 2:48:15 AM12/20/13
to matterho...@opencast.org
Dear Rubén,

> While I'm glad to see the code contribution made by Entwine on this topic, I'm surprised by Alexander's statement that "they couldn't make the Execute Service work in 1.4". We have been using it for a while without issues. I'll be more than glad to give you a hand to make it work (if there's something wrong with the service, it's good we can fix it).

I didn't want to offend anyone with my statement about the Execute Service. Several weeks ago, we had tried intensely to set up the Execute service on a standard 1.4.0 distributed cluster. Somehow, the execute services on the particular MH nodes didn't want to communicate correctly and execute jobs didn't get executed. My colleague Andy had some mail contact about this problem with you, perhaps you remember.

We will try to use the Execute Service again at the beginning of next year and will contact you again off-list if the problems remain.

Lars Kiesow

unread,
Dec 20, 2013, 9:22:06 AM12/20/13
to matterho...@opencast.org
Hi Alexander,
there are two problems in your ffmpeg command line in regards of
Matterhorn:

- You have to escape all quotation marks you are using.
- You cannot have spaces within an argument as MH will assume they are
two arguments.

That said, if I remember correctly, MH starts ffmpeg directly and you
do not have to use “[” and “]” inside of quotation marks. Thus the
following encoding profile should work:

profile.pip-test.http.ffmpeg.command = -i presenter.mp4
-i presentation.mp4 -filter_complex
[0:v]pad=iw*2:ih[bg];[bg][1:v]overlay=main_w/2[out] -map [out] -map
0:a -c:v libx264 -c:a copy #{out.dir}/#{out.name}#{out.suffix}

Of cause, you have to replace “presenter.mp4” and “presentation.mp4”
with the appropriate variables for the operation handler.

Regards,
Lars
signature.asc

Lars Kiesow

unread,
Dec 20, 2013, 9:28:46 AM12/20/13
to matterho...@opencast.org
Hi Alexander,

if you've already pulled out the code from UCB, could you create a
patch for it and file a pull request against 1.5?

Regards,
Lars


On Fri, 20 Dec 2013 15:22:06 +0100
Lars Kiesow <lki...@Uni-Osnabrueck.DE> wrote:

> Hi Alexander,
> there are two problems in your ffmpeg command line in regards of
> Matterhorn:
>
> - You have to escape all quotation marks you are using.
> - You cannot have spaces within an argument as MH will assume they
> are two arguments.
>
> That said, if I remember correctly, MH starts ffmpeg directly and you
> do not have to use “[” and “]” inside of quotation marks. Thus the
> following encoding profile should work:
>
> profile.pip-test.http.ffmpeg.command = -i presenter.mp4
> -i presentation.mp4 -filter_complex
> [0:v]pad=iw*2:ih[bg];[bg][1:v]overlay=main_w/2[out] -map [out] -map
> 0:a -c:v libx264 -c:a copy #{out.dir}/#{out.name}#{out.suffix}
>
> Of cause, you have to replace “presenter.mp4” and “presentation.mp4”
> with the appropriate variables for the operation handler.
>
> Regards,
> Lars
>
>
> On Mon, 16 Dec 2013 23:13:18 +0100
> Alexander Wessel <alexander....@gmail.com> wrote:
>
signature.asc

Rubén Pérez

unread,
Dec 20, 2013, 11:13:36 AM12/20/13
to matterho...@opencast.org
Dear Alexander,

Please accept my apologies if my previous email sounded too agressive. I am by no means offended; quite the contrary, I'm pleased that the problems that may appear (in the ExecuteService and in any other parts of Matterhorn) are reported, so that we can improve the code and have a better system in the end. I'm sorry that you couldn't make it work at the time and, as I said, I'm willing to give you a hand if you still have trouble to use the service. 

I'm sorry to say I don't remember the mail you mention, but I'll go through my past emails and check what the issue was. The last two months have been crazy and I haven't had the time to follow the lists as much as I wanted, but I'm currently struggling to be up-to-date. I'm so sorry I couldn't be of help before, but hopefully we'll be able to make it work when you test it again at the beginning of the next year.

Best regards

Rubén Pérez Vázquez



2013/12/20 Alexander Bias <alexand...@uni-ulm.de>

Fernando Alvarez

unread,
Dec 20, 2013, 12:36:29 PM12/20/13
to matterho...@opencast.org
Alexander,

My apologies for not being very active in this thread, we've been in the throes of completing our release for the upcoming semester.

If you do need to escape a character, \\ should work. For example, escaping the comma in "scale=max(1920\\,iw)"

Regards,

Fernando

Jonathan Lee

unread,
Jan 17, 2014, 9:30:09 AM1/17/14
to matterho...@opencast.org
I didn't think it was possible to configure MH 1.4.1 to process multiple video files with a single encoder profile. If each video track is ingested with a separate flavor, wouldn't each one have its own encoding profile? On the other hand, if they share the same flavor, one would get ignored, right? If I can create a workflow and/or encoding profile that can process two files, that opens up many exciting possibilities, as I've been having to pre-process with ffmpeg prior to ingesting.

Lars Kiesow

unread,
Jan 18, 2014, 3:09:56 PM1/18/14
to matterho...@opencast.org
Hi Jonathan,
it is not possible with the default workflows included in 1.4.1. This
was about a custom workflow from the UCB. You can pull that out from
their public repo if you need it now or wait and maybe nag Fernando
that they should contibute this soon (they said that they want to do
that someday).
Regards,
Lars
signature.asc
Reply all
Reply to author
Forward
0 new messages