Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How to load/dump a raw video data into AvFrame structure pointer by using ffmpeg api function

    4 octobre 2016, par Harikrishna

    I want to write an application for encoding raw (yuv) video file data by using ffmpeg api functions instead of using a command.

    So for this, I need to use avcodec_encode_video2 function to encode raw video data and before calling this function all required configurations and video data should be fill on the AVCodecContext and AvFrame structure pointers.

    Can anyone guide me that how can I load this raw video data on AvFrame by using ffmpeg api function?

    Thank you in advance.

  • libavcodec not showing opus

    4 octobre 2016, par Abu

    I am new to libavcodec. I tried to add two streams (audio and video) to webm file. I have my audio is OPUS encoded and video is vp8. Video is working. In case of audio, I used

    AVStream *audio_st;
    audio_st->codec->codec_id = AV_CODEC_ID_OPUS;
    audio_st->codec->sample_fmt = AV_SAMPLE_FMT_FLTP; 
    audio_st->codec->bit_rate = 64000;
    audio_st->codec->sample_rate = 48000;
    audio_st->codec->channels = 2;
    audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
    

    When I run my program it shows.

    Codec 0x1503d is not in the full list.
    Stream #0:0: Audio: unknown_codec, 48000 Hz, 2 channels, fltp, 64 kb/s
    

    Unknown codec? I checked the codecs using following code

    AVCodec *codec = av_codec_next(NULL);
    while(codec != NULL)
    {
     fprintf(stderr, "%s\n", codec->long_name);
     codec = av_codec_next(codec);
    }
    

    In that list it does not show OPUS. Why its like this?. Please someone suggest a way forward.

  • Contrast normalization of several videos with ffmpeg

    4 octobre 2016, par Alan_AI

    I have some video sequences that I need to concatenate, some of them have bad contrast (so dark) and some are just fine. What is the best method to automatically normalize contrast levels among of these videos automatically without manual tweaking? Preferably using the ffmpeg script

    Thank you

  • FFMPEG Command to add text to a image

    4 octobre 2016, par Paba

    I need to create a video with a set of images and I successfully did this with ffmpeg. now i need a way to add credits to the singer and video creator. This is part of the work involved in the video creation tool im implementing. Can someone tell me how to add text to an image with ffmpeg.

    Thanks in advance.

  • FFMPEG - Merge mp4 files and audio file

    4 octobre 2016, par Jon Stevens

    I have an ffmpeg that merges 3 mp4 videos and then another command that adds audio to the output file from the first command. The commands are as follows:

    ffmpeg -i vid-1.mp4 -i vid-2.mp4 -i vid-3.mp4 -filter_complex "[0:v][1:v][2:v]concat=n=3:v=1" -preset ultrafast -crf 1 output.mp4
    
    ffmpeg -i output.mp4 -i audio.mp3 -preset ultrafast -crf 1 final.mp4
    
    • vid-1.mp4 (does NOT have audio stream)
    • vid-2.mp4 (does NOT have audio stream)

    Is there anyway to do this in one command? I would like to also add the audio to the video that is getting created in the first command. Is this possible?

    Console output of "ffmpeg -i vid-1.mp4 -i vid-2.mp4 -i vid-3.mp4 -i audio.mp3"

    [jstevens@jr testing]$ ffmpeg -i vid-1.mp4 -i vid-2.mp4 -i vid-3.mp4 -i audio.mp3
    ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 6.1.1 (GCC) 20160510 (Red Hat 6.1.1-2)
      configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
      libavutil      55. 17.103 / 55. 17.103
      libavcodec     57. 24.102 / 57. 24.102
      libavformat    57. 25.100 / 57. 25.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 31.100 /  6. 31.100
      libavresample   3.  0.  0 /  3.  0.  0
      libswscale      4.  0.100 /  4.  0.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vid-1.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf56.25.101
      Duration: 00:00:05.00, start: 0.000000, bitrate: 1085 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1081 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
        Metadata:
          handler_name    : VideoHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'vid-2.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf56.25.101
      Duration: 00:00:05.00, start: 0.000000, bitrate: 1018 kb/s
        Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1014 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
        Metadata:
          handler_name    : VideoHandler
    Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'vid-3.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf56.25.101
      Duration: 00:00:05.00, start: 0.000000, bitrate: 823 kb/s
        Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 819 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
        Metadata:
          handler_name    : VideoHandler
    [mp3 @ 0x1ca30c0] Skipping 0 bytes of junk at 0.
    [mp3 @ 0x1ca30c0] Estimating duration from bitrate, this may be inaccurate
    Input #3, mp3, from 'audio.mp3':
      Duration: 00:00:19.57, start: 0.000000, bitrate: 64 kb/s
        Stream #3:0: Audio: mp3, 44100 Hz, mono, s16p, 64 kb/s
    At least one output file must be specified