Git Product home page Git Product logo

Comments (8)

tieleman avatar tieleman commented on August 22, 2024

Workaround: due to the way Node passes arguments to ffmpeg it should never be required to double-quote your arguments. So in the aforementioned case, this works:

$ curl -XPOST -d '{
    "source_file": "/tmp/sinterklaas.mov",
    "destination_file":"/tmp/sinterklaas_out.mov",
    "encoder_options": "-acodec copy -vcodec libx264 -vf scale=60:60"
}' http://localhost:8080/jobs

from codem-transcode.

eiktyrner avatar eiktyrner commented on August 22, 2024

I'm having some issues with double quotes so I figured I would post in this issue even if it's old.
This doesn't work

$ curl -XPOST -d '{
"source_file":"/tmp/input.mov",
"destination_file":"/tmp/output.mov",
"encoder_options":"-filter_complex [0:0][0:1] amerge=input=2 -c:a aac -c:v libx264 -preset fast -crf 22 -pix_fmt yuv420p -g 5 -strict -2"
}' http://192.168.16.44:8080/jobs

Gives error

[AVFilterGraph @ 0x1e2d0c0] No such filter: ''
Error configuring filters.
' (1)."

While this works

$ ffmpeg -i input.mov -filter_complex "[0:0][0:1] amerge=inputs=2" -c:a aac -c:v libx264 -preset fast -crf 22 -pix_fmt yuv420p -g 5 -strict -2 Output.mov

Any ideas?

from codem-transcode.

deedos avatar deedos commented on August 22, 2024

Hi Jacob.

Did you tey to use single quotes ? For me, it worked
cheers

2015-07-22 5:33 GMT-03:00 Jacob Alenius [email protected]:

I'm having some issues with double quotes so I figured I would post in
this issue even if it's old.
This doesn't work

$ curl -XPOST -d '{
"source_file":"/tmp/input.mov",
"destination_file":"/tmp/output.mov",
"encoder_options":"-filter_complex [0:0][0:1] amerge=input=2 -c:a aac -c:v libx264 -preset fast -crf 22 -pix_fmt yuv420p -g 5 -strict -2"
}' http://192.168.16.44:8080/jobs

Gives error

[AVFilterGraph @ 0x1e2d0c0] No such filter: ''
Error configuring filters.
' (1)."

While this works

$ ffmpeg -i input.mov -filter_complex "[0:0][0:1] amerge=inputs=2" -c:a aac -c:v libx264 Output.mov

Any ideas?


Reply to this email directly or view it on GitHub
#24 (comment)
.

Daniel Roviriego
(21) 35920701
(21) 99561654

from codem-transcode.

eiktyrner avatar eiktyrner commented on August 22, 2024

Do you mean like this? That would mess with the single quotes that are encapsulating the data. Could you post the whole command you used that worked?

$ curl -XPOST -d '{
"source_file":"/tmp/input.mov",
"destination_file":"/tmp/output.mov",
"encoder_options":"-filter_complex '[0:0][0:1] amerge=input=2' -c:a aac -c:v libx264 -preset fast -crf 22 -pix_fmt yuv420p -g 5 -strict -2"
}' http://192.168.16.44:8080/jobs

from codem-transcode.

tieleman avatar tieleman commented on August 22, 2024

@eiktyrner, I've just pushed a commit that should enable you to use complex filters. The issue was that the encoder_options string is simply being split on whitespace to create an array for the arguments. Obviously this does not work if your filter has whitespace in it.

Can you check out the code and try again (it's not in the released version yet, so you need to check out the code with git)? Instead of a string you should supply an array with arguments for the encoder_options. Your command should be something like:

$ curl -XPOST -d '{
"source_file":"/tmp/input.mov",
"destination_file":"/tmp/output.mov",
"encoder_options":["-filter_complex", "[0:0][0:1] amerge=input=2", "-c:a", "aac", "-c:v", "libx264", "-preset", "fast", "-crf", "22", "-pix_fmt", "yuv420p", "-g", "5", "-strict", "-2"]
}' http://192.168.16.44:8080/jobs

Note that the arguments shouldn't need any additional quotes around them.

from codem-transcode.

deedos avatar deedos commented on August 22, 2024

Hi @eiktyrner https://github.com/eiktyrner, good that @tieleman had gone
for a definite solution.
I did give you a bad answer. What worked to me was using no quotes at all,
but within the codem-scheduler preset parameter, just like these for overlaying a watermark:

-i /path-to-my-watermark.png -filter_complex
[0:v]overlay=0:0[outv];[outv]yadif=1[deint] -map [deint] -map 0:a
-acodec libfdk_aac -ab 256k -vcodec libx264 -vb 4700k

my ffmpeg line for testing had single quote for the filter-complex:

-filter_complex '[0:v]overlay=0:0[outv];[outv]yadif=1[deint]'

Anyway, good luck

2015-07-28 11:26 GMT-03:00 Sjoerd Tieleman [email protected]:

@eiktyrner https://github.com/eiktyrner, I've just pushed a commit that
should enable you to use complex filters. The issue was that the
encoder_options string is simply being split on whitespace to create an
array for the arguments. Obviously this does not work if your filter has
whitespace in it.

Can you check out the code and try again? Instead of a string you should
supply an array with arguments for the encoder_options. Your command should
be something like:

$ curl -XPOST -d '{
"source_file":"/tmp/input.mov",
"destination_file":"/tmp/output.mov",
"encoder_options":["-filter_complex", "[0:0][0:1] amerge=input=2", "-c:a", "aac", "-c:v", "libx264", "-preset", "fast", "-crf", "22", "-pix_fmt", "yuv420p", "-g", "5", "-strict", "-2"]
}' http://192.168.16.44:8080/jobs

Note that the arguments shouldn't need any additional quotes around them.


Reply to this email directly or view it on GitHub
#24 (comment)
.

Daniel Roviriego
(21) 35920701
(21) 99561654

from codem-transcode.

eiktyrner avatar eiktyrner commented on August 22, 2024

@tieleman Yeah that works, I also managed to get it to work without that space in "[0:0][0:1]amerge=inputs=2", seems it wasn't needed at all. But this should hopefully be a bit more fool proof. Cheers!

from codem-transcode.

tieleman avatar tieleman commented on August 22, 2024

Yeah, I don't know what took me so long to provide a proper fix for this. 😬 Seeing as there's now a definitive way to provide "complex" arguments, I'm going to close this issue, seeing as this is just the way Node.js handles arguments.

from codem-transcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.