Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • converted video using ffmpeg not having video

    24 décembre 2013, par Karan Bisht

    I am using dedicated server.
    ffmpeg is installed.

    using this code, works fine

    $result = shell_exec($path_ffmpg.'/ffmpeg -i '.$dir.'/'.$_SESSION['user_folder'].'/'.$actual_image_name.' -sameq '.$dir.'/'.$_SESSION['user_folder'].'/'.$modified_name.'&');
    

    this convert only audio mp4.
    not video in the converted file.
    When I used other conversion code video is not converted.
    please help

  • Raising and Rescuing Custom Exception

    24 décembre 2013, par cmw

    I'm using Rails 3 with Carrierwave and FFMPEG to handle video uploads and encoding.

    In my uploader, I'm using FFMPEG to grab the duration of the video from cache before storing it.

    I'd like to raise a custom exception if the video's duration exceeds a specific length and then route the user accordingly. I've spent quite a bit of time trying to figure out how to create, raise and rescue my own custom exceptions in Rails – but, I've had no luck.

    Some posts I've used to try to piece this together include this stack overflow post and this article on customized exception handling in Rails 3. I've had no luck yet.

    I'm hoping someone can offer guidance on the proper approach to this. My mind is blown.

    Below is what my uploader looks like:

    class VideoUploader < CarrierWave::Uploader::Base
    
      before :store, :ffmpeg
    
      # Set storage type
      storage :fog
    
      # Override the directory where uploaded files will be stored.
      def store_dir
        "#{model.class.to_s.underscore}/videos/#{model.id}"
      end
    
      # Add a white list of extensions which are allowed to be uploaded.
      def extension_white_list
        %w(mov avi mp4 mkv wmv mpg)
      end
    
      def full_cache_path
        "#{::Rails.root}/public/#{cache_dir}/#{cache_name}"
      end
    
      private 
    
      def ffmpeg(*args)
        @model.video.cache_stored_file!
        movie = FFMPEG::Movie.new("#{model.video.full_cache_path}")
        if movie.duration > 600
          raise "my custom exception will go here one day"
        end
      end
    
    end
    
  • FFMPEG inside a C#/C++ multithreaded application [on hold]

    24 décembre 2013, par oferbar

    I've inherited an application written mostly in C# that calls FFMPEG libraries to decode video frames, specifically avcodec_decode_video2().

    The general flow of a frame is like this:

    1. A frame is allocated and filled inside a C# dedicated thread (a.k.a. 'player').
    2. A managed C++ object is called to decode the frame.
    3. The Decode() method is initializing the parameters for avcodec_decode_video2() and calling this function.

    When I have 1-6 thread running in parallel and decoding frames I get no errors. However, when I increase the number of threads (>6) the decoding function starts failing and the got_picture_ptr parameter is returned as zero (no picture was decoded).

    The FFMPEG log gave me a hint: "no picture ooo" = out of order frames.

    I suspect that something fishy is going on with passing a managed memory block inside a frame to an the unmanaged code, maybe the pointer is moved?

    Anyway, any advice on where to look would be greatly appreciated. I've done quite a lot of digging into this, but so far without luck.

    [Windows 7/64-bit, .NET 4.0.]

    Thx!

    Ofer

  • Configured Half-ninja android FFMPEG project

    24 décembre 2013, par Mr.G

    I have configured android-halfninja project completely and i manage to build

    refered to this link

    libs/armeabi/libvideokit.so and libs/armeabi/ffmpeg

    libs from the given source

    But i had to make some changes to the .sh files in order to build .so files.

    But now i tried to execute following ffmpeg command in my android project it doesn't run properly

        String var[] = {"ffmpeg","-i",input};
    
    
    
    12-24 10:34:44.569: I/VideoKit(14374): Loading native library compiled at 14:43:51 Dec 18 2013
    12-24 10:34:44.599: I/ActivityManager(290): Process uk.co.halfninja.videokit (pid 14374) has died.
    12-24 10:34:44.599: W/ActivityManager(290): Force removing ActivityRecord{2bea3e28 uk.co.halfninja.videokit/.MainActivity}: app died, no saved state
    

    Can any one tell me what might be th issue to have this error in half-nonja project

    here is my configure_ffmpeg.sh file

        #!/bin/bash
    pushd `dirname $0`
    . settings.sh
    
    if [[ $DEBUG == 1 ]]; then
      echo "DEBUG = 1"
      DEBUG_FLAG="--disable-stripping"
    fi
    
    # I haven't found a reliable way to install/uninstall a patch from a Makefile,
    # so just always try to apply it, and ignore it if it fails. Works fine unless
    # the files being patched have changed, in which cause a partial application
    # could happen unnoticed.
    patch -N -p1 --reject-file=- < redact-plugins.patch
    patch -N -p1 --reject-file=- < arm-asm-fix.patch
    patch -d ffmpeg -N -p1 --reject-file=- < \
        ARM_generate_position_independent_code_to_access_data_symbols.patch
    patch -d ffmpeg -N -p1 --reject-file=- < \
        ARM_intmath_use_native-size_return_types_for_clipping_functions.patch
    patch -d ffmpeg -N -p1 --reject-file=- < \
        enable-fake-pkg-config.patch
    
    pushd ffmpeg
    
    ./configure \
    $DEBUG_FLAG \
    --arch=arm \
    --cpu=cortex-a8 \
    --target-os=linux \
    --enable-runtime-cpudetect \
    --prefix=$prefix \
    --enable-pic \
    --disable-shared \
    --enable-static \
    --cross-prefix=$NDK_TOOLCHAIN_BASE/bin/$NDK_ABI-linux-androideabi- \
    --sysroot="$NDK_SYSROOT" \
    --extra-cflags="-I../x264 -mfloat-abi=softfp -mfpu=neon" \
    --extra-ldflags="-L../x264" \
    \
    --enable-version3 \
    --enable-gpl \
    \
    --disable-doc \
    --enable-yasm \
    \
    --disable-everything \
    --enable-decoder=mjpeg \
    --enable-demuxer=mjpeg \
    --enable-parser=mjpeg \
    --enable-demuxer=image2 \
    --enable-muxer=mp4 \
    --enable-encoder=libx264 \
    --enable-decoder=rawvideo \
    --enable-protocol=file \
    --enable-hwaccels \
    --enable-filter=buffer \
    --enable-filter=buffersink \
    --disable-demuxer=v4l \
    --disable-demuxer=v4l2 \
    --disable-indev=v4l \
    --disable-indev=v4l2 \
    \
    --disable-indevs \
    --enable-indev=lavfi \
    --disable-outdevs \
    \
    --enable-hwaccels \
    \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-network \
    \
    --enable-libx264 \
    --enable-zlib \
    --enable-muxer=md5
    
    popd; popd
    
    
    #--enable-decoders \
    #--enable-encoders \
    #--enable-muxers \
    #--enable-demuxers \
    #--enable-parsers \
    #--enable-protocols \
    #--enable-filter=buffer \
    #--enable-filter=buffersink \
    #--enable-avresample \
    #--enable-faac \
    
  • Calling FFMPEG's av_frame_free from managed vc++

    24 décembre 2013, par oferbar

    I am trying to compile the following code fragment in vc++ 2010 (using /cli flag):

     AVFrame * m_Decoded = av_frame_alloc();
     av_frame_free(&m_Decoded);
    

    However, the second line throws an error:

    error C2664: 'av_frame_free' : cannot convert parameter 1 from 'cli::interior_ptr' to 'AVFrame **'

    Any idea how to bypass this problem?

    Thanks!

    Ofer