Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Segmentation fault on ffmpeg sws_scale

    1er juin 2017, par Zach Zundel

    I'm trying to convert an AVFrame from a JPEG (YUV pixel format) to an RGB24 format using ffmpeg's sws_scale function. I set up the SwsContext as follows:

    struct SwsContext *sws_ctx = NULL;
        int frameFinished;
        AVPacket packet;
        // initialize SWS context for software scaling
        sws_ctx = sws_getContext(pCodecCtx->width,
            pCodecCtx->height,
            pCodecCtx->pix_fmt,
            pCodecCtx->width,
            pCodecCtx->height,
            AV_PIX_FMT_RGB24,
            SWS_BICUBIC,
            NULL, NULL, NULL
            );
    

    And then, I perform the sws_scale, with the following command

    sws_scale(sws_ctx,
              (uint8_t const * const *)pFrame->data,
              pFrame->linesize,
              0,
              pCodecCtx->height,
              pFrameRGB->data,
              pFrameRGB->linesize);
    

    which gives me a segfault, though I'm not sure why. I've tried examining the values through prints and the heights and linesizes and everything all appear to have valid values.

  • How with ffmpeg one char with different color ?

    1er juin 2017, par Fatas

    How to ffmpeg one char with different color?

    I have draw text with ffmpeg, but I can't find how I can change only one character's color. All text I can change, but I need one char with a different color.

    I have this part of code:

       ffmpeg -f lavfi \
        -i color=c=white:s=1280x720 \
        -vf "drawtext=text='aaaaaaaaBaaaaa':\
        fontcolor=black:\
        fontsize=24:\"
        -pix_fmt yuv420p -t 30 -y out.mp4 ");
    

    But I can't figure out how need change letter B to red

  • FFMPEG live buffer stream recording

    1er juin 2017, par Kencana

    I am trying to record a live stream video by feeding buffer data to ffmpeg. I would like ffmpeg to keep recording the last buffer stream, when it's idling (no buffer data being passed). So I tried to use the -stream-loop -1 options, but doesn't seems to work. Here is the snippets of the ffmpeg command

    ffmpeg -y -f rawvideo -video_size 1024x768 -re -fflags +genpts -stream_loop -1 -i - -vcodec libx264 -pix_fmt yuv420p output.mp4

    Any idea on this?

  • Android - ffmpeg ignore loop after export

    1er juin 2017, par NewUser

    Good day all. I am currently using this FFMPEG library. Here is the command I am running

    String[] s = {"-i" ,mVideoUri.toString(),"-i",newBackgroundBitmap.getPath(),"-filter_complex","[1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=0.7[ovrl];[base][ovrl]overlay[v]","-map","[v]","-c:v","libx264","-preset","ultrafast",directoryToStore+"/"+lastSaved+mp};
    
    //mVideoUri.toString() is the selected video
    //newBackgroundBitmap.getPath() is a drawn bitmap
    

    mMediaPlayer also has anchor/loop control points, to 'loop' the video.(shown in the image below)

    Everything works perfectly, the video is saved perfectly as I suspected.

    But here is where the problem comes, after I saved the video and try to use that video in ANY (even my) editing application, the starting point is messed up, it is hard to put it in words, so here is a image.video control points after export

    REMEMBER THIS ONLY HAPPENS AFTER I EXPORTED THE VIDEO


    The problem is definitely caused by ffmpeg or ffmpeg command. I have tried forcing the start and end control points;

    private Runnable updateVideoTime = new Runnable() {
        public void run() {
    
            if (!Activity.this.mMediaPlayer.isPlaying()) {
                Activity.this.mMediaPlayer.seekTo(Activity.this.leftPosition);
                Activity.this.mMediaPlayer.start();
            }
    

    No matter what I try I can't stop the 'progressBar' from ignoring the starting loop. It could perhaps be the fact that the ffmpeg used in the library is out of date?

    Has anyone who used ffmpeg(or this library) before dealt with this issue?

    Any help would be appreciated.

  • How to create a simple C++ project in Eclipse and call an ffmpeg API ? [on hold]

    1er juin 2017, par moose

    Is it possible to create a simple C++ project in Eclipse and call an ffmpeg API? If it is, how?