Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg and ffplay for windows send CRLF inside double quote

    14 juin 2016, par uingtea

    I want to pass multiple headers for ffplay or ffmpeg, it say I need to split with CRLF. on linux I can use \ or $'\r\n' but how for windows?

    SET CRLF=^
    ffplay -v debug -i "http://example.com/test" -headers "Accept-Language: en-US,en;q=0.5%CRLF%Connection: keep-alive"
    

    debug log: Connection: keep-alive is not sent

    [http @ 04df3f40] No trailing CRLF found in HTTP header.
    [http @ 04df3f40] request: GET /test HTTP/1.1 0KB sq=    0B f=0/0
    User-Agent: Lavf/57.37.101
    Accept: */*
    Range: bytes=0-
    Connection: close
    Host: example.com
    Icy-MetaData: 1
    Accept-Language: en-US,en;q=0.5
    

    thanks

  • Rails 4 App Video Uploading CarrierWave AWS & Heroku - ffmpeg : command not found

    14 juin 2016, par still_learning

    Have a basic Rails 4 App where users can register and then upload a video.

    Can't get app working in production on Heroku with CarrierWave and AWS.

    Whenever I try upload a video I get the following error:

    Errno::ENOENT (No such file or directory - the ffprobe binary could not be found in /app/vendor/bundle/ruby/2.2.0/bin:/app/bin:/app/vendor/bundle/bin:/usr/local/bin:/usr/bin:/bin):


    Used brew to install ffmpeg and ffmpeg2theora on my system.

    Then used the Heroku Buildpacks to add ffmpeg to my Heroku App.

    $ heroku buildpacks
    === serene-temple-75731 Buildpack URLs
    1. heroku/ruby
    2. https://github.com/shunjikonishi/heroku-buildpack-ffmpeg


    But when I run:

    $ heroku run "ffmpeg -version"
    Running ffmpeg -version on ⬢ serene-temple-75731... up, run.8863
    bash: ffmpeg: command not found

    How do I get round this issue?

    Gemfile.rb

    gem 'carrierwave'
    gem 'carrierwave-video'
    gem 'video_thumbnailer'
    gem 'carrierwave-ffmpeg'
    gem "fog"
    

    video_uploader.rb

    class VideoUploader < CarrierWave::Uploader::Base
      include CarrierWave::RMagick
      include CarrierWave::Video
      include CarrierWave::FFmpeg
      include VideoThumbnailer
    
      storage :file
    
      version :mp4 do  
        process encode_video: [:mp4, custom: '-ss 00:00:00.000 -t 00:00:17.000', preserve_aspect_ratio: :height]
        def full_filename for_file
          png_name for_file, version_name, "mp4"
        end
      end
    end
    

    initializers/carrierwave.rb

    CarrierWave.configure do |config|
    
      # Use local storage if in development or test
      if Rails.env.development? || Rails.env.test?
        CarrierWave.configure do |config|
          config.storage = :file
        end
      end
    
      # Use AWS storage if in production
      if Rails.env.production?
        CarrierWave.configure do |config|
          config.storage = :fog
        end
      end
    
      config.fog_credentials = {
        :provider               => 'AWS',
        :aws_access_key_id      => 'ENV["AWS_ACCESS_KEY_ID"]',
        :aws_secret_access_key  => 'ENV["AWS_SECRET_ACCESS_KEY"]',
      }
      config.fog_directory  = 'ENV["S3_BUCKET_NAME"]'
      #config.fog_host       = 'https://assets.example.com'
      #config.fog_public     = false
      config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
    end
    

    Any suggestions? If you want more code just ask.

  • Python - Playing a video with audio (with OpenCV ?)

    14 juin 2016, par hoothoot

    This is probably a stupid question, and I have searched for this but didn't find a straightforward answer:

    Can you play a video with audio using OpenCV and FFMPEG?

    If not, what is the best way to do this? It seems so simple but I'm so new to Python that I don't know what to expect/what to search for.

    Thank you!

  • FFMPEG rotates images

    13 juin 2016, par Jaketr00

    I am trying to mass-resize images using FFMPEG, and I successfully did it using bash, but I noticed that some of the portrait images got rotated to landscape. Here is the original image, but as you see below, it gets rotated.

    Rotated image

    As you see above, the image is rotated. At first, I thought this was due to the -vf scale flag that I was using to resize the images, but I tried the following command and it still rotated the image.

    ffmpeg -i input.jpg output.jpg
    

    This doesn't happen with every image, and even not all the portrait images. Also, some images rotate clockwise, while some rotate counter-clockwise. And this isn't a random occurrence, all the images that originally rotated still rotate no matter how many times I run the command.

    Console Output

    ffmpeg version N-79942-gdc34fa6-tessus Copyright (c) 2000-2016 the FFmpeg developers
      built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
      configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
      libavutil      55. 23.100 / 55. 23.100
      libavcodec     57. 38.100 / 57. 38.100
      libavformat    57. 35.100 / 57. 35.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 44.100 /  6. 44.100
      libswscale      4.  1.100 /  4.  1.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, image2, from '/Users/jaketr00/Desktop/IMG_1902.JPG':
      Duration: 00:00:00.04, start: 0.000000, bitrate: 1025494 kb/s
        Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 5184x3456, 25 tbr, 25 tbn
    [image2 @ 0x7ff751803e00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Output #0, image2, to '/Users/jaketr00/Desktop/IMG_19022.JPG':
      Metadata:
        encoder         : Lavf57.35.100
        Stream #0:0: Video: mjpeg, yuvj422p(pc), 5184x3456, q=2-31, 200 kb/s, 25 fps, 25 tbn
        Metadata:
          encoder         : Lavc57.38.100 mjpeg
        Side data:
          cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream mapping:
      Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
    Press [q] to stop, [?] for help
    frame=    1 fps=0.0 q=8.2 size=N/A time=00:00:00.04 bitrate=N/A speed=0.0753x   frame=    1 fps=0.0 q=8.2 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.0752x    
    video:554kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    

    Is there any way to stop this from happening?

  • Proccess audio/video stream with opencv and export to audio/video stream

    13 juin 2016, par user3373406

    I need read a stream of audio/video and process the video with openCV.Then export the same stream with the video processed. All this need to be in real time. Of course you will have a delay for the processing with openCV. Thank.