Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg fails when creating version wihtout watermark #23

Closed
mattiasottosson opened this issue Feb 11, 2014 · 6 comments · Fixed by #27
Closed

ffmpeg fails when creating version wihtout watermark #23

mattiasottosson opened this issue Feb 11, 2014 · 6 comments · Fixed by #27

Comments

@mattiasottosson
Copy link
Contributor

I'm trying to convert a mp4 movie to a webm version using

version :webm do
    process encode_video: :webm
end

However, that fails when not providing a watermark, cause ffmpeg get's double inputs.

E, [2014-02-11T18:15:51.590871 #13143] ERROR -- : Failed encoding...
ffmpeg -y -i webm_homepage-featured-video.mp4 -vcodec libvpx -acodec libvorbis -s 640x360 -i {} -b 1500k -ab 160000 -f webm -g 30 -aspect 1.7777777777777777 tmpfile.webm

{}: No such file or directory
Errors: no output file created.

Running the same version with a watermark set to nil, it works fine

version :webm do
  process encode_video: [:webm, { watermark: nil } ]
end

It's probably due to the default empty hash that get set as a default value on initialize:
https://github.com/mattiasottosson/carrierwave-video/blob/master/lib/carrierwave/video/ffmpeg_options.rb#L-78

@mattiasottosson
Copy link
Contributor Author

Has streamios guidelines changed for how to apply the watermark?
From stremios doc:

Add watermark image on the video.

For example, you want to add a watermark on the video at right top corner with 10px padding.

options = { watermark: "full_path_of_watermark.png", resolution: "640x360", watermark_filter: { position: "RT", padding_x: 10, padding_y: 10 } }
Position can be "LT" (Left Top Corner), "RT" (Right Top Corner), "LB" (Left Bottom Corner), "RB" (Right Bottom Corner).

I began working on a branch that will apply the watermark options in streamios doc instead, and not pass it as a video filter, didn't had time to wrap it up though.

@artem-mindrov
Copy link

This happens for me too when using an edge version of streamio-ffmpeg. This is I believe due to changes in this commit

@rheaton
Copy link
Owner

rheaton commented Feb 28, 2014

Can either of you take a look into this and make a pull request? I'm not currently working on any projects with video transcoding, so it's hard for me to keep up with the edge versions of the gems.
Maybe we can detect the gem version and do some differently for the new one.

Thanks!

@artem-mindrov
Copy link

Is there any specific reason to set watermark option to an empty hash in defaults? If not, the necessary change would be as simple as removing it from defaults entirely.

@shir
Copy link
Contributor

shir commented May 5, 2014

Please take a look at PR #27

@rheaton
Copy link
Owner

rheaton commented May 13, 2014

I will try to get to your PR this week. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants