Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFmpeg programming : assign color transfer characteristics

    8 juillet 2017, par Francis Tesla

    When using ffmpeg library to load an EXR file it appears to dark.

    This seems to be the same problem as this one:

    ffmpeg - getting a dark output when converting .exr sequence to .mp4

    The EXR decoder has a parameter to assign color transfer characteristics.

    For sRGB, it is

    ffmpeg -apply_trc iec61966_2_1 -start_frame 1100 -i input.$04d.exr output.mp4

    But how to achieve the same result programmatically?

    Here is my code:

    AVFrame *frame = av_frame_alloc();
    avcodec_decode_video2(codecCtx, frame, &frameFinished, &packet);
    
    ... 
    
    AVPicture       picture;
    avpicture_alloc(&picture, dest_format, dest_width, dest_height);
    
    SwsContext *swsCtx = NULL;
    
    swsCtx = sws_getContext(source_width, source_height, source_format, dest_width, dest_height, dest_format, SWS_POINT, NULL, NULL, NULL);
    
    if (swsCtx == NULL) {
        qDebug() << "error calling sws_getContext";
    }
    
    sws_scale(swsCtx, frame->data, frame->linesize, 0, frame->height, picture.data, picture.linesize);
    
    QImage image(dest_width, dest_height, QImage::Format_ARGB32);
    
    for (int y = 0; y < dest_height; ++y) {
        memcpy(image.scanLine(y), picture.data[0] + y * picture.linesize[0], picture.linesize[0]);
    }
    
    av_frame_free(&frame);
    sws_freeContext(swsCtx);
    

    Thank you, Francis

  • HD video play in ffmpeg android player

    8 juillet 2017, par Melvin Wong

    I have developed android mediaplayer by using ffmpeg. It is working well with local and remote files both.

    But it has some issues when i try to play HD video files. The screen shows many rectangles and stopped after a few seconds.

    I think it is video rendering problem on low performance devices. In this case, I need to skip some frames and play.

    Please help me whether my thought is right or if you have already experienced this , please teach me.

  • Remove Black Frames from an overlayed Circled Video

    7 juillet 2017, par amanguel

    I have a video that I need to overlay on top of another video. The first video have parts with black frames that I don't want to be overlayed and I also need to mask this video with a circle.

    In other words, I will be overlaying a few circled videos on top of a bigger rectangular video and I also don't want to show black frames from the circled videos.

    Could you please help me.

    Thanks!!!!!

  • ffmpeg records 5 frames per second on a device that cheese records at 20 fps

    7 juillet 2017, par David Parks

    Running the following ffmpeg capture on my built in webcam:

    ffmpeg -f v4l2 -framerate 30 -video_size 1920x1080 -i /dev/video0 output.mkv
    

    I get only 5 fps and see this message:

    The driver changed the time per frame from 1/30 to 1/5
    

    When I record using cheese I get what looks like 20 fps on that device. And v4l2 seems to claim it can do 30 fps.

    v4l2-ctl --list-formats-ext
    ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'MJPG' (compressed)
        Name        : Motion-JPEG
            Size: Discrete 1920x1080
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 1280x720
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 800x600
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x480
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x360
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x480
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 160x120
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 320x240
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x480
                Interval: Discrete 0.033s (30.000 fps)
    
        Index       : 1
        Type        : Video Capture
        Pixel Format: 'YUYV'
        Name        : YUYV 4:2:2
            Size: Discrete 1920x1080
                Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x720
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 800x600
                Interval: Discrete 0.050s (20.000 fps)
            Size: Discrete 640x480
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x360
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x480
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 160x120
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 320x240
                Interval: Discrete 0.033s (30.000 fps)
            Size: Discrete 640x480
                Interval: Discrete 0.033s (30.000 fps)
    

    When I run ffmpeg:

    Output #0, mjpeg, to 'output.mjpg':
      Metadata:
        encoder         : Lavf56.40.101
        Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080, q=2-31, 200 kb/s, 5 fps, 5 tbn, 5 tbc
        Metadata:
          encoder         : Lavc56.60.100 mjpeg
    

    My guess is that it's recording in raw form from the device and doing the encoding in ffmpeg. If this is correct, how would I get ffmpeg to use the mjpeg native format?

  • How install ffmpeg on wamp 3.0.4 x64 apache 2.4.18 mysql 5.7.11 php 5.6.19

    7 juillet 2017, par Zakaria Bouhali

    Hello I found a lot of explanations But did not benefit from them I want to install ClipBucket Any Help