Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (65)

Sur d’autres sites (13936)

  • Revision 965af79241 : vp8cx_set_ref : Flush encoder. According to the current API spec we need to call

    14 août 2014, par Dmitry Kovalev

    Changed Paths :
     Modify /examples/vp8cx_set_ref.c



    vp8cx_set_ref : Flush encoder.

    According to the current API spec we need to call vpx_codec_encode() until
    vpx_codec_get_cx_data() returns NULL.

    Change-Id : Ide0c531dc0d453df8ec1edb8acb894856d6cc22e

  • Kill an unresolved promise (or ignore and move on)

    17 septembre 2017, par Trees4theForest

    Using node child process exec, I’m calling a ffmpeg conversion via a promise that takes a bit of time. Each time the use clicks "next" it starts the FFMpeg command on a new file :

    function doFFMpeg(path){
     return new Promise((resolve, reject) => {
       exec('ffmpeg (long running command)', (error, stdout, stderr) => {
         if (error) {
           reject();
         }
       }).on('exit', (code) => { // Exit returns code 0 for good 1 bad
         if (code) {
           reject();
         } else {
           resolve();
         }
       });
     });
    }

    The problem is, if the user moves on to the next video before the promise is returned, I need to scrap the process and move on to converting the next video.

    How do I either :

    A) (Ideally) Cancel the current promised exec process*
    B) Let the current promised exec process complete, but just ignore that promise while I start a new one.

    *I realize that promise.cancel is not yet in ECMA, but I’d like to know of a workaround — preferably without using a 3rd party module / library.

    Attempt :

    let myChildProcess;

    function doFFMpeg(path){

     myChildProcess.kill();

     return new Promise((resolve, reject) => {
       myChildProcess = exec('ffmpeg (long running command)', (error, stdout, stderr) => {
         if (error) {
           reject();
         }
       }).on('exit', (code) => { // Exit returns code 0 for good 1 bad
         if (code) {
           reject();
         } else {
           resolve();
         }
       });
     });
    }
  • How to Play a Video file in javacv / javacpp

    28 mars 2017, par Floesmaan

    Does someone have some example code to play a simple video file with the current javaCPP/javaCV version and the FFmpegFrameGrabber ?

    I tried this solution, but its apparently too old and does not work with the current javacv version because of an incompatible FrameGrabber interface (returns a "Frame"-Object instead of an "IplImage"-Object). If I change the code manually (using Frame instead of IplImage), it returns the error message :

    java.lang.VerifyError: Bad type on operand stack
    Exception Details:
     Location:
       org/bytedeco/javacv/FFmpegFrameGrabber.startUnsafe()V @1291: invokespecial
     Reason:
       Type 'org/bytedeco/javacpp/avutil$AVFrame' (current frame, stack[2]) is not assignable to 'org/bytedeco/javacpp/Pointer'
     Current Frame:
       bci: @1291
       flags: { }
       locals: { 'org/bytedeco/javacv/FFmpegFrameGrabber', integer, 'org/bytedeco/javacpp/avformat$AVInputFormat', 'org/bytedeco/javacpp/avutil$AVDictionary', integer, 'org/bytedeco/javacpp/avcodec$AVCodec', integer, integer, integer, integer }
       stack: { uninitialized 1283, uninitialized 1283, 'org/bytedeco/javacpp/avutil$AVFrame' }
     Bytecode:
       0x0000000: 2a01 b500 332a bb00 8659 01b7 0087 b500............

    FYI : I’m comparing different java libraries for playing video files and extract their pixel data (xuggler, vlcj, ...) and search for the best one. I really like to include javacv in my tests but it’s not working :(