Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • android ffmpeg halfninja av_open_input_file returns -2 (no such file or directory)

    20 janvier 2012, par cdavidyoung

    I have built ffmpeg for Android using the code and method described at

    https://github.com/halfninja/android-ffmpeg-x264

    using Ubuntu running in VirtualBox on windows. I then copied libvideokit.so into the Project\libs\armeabi folder of a Windows copy of the provided projects. From there I was able to run the ProjectTest from Eclipse on my Android device. I can see the ffmpeg code being executed but when it gets to the point of opening the input file it gives me the indicated error. I have noticed some discussion of this problem at

    FFMpeg on Android, undefined references to libavcodec functions, although it is listed on command line

    but the solutions have not helped since the file protocol is enabled in this build and I also tried putting "file:" in front of the filepath to no avail. For completeness I tried setting minimal_featureset=0 to enable all the defaults but this gives me the same error. Below is a snapshot of the logcat from Eclipse showing the output from Videokit with an extra call to LOGE to display the result from av_open_input_file. Any suggestions of things to try would be greatly appreciated.

    10-23 11:57:33.888: DEBUG/Videokit(4830): run() called
    10-23 11:57:33.888: DEBUG/Videokit(4830): run passing off to main()
    10-23 11:57:33.904: DEBUG/Videokit(4830): main(): registering all modules
    10-23 11:57:33.927: DEBUG/Videokit(4830): main(): registered everything
    10-23 11:57:33.927: DEBUG/Videokit(4830): main(): initting opts
    10-23 11:57:33.943: DEBUG/Videokit(4830): main(): initted opts.
    10-23 11:57:33.943: ERROR/Videokit(4830): ffmpeg version N-30996-gf925b24, Copyright (c) 2000-2011 the FFmpeg developers
    10-23 11:57:33.943: ERROR/Videokit(4830):   built on Oct 21 2011 13:54:03 with gcc 4.4.3
    10-23 11:57:33.943: ERROR/Videokit(4830):   configuration: --enable-cross-compile --arch=arm5te --enable-armv5te --target-os=linux --disable-stripping --prefix=../output --disable-neon --enable-version3 --disable-shared --enable-static --enable-gpl --enable-memalign-hack --cc=arm-linux-androideabi-gcc --ld=arm-linux-androideabi-ld --extra-cflags='-fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated' --disable-everything --enable-decoder=mjpeg --enable-demuxer=mjpeg --enable-parser=mjpeg --enable-demuxer=image2 --enable-muxer=mp4 --enable-encoder=libx264 --enable-libx264 --enable-decoder=rawvideo --enable-protocol=file --enable-hwaccels --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-filter=buffer --enable-filter=buffersink --disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l --disable-indev=v4l2 --extra-cflags='-I../x264 -Ivideokit' --extra-ldflags=-L../x264
    10-23 11:57:33.943: DEBUG/Videokit(4830): main(): parsing options
    10-23 11:57:33.943: DEBUG/Videokit(4830): parse_options has 4 options to parse
    10-23 11:57:33.951: ERROR/Videokit(4830): opt_input_file av_open_input_file /mnt/sdcard/fun/snap0000.jpg -2 
    10-23 11:57:33.951: ERROR/Videokit(4830): /mnt/sdcard/fun/snap0000.jpg: No such file or directory
    10-23 11:57:33.951: ERROR/Videokit(4830): ffmpeg_exit(1) called!
    
  • Securely using the PHP exec function

    19 janvier 2012, par siberiantiger

    I am writing a PHP script designed to run an executable file (ffmpeg.exe) via the exec() function. The problem is that I have read that using the exec() function can be a security risk and should be avoided if possible. I have been doing some research into how to run the exec() function securely, and the only thing that I keep coming across is to filter the command string with escapeshellcmd or escapeshellarg. What I want to know is if it is possible to further increase security when using the exec() function or if there is a secure alternative to exec(). Any help would be appreciated.

    Here is my code;

    define('FFMPEG_LIBRARY', 'c:\\ffmpeg7\\ffmpeg\\bin\\ffmpeg ');
    $transcode_string = FFMPEG_LIBRARY." -i " . $srcFile . " -acodec libmp3lame -ab 64k -ar 22050 -ac 1 -vcodec libx264 -b:v 250k -r 30 -f flv -y " . $destFile;
    $transcode_string = escapeshellcmd($transcode_string);
    exec($transcode_string);
    

    $srcFile is basically the video for transcoding while $destFile is the output file I wish to create.

  • how to explicitly specify matroska format file to be VFR

    19 janvier 2012, par Ulterior

    I am moving my code performing AVI recording with ffmpeg library to matroska format due to native support of VFR stated by format. Changing guess_format to matroska not touching any other settings produced an mkv file which seems to be ok. But the MediaInfo reports it to be CFS (30).

    How do I explicitly state that its VFR?

    Format                           : Matroska
    File size                        : 5.27 MiB
    Duration                         : 8s 0ms
    Overall bit rate                 : 5 528 Kbps
    Writing application              : Lavf52.78.1
    Writing library                  : Lavf52.78.1
    
    Video
    ID                               : 1
    Format                           : MPEG-4 Visual
    Format profile                   : Simple@L1
    Format settings, BVOP            : Yes
    Format settings, QPel            : No
    Format settings, GMC             : No warppoints
    Format settings, Matrix          : Default (H.263)
    Codec ID                         : V_MPEG4/ISO/ASP
    Codec ID/Info                    : Advanced Simple Profile
    Duration                         : 8s 0ms
    Width                            : 1 280 pixels
    Height                           : 720 pixels
    Display aspect ratio             : 16:9
    Frame rate                       : 30.000 fps
    Color space                      : YUV
    Bit depth                        : 8 bits
    Scan type                        : Progressive
    Writing library                  : Intel(R) MPEG-4 encoder based on Intel(R) IPP 6.1 build 137.36[6.1.137.779]
    Language                         : English
    
    Audio
    ID                               : 2
    Format                           : MPEG Audio
    Codec ID                         : A_MPEG/L3
    Codec ID/Hint                    : MP3
    Duration                         : 8s 0ms
    Channel(s)                       : 2 channels
    Sampling rate                    : 44.1 KHz
    Language                         : English
    
  • Grabbing rtsp/rtp stream with libavformat

    19 janvier 2012, par T0ha

    world. I'm trying to grab rtsp mjpeg stream from IP-camera (realtime) as described in http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html, but ported to newer version. It works well with mpeg file (loading it full as one AVPacket), but working with stream, avcodec_decode_video2 returns -1 (error). AVPacket in this case is a part of a frame.

    How can I fix this?

  • How to map an audio clip to a video ?

    19 janvier 2012, par simpatico

    I have a video clip, and an audio clip extracted from it. How can I trim the the video clip to to the portion extracted in the audio clip?

    I imagine the solution will consist of:

    1. Automatically identify the pair of start position of the audio clip in the video clip, and the end position (e.g. <03:05,09:55>);
    2. Trim the video from the identified start to the identified end (that's easy).