Git Product home page Git Product logo

Comments (17)

rheaton avatar rheaton commented on July 26, 2024

You should try to transcode the video with the streamio ffmpeg gem and make sure your ffmpeg install is correct.
This particular problem occurs because the "slow" preset for h264 encoding is being used and you don't have the file on your system.
I'd recommend using the presets as they give a better quality video, but you can pass in your own :custom params if you don't want to use them.

The preset files are here: http://www.mediasoftpro.com/aspnet-x264-presets.html
Depending on how you installed ffmpeg, you need to put them in the correct directory: http://ffmpeg.org/ffmpeg.html#Preset-files

I should probably update the docs with this info.

from carrierwave-video.

rheaton avatar rheaton commented on July 26, 2024

I've updated the readme with notes about the presets. Closing this issue.

from carrierwave-video.

vladimeeer avatar vladimeeer commented on July 26, 2024

Thanks. The link would be very helpful in readme.

from carrierwave-video.

rheaton avatar rheaton commented on July 26, 2024

I added it! :)

from carrierwave-video.

vladimeeer avatar vladimeeer commented on July 26, 2024

Could you help me how can I change preset from slow to medium? I tried to set custom parameter with "-preset medium". It still used slow preset.

Thanks.

from carrierwave-video.

rheaton avatar rheaton commented on July 26, 2024

Can you put the flags that it is being run with here so I can debug it?

@coreyti Would custom params allow for overriding the presets?

from carrierwave-video.

coreyti avatar coreyti commented on July 26, 2024

@vladimeeer and @rheaton, yes :custom will allow you to specify custom presets, and more. e.g.,

:custom => "-vpre slow -vpre hq"

from carrierwave-video.

coreyti avatar coreyti commented on July 26, 2024

...note that if you're on ffmpeg 0.11, I think the parameter changed for h264 presets. from -vpre to -preset

from carrierwave-video.

vladimeeer avatar vladimeeer commented on July 26, 2024

I've installed ffmpeg 0.11. I use following flags in video uploader:

process encode_video: [:mp4, resolution: :same, custom: "- preset medium -pix_fmt yuv420p"]

I got error:

Video Failed to transcode with FFmpeg. Check ffmpeg install and verify video is not corrupt or cut short. Original error: undefined method `/' for nil:NilClass

On Aug 13, 2012, at 4:33 PM, Rachel Heaton wrote:

Can you put the flags that it is being run with here so I can debug it?

@coreyti Would custom params allow for overriding the presets?


Reply to this email directly or view it on GitHub.

from carrierwave-video.

coreyti avatar coreyti commented on July 26, 2024

wow! that is not a very helpful error message :) do you have a logger set up? i believe that will show the actual ffmpeg command as run. might be helpful.

On Aug 14, 2012, at 6:06 PM, vladimeeer [email protected] wrote:

I've installed ffmpeg 0.11. I use following flags in video uploader:

process encode_video: [:mp4, resolution: :same, custom: "- preset medium -pix_fmt yuv420p"]

I got error:

Video Failed to transcode with FFmpeg. Check ffmpeg install and verify video is not corrupt or cut short. Original error: undefined method `/' for nil:NilClass

On Aug 13, 2012, at 4:33 PM, Rachel Heaton wrote:

Can you put the flags that it is being run with here so I can debug it?

@coreyti Would custom params allow for overriding the presets?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

from carrierwave-video.

vladimeeer avatar vladimeeer commented on July 26, 2024

No, it's not very helpful :) How can I setup logger to see what command ran?
I use Rails.logger. When there are not set any custom parameters like this

process encode_video: [:mp4]

there is an error message:

Video Failed to transcode with FFmpeg. Check ffmpeg install and verify video is not corrupt or cut short. Original error: Failed encoding. Errors: encoded file is invalid. Full output: ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers built on Jun 24 2012 17:41:42 with llvm_gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) configuration: --prefix=/usr/local/Cellar/ffmpeg/0.11.1 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libfreetype --cc=/usr/bin/llvm-gcc --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-libvo-aacenc --disable-ffplay libavutil 51. 54.100 / 51. 54.100 libavcodec 54. 23.100 / 54. 23.100 libavformat 54. 6.100 / 54. 6.100 libavdevice 54. 0.100 / 54. 0.100 libavfilter 2. 77.100 / 2. 77.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/milan/github/lettr/tmp/uploads/20120817-1548-771-5368/ForPitch.mp4': Metadata: major_brand : mp42 minor_version : 1 compatible_brands: M4V mp42isom creation_time : 2011-08-22 20:50:24 Duration: 00:01:37.52, start: 0.000000, bitrate: 266 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 216 kb/s, 15 fps, 15 tbr, 15k tbn, 30 tbc Metadata: creation_time : 2011-08-22 20:50:24 handler_name : Video Media Handler Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 47 kb/s Metadata: creation_time : 2011-08-22 20:50:24 handler_name : Sound Media Handler Please use -q:a or -q:v, -qscale is ambiguous [buffer @ 0x7fd74bc16040] w:800 h:600 pixfmt:yuv420p tb:1/15000 sar:1/1 sws_param:flags=2 [buffersink @ 0x7fd74bc16260] No opaque field provided [scale @ 0x7fd74bc15c00] w:800 h:600 fmt:yuv420p sar:1/1 -> w:640 h:480 fmt:yuv420p sar:1/1 flags:0x4 [NULL @ 0x7fd74c047200] [Eval @ 0x7fff641ef800] Undefined constant or missing '(' in 'bpyramid' [NULL @ 0x7fd74c047200] Unable to parse option value "bpyramid+mixed_refs+wpred+dct8x8+fastpskip+mbtree-wpred-dct8x8+mbtree" [NULL @ 0x7fd74c047200] Error setting option flags2 to value +bpyramid+mixed_refs+wpred+dct8x8+fastpskip+mbtree-wpred-dct8x8+mbtree. Output #0, mp4, to '/Users/milan/github/lettr/tmp/uploads/20120817-1548-771-5368/tmpfile.mp4': Metadata: major_brand : mp42 minor_version : 1 compatible_brands: M4V mp42isom creation_time : 2011-08-22 20:50:24 Stream #0:0(eng): Video: none, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 90k tbn, 15 tbc Metadata: creation_time : 2011-08-22 20:50:24 handler_name : Video Media Handler Stream #0:1(eng): Audio: none, 44100 Hz, stereo, s16, 128 kb/s Metadata: creation_time : 2011-08-22 20:50:24 handler_name : Sound Media Handler Stream mapping: Stream #0:0 -> #0:0 (h264 -> libx264) Stream #0:1 -> #0:1 (aac -> libfaac) Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

from carrierwave-video.

rheaton avatar rheaton commented on July 26, 2024

Hi Vladimeer-

Were able to get streamio-ffmpeg to transcode the video without the gem options, or just using ffmpeg command line to transcode the video?

We saw an error like this when trying to work with a video that did not upload to completion, and there was nothing we could do about it. Our mac was able to play is with quicktime, but ffmpeg's mp4 library couldn't work with it.

@coreyti correct me if my memory is failing. ;)

from carrierwave-video.

vladimeeer avatar vladimeeer commented on July 26, 2024

were able to encode video in rails console with streamio-ffmpeg.
Here is what parameters I used:

movie = FFMPEG::Movie.new('/Users/milan/Desktop/ICT_showcase.mp4')
movie.transcode('hello.mp4',"-preset medium -pix_fmt yuv420p")

Here is result:

Running transcoding...
ffmpeg -y -i /Users/milan/Desktop/ICT_showcase.mp4 -preset medium -pix_fmt yuv420p 'hello.mp4'
Transcoding of /Users/milan/Desktop/ICT_showcase.mp4 to hello.mp4 succeeded

How did you solved your problem with that? It didn't work from me on local either on s3.

Thanks.

from carrierwave-video.

rheaton avatar rheaton commented on July 26, 2024

Did you ever get this working?

Looks like the flags sent to ffmpeg from my gem are not correct.
When using the gem, can you get the flags that are being sent to ffmpeg?

You should be able to get this by setting the logger. You should also tail your application log as some stuff is written to standard out by the ffmpeg gem, I think.
I'm not currently working with carrierwave video, so sorry for the slow responses!

from carrierwave-video.

coreyti avatar coreyti commented on July 26, 2024

This has to do with a change between how the h.264 flags are set between ffmpeg versions 0.10 and 0.11: -vpre (I believe it was) became -preset. With the current version of carrierwave-vidoe, this can be accomplished using the :custom option.

Coreyhttp://about.me/coreyti

On Tuesday, September 4, 2012 at 7:09 PM, Rachel Heaton wrote:

Did you ever get this working?
Looks like the flags sent to ffmpeg from my gem are not correct.
When using the gem, can you get the flags that are being sent to ffmpeg?
You should be able to get this by setting the logger. You should also tail your application log as some stuff is written to standard out by the ffmpeg gem, I think.
I'm not currently working with carrierwave video, so sorry for the slow responses!


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

from carrierwave-video.

vladimeeer avatar vladimeeer commented on July 26, 2024

Actually, I have never got working this. I will try it with custom parameters this weekend. I am using it on my
hobby project lettr. You can take a look on http://send.lettr.co.

Thanks a lot for your help. I am glad for any help with :)
Hopefully, I will come with good news after weekend :D

from carrierwave-video.

vladimeeer avatar vladimeeer commented on July 26, 2024

Today, I took a look on the video processing. I set logger to get actual ffmpeg command. Video precessing was as you can see below:
process encode_video: [:mp4, custom: "-preset medium", logger: :log_video_processing]

There was this command in log.
ffmpeg -y -i /Users/milan/github/lettr/tmp/uploads/20120909-1115-859-0409/ForPitch.mp4 -vcodec libx264 -acodec libfaac -qscale 0 -vpre slow -vpre baseline -g 30 -s 640x480 -aspect 1.3333333333333333 '/Users/milan/github/lettr/tmp/uploads/20120909-1115-859-0409/tmpfile.mp4'

Even I set custom parameter. It wasn't in the actual command.
I will try it last time this way. Otherwise, I will process it directly with streamio when I won't manage it to work ;)

Thanks @rheaton and @coreyti for helping out.

from carrierwave-video.

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.