Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Threads creating process in infinite loop

    10 décembre 2013, par bhupinder

    In my application a thread runs while(1){} in it so thread terminates when my app is terminated by user.

    Is it safe to do like this? I am using while(1){} because my app continuously monitors devices on system.

    After some time I am getting "(R6016) not enough space for thread data" on ffmpeg.

    I read this but did not get solution of my problem:

    http://support.microsoft.com/kb/126709

    Thread description: Thread uses ffmpeg and handle utility (http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx). within while(1){} loop.

    ffmpeg and handle is running through QProcess which I am deleting after process ends.

    while(1){} loop waits for 5 seconds using msleep(5000).

  • ffmpeg watermark from java Runtime.exec cannot find output

    10 décembre 2013, par Rohi

    I'm having a problem in sending a ffmpeg command to add a watermark to my video from Java using Runtime.exec(). The strange thing is that the same command is working perfectly from terminal.... Any idea what the issue could be? this is the command

    ffmpeg -i /home/mydir/inputvideo.mp4 -vf "movie=/home/mydir/watermarklogo.png [wm]; [in][wm] overlay=10:10 [out]" /home/mydir/outputvideo.mp4
    

    and this is the Java code (same as above, just wrapped in the exec code, and escaped characters

    Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec("ffmpeg -i /home/mydir/inputvideo.mp4 -vf \"movie=/home/mydir/watermarklogo.png [wm]; [in][wm] overlay=10:10 [out]\" /home/mydir/outputvideo.mp4");
            InputStream stderr = proc.getErrorStream();
            InputStreamReader isr = new InputStreamReader(stderr);
            BufferedReader br = new BufferedReader(isr);
            String line = null;
            while ( (line = br.readLine()) != null)
                System.out.println(line);
            int exitVal = proc.waitFor();
            System.out.println("Process exitValue: " + exitVal);
    

    exit code is always 1 when running this.... this is the full output

        ffmpeg version 0.10.9-7:0.10.9-1~saucy1 Copyright (c) 2000-2013 the FFmpeg developers
      built on Oct 18 2013 17:40:10 with gcc 4.8.1
      configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='7:0.10.9-1~saucy1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
      libavutil      51. 35.100 / 51. 35.100
      libavcodec     53. 61.100 / 53. 61.100
      libavformat    53. 32.100 / 53. 32.100
      libavdevice    53.  4.100 / 53.  4.100
      libavfilter     2. 61.100 /  2. 61.100
      libswscale      2.  1.100 /  2.  1.100
      libswresample   0.  6.100 /  0.  6.100
      libpostproc    52.  0.100 / 52.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/rohif/oshi.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf54.59.106
      Duration: 00:00:48.13, start: 0.000000, bitrate: 2482 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2362 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
        Metadata:
          handler_name    : VideoHandler
        Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 117 kb/s
        Metadata:
          handler_name    : 
    [NULL @ 0x18fb9a0] Unable to find a suitable output format for '[wm];'
    [wm];: Invalid argument
    Process exitValue: 1
    
  • Audio convertion using ffmpeg on exec() php function

    10 décembre 2013, par Mathi

    any body explain why exec(),shell_exec(), system() can not return any return value while executing ffmpeg commands.

    ie: exec("Who am i", $output = array()); //here execution is success and $output is set an array value $output= shell_exec("Who am i"); //here execution is success and $output is set an array value system("Who am i", $output = array()); //here execution is success and $output is set an array value

    but

    exec('ffmpeg -i "$sourcepath/Test.mp3" -vn -acodec libvorbis -ab 128k -y $desnpath/TestTest.ogg"', $output = array());
    //here execution is success but $output is not set an array value 
    $output= shell_exec('ffmpeg -i "$sourcepath/Test.mp3" -vn -acodec libvorbis -ab 128k -y $desnpath/TestTest.ogg"');
    //here execution is success but $output is not set an array value
    system('ffmpeg -i "$sourcepath/Test.mp3" -vn -acodec libvorbis -ab 128k -y $desnpath/TestTest.ogg"', $output = array());
    //here execution is success but $output is not set an array value
    

    i don't know why..!?

    please any body help me.

  • How to crop last N seconds from a video

    10 décembre 2013, par digitalfootmark

    Is there any way to crop the last N seconds from a video?

    I know there is an option for start time and duration, but neither of these are usable in this use case. Video can have any possible length, so the duration cannot be fixed value.

    Maybe I can determine the length first with ffmpeg, and calculate the duration in my own code?

  • ffmpeg and UScreenCapture

    10 décembre 2013, par Burgaz

    I'm using ffmpeg and "UScreenCapture" as virtual device in order to capture my desktop. When trying to work in Duplicate Mode, PC Only or Second Screen Only all works well. I'm able to capture my desktop.

    When working with "Extended" mode, ffmpeg crashes with the following error:

    [dshow @ 02379ec0] Could not run filter
    video=UScreenCapture: Input/output error
    

    I tried changing the MonitorNum in the registry with no luck. No matter which value I'm setting there: 0,1,2.

    How can I capture one of the monitors in Extended mode? what is the bets way to do that? Should I use regions and not MonitorNum?