Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • Extract RGB values from a AVFrame (FFMPEG) in C++

    9 novembre 2011, par Extrakun

    I am currently trying to read in video frames by using FFMPEG. The format is PIX_FMT_RGB24; For each frame, the RGB values are all combined together in frame->data[0] (Where frame is of the type AVFrame).

    How do I extract the individual R, G and B values for each frame? This is for processing the video. I would think it would work the same way as extracting the RGB values from a bitmap too. Thanks!

  • Access each Pixel of AVFrame

    9 novembre 2011, par EBAG

    I need to access each pixel informations of an AVFrame object of FFMPEG ( If it's in RGB then each color, R and G and B of each Pixel )

    How can I achieve that?

  • Transcoding to webm with ffmpeg audio problems

    9 novembre 2011, par Max A.

    For the past few days, I have been trying to get my lossless .mov video(that has an audio track) to a .webm format.

    Some info on the video & audio is that the fps is 30. Also the audio track has about 3-5 seconds of silence/blank audio before you start hearing some music.

    My problem is that is seems during the transcoding to webm, it strips away this blank audio because when I go to play the video, the audio starts right away.I've also notice that it jumps right away to ~4 seconds in the video. When i play it on the browser, it jumps to that moment in the timeline. If I try to scrub to the beginning, the video ends.

    I've have figured somethings out.

    1. This is just a webm problem. This does not happen with ogv or mp4
    2. It only happens if they is blank audio in the beginning of the audio track.

    I am using ffmpeg with the libvpx and libvorbis librarys and I am doing just the basic command line setup

    ffmpeg -i "infile" "outfile.webm"
    
  • Rails 3 : How can I make Paperclip-FFMPEG work ?

    9 novembre 2011, par remino

    I have Rails 3.0.3 with these gems:

    • delayed_job 2.1.4
    • delayed_paperclip 0.7.1
    • paperclip 2.3.16
    • paperclip-ffmpeg 0.7.0

    (This combination is very specific. Some newer gems will not work with others.)

    Here's my Video model:

    class Video < Upload
      has_attached_file :file, :default_style => :view, :processors => [:ffmpeg],
        :url => '/system/:class/:attachment/:id/:style/:basename.:extension',
        :path => ':rails_root/public/system/:class/:attachment/:id/:style' \
          + '/:basename.:extension',
        :default_url => '/images/en/processing.png',
        :styles => {
          :mp4video => { :geometry => '520x390', :format => 'mp4',
            :convert_options => { :output => { :vcodec => 'libx264',
              :vpre => 'ipod640', :b => '250k', :bt => '50k',
              :acodec => 'libfaac', :ab => '56k', :ac => 2 } } },
          :oggvideo => { :geometry => '520x390', :format => 'ogg',
            :convert_options => { :output => { :vcodec => 'libtheora',
              :b => '250k', :bt => '50k', :acodec => 'libvorbis',
              :ab => '56k', :ac => 2 } } },
          :view => { :geometry => '520x390', :format => 'jpg', :time => 1 },
          :preview => { :geometry => '160x120', :format => 'jpg', :time => 1 }
        }
      validates_attachment_content_type :file, :content_type => VIDEOTYPES,
        :if => Proc.new { |upload| upload.file.file? }
      process_in_background :file
    end
    

    When creating a new Video object with attachment, the original is saved, but no conversion will be done. Even calling Video.last.file.reprocess! won't to a thing except returning true. (Not sure what "true" means in this case as it didn't work.)

    I tried hardcoding the path to ffmpeg in Paperclip::options[:command_path]. I even tried deleting the paperclip-ffmpeg.rb file and replacing it with a blank file. Really thinking I'd get an exception by doing the later, instead, I simply got "true" again.

    It feels like the paperclip-ffmpeg.rb is being loaded, because it is required by config/application.rb, but nothing is called in it when trying to generate a thumbnail or convert a video.

    Can anyone help me with this? Thanks in advance!

  • Good library for encoding videos in a dynamic language ?

    8 novembre 2011, par Ryan

    I'm looking for an effective library for encoding videos. I would prefer something in one of the Ruby/Python ilk type languages, but I'd use libraries in C or PHP that were good. Essentially, I'm looking for something that wraps ffmpeg, and would allow me to convert H.264 .mp4's into .theora.ogv, .webm, and (this would be nice) .flv files.

    Worst case, I could always just use any language to natively execute ffmpeg, using something like command("ffmpeg -i ...etc."), but I'd prefer something a bit higher level/in-language if possible.

    I've already looked at RVideo, but couldn't get it to work correctly.