Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (40)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Initialisation de MediaSPIP (préconfiguration)

    20 février 2010, par

    Lors de l’installation de MediaSPIP, celui-ci est préconfiguré pour les usages les plus fréquents.
    Cette préconfiguration est réalisée par un plugin activé par défaut et non désactivable appelé MediaSPIP Init.
    Ce plugin sert à préconfigurer de manière correcte chaque instance de MediaSPIP. Il doit donc être placé dans le dossier plugins-dist/ du site ou de la ferme pour être installé par défaut avant de pouvoir utiliser le site.
    Dans un premier temps il active ou désactive des options de SPIP qui ne le (...)

Sur d’autres sites (9254)

  • Problem opening xvid264 with avcodec_alloc_context(NULL)

    12 juillet 2024, par user3763774

    I want to multiplex audio and video together using the ffmpeg encoding library with xvid264rgb codec. I can open the codec when I create the context specifying that codec, but not if I use NULL for the argument with allocate context. My understanding is I need to use NULL so I can open the audio codec as well.

    


    In the example, the first open works with codec indicated in the allocate context. The second doesn't.

    


    #include &#xA;#include &#xA;#include &#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;#define WIDTH 400&#xA;#define HEIGHT 300&#xA;&#xA;const AVCodec *videocodec;&#xA;&#xA;bool init_video_encoder(AVCodecContext *c, int width, int height) {&#xA;    int ret;&#xA;    &#xA;    const AVRational tb_rat = {1, 30};&#xA;    const AVRational fr_rat = {30, 1};&#xA;&#xA;    fprintf(stderr, "init video encoder\n");&#xA;    // video&#xA;    //fprintf(stderr, "speed= %d \n", videocodec->speed);&#xA;    c->bit_rate = 400000;&#xA;    c->width = width;&#xA;    c->height = height;&#xA;    c->time_base = tb_rat;&#xA;    c->framerate = fr_rat;&#xA;    c->gop_size = 10;&#xA;    c->max_b_frames = 1;&#xA;    c->pix_fmt = AV_PIX_FMT_RGB24;&#xA;    if( videocodec->id == AV_CODEC_ID_H264 ) &#xA;        av_opt_set(c->priv_data, "preset", "slow", 0);&#xA;        &#xA;    ret = avcodec_open2(c, videocodec, NULL);&#xA;    if( ret &lt; 0 ) {&#xA;        fprintf(stderr, "failure to open codec: %s\n", av_err2str(ret));&#xA;        return false;&#xA;    }&#xA;    //avcodec_free_context(&amp;c);&#xA;    return true;&#xA;}&#xA;&#xA;int main(int argc, char **argv) {&#xA;&#xA;    AVCodecContext *context = NULL;&#xA;&#xA;    videocodec = avcodec_find_encoder_by_name("libx264rgb");&#xA;    if( videocodec == NULL ) {&#xA;        fprintf(stderr, "video encoder &#x27;libx264rgb&#x27; not found");&#xA;        exit;&#xA;    }&#xA;&#xA;    context = avcodec_alloc_context3(videocodec);&#xA;    if( context == NULL ) {&#xA;        fprintf(stderr, "could not allocate context with codec");&#xA;        return false;&#xA;    }&#xA;    if( init_video_encoder( context, WIDTH, HEIGHT ) ) &#xA;        fprintf(stderr, " success initializing video encoder case one\n");&#xA;    else&#xA;        fprintf(stderr, " failure to initialize video encoder case one\n");&#xA;    avcodec_close( context );&#xA;&#xA;    context = avcodec_alloc_context3(NULL);&#xA;    if( context == NULL ) {&#xA;        fprintf(stderr, "could not allocate context without codec");&#xA;        return false;&#xA;    }&#xA;    if( init_video_encoder( context, WIDTH, HEIGHT ) ) &#xA;        fprintf(stderr, " success initializing video encoder case two\n");&#xA;    else&#xA;        fprintf(stderr, " failure to initialize video encoder case two\n");&#xA;    avcodec_close( context );&#xA;}&#xA;

    &#xA;

    Here is the error message :

    &#xA;

    broken ffmpeg default settings detected&#xA;use an encoding preset (e.g. -vpre medium)&#xA;preset usage: -vpre <speed> -vpre <profile>&#xA;speed presets are listed in x264 --help&#xA;profile is optional; x264 defaults to high&#xA;failure to open codec: Generic error in an external library&#xA;failure to initialize video encoder case two&#xA;</profile></speed>

    &#xA;

    Is this the right approach to use ? How do I set the encoding preset ? The code appears already to do that.

    &#xA;

  • Error opening video file with openCV cv2VideoCapture

    19 mai 2017, par kollo

    I have a video file here /data/out.mp4 and its copy /data/out.
    I’m on Osx Sierra with Xcode 8.

    Open video with mp4 extension is ok but get error with no extension or any other format.

    I tryed opencv 2.4 and latest 3.2 from git.
    Compiled with ffmpeg release/2.0 and also tryed release/3.0

    With opencv version 3.2 :

    Python 2.7.10 (default, Jul 30 2016, 19:40:32)
    [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cv2
    >>> cv2.__version__
    '3.2.0-dev'
    >>> cv2.__file__
    '/Users/johndoe/work/myproject/venv/local/lib/python2.7/site-packages/cv2.so'

    If video have extension :

    >>> v=cv2.VideoCapture('/data/out.mp4')
    >>> v.get(cv2.CAP_PROP_FRAME_COUNT)
    61117.0

    If video have no extension :

    >>> v=cv2.VideoCapture('/data/out')
    VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!

    >>> v.get(cv2.CAP_PROP_FRAME_COUNT)
    0.0

    My FFmpeg configure :

    ./configure --prefix=/usr \
    --bindir=/usr/local/bin/ \
    --shlibdir=/usr/lib64 \
    --datadir=/usr/share/ffmpeg \
    --incdir=/usr/include/ffmpeg \
    --libdir=/usr/lib64 \
    --mandir=/usr/share/man \
    --extra-cflags='-O2 -g' \
    --extra-version=rpmfusion \
    --enable-bzlib  \
    --enable-nonfree \
    --enable-libopenjpeg \
    --enable-libx264  \
    --enable-avfilter \
    --enable-postproc \
    --enable-pthreads \
    --disable-static \
    --enable-shared \
    --enable-gpl \
    --enable-runtime-cpudetect \
    --arch=x86_64

    My opencv CMAKE :

    cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/Users/johndoe/work/myproject/venv/local/ \
    -D INSTALL_C_EXAMPLES=OFF \
    -D PYTHON_PACKAGES_PATH=/Users/johndoe/work/myproject/venv/lib/python2.7/site-packages \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D PYTHON_EXECUTABLE=/Users/johndoe/work/myproject/venv/bin/python \
    -D WITH_CUDA=OFF ..

    I tryed various other formats reencoding my original video (ie : ffmpeg -i out.mp4 out.asf) :

    >>> v=cv2.VideoCapture('/data/out.avi')
    VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!

    >>> v=cv2.VideoCapture('/data/out.flv')
    VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!

    >>> v=cv2.VideoCapture('/data/out.asf')
    VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!
  • Error opening video file with openCV cv2VideoCapture

    7 juillet 2020, par kollo

    I have a video file here /data/out.mp4 and its copy /data/out. &#xA;I'm on Osx Sierra with Xcode 8.

    &#xA;&#xA;

    Open video with mp4 extension is ok but get error with no extension or any other format.

    &#xA;&#xA;

    I tryed opencv 2.4 and latest 3.2 from git.&#xA;Compiled with ffmpeg release/2.0 and also tryed release/3.0

    &#xA;&#xA;

    With opencv version 3.2 :

    &#xA;&#xA;

    Python 2.7.10 (default, Jul 30 2016, 19:40:32)&#xA;[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin&#xA;Type "help", "copyright", "credits" or "license" for more information.&#xA;>>> import cv2&#xA;>>> cv2.__version__&#xA;&#x27;3.2.0-dev&#x27;&#xA;>>> cv2.__file__&#xA;&#x27;/Users/johndoe/work/myproject/venv/local/lib/python2.7/site-packages/cv2.so&#x27;&#xA;

    &#xA;&#xA;

    If video have extension :

    &#xA;&#xA;

    >>> v=cv2.VideoCapture(&#x27;/data/out.mp4&#x27;)&#xA;>>> v.get(cv2.CAP_PROP_FRAME_COUNT)&#xA;61117.0&#xA;

    &#xA;&#xA;

    If video have no extension :

    &#xA;&#xA;

    >>> v=cv2.VideoCapture(&#x27;/data/out&#x27;)&#xA;VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C&#x2B;&#x2B; exception!&#xA;&#xA;>>> v.get(cv2.CAP_PROP_FRAME_COUNT)&#xA;0.0&#xA;

    &#xA;&#xA;

    My FFmpeg configure :

    &#xA;&#xA;

    ./configure --prefix=/usr \&#xA;--bindir=/usr/local/bin/ \&#xA;--shlibdir=/usr/lib64 \&#xA;--datadir=/usr/share/ffmpeg \&#xA;--incdir=/usr/include/ffmpeg \&#xA;--libdir=/usr/lib64 \&#xA;--mandir=/usr/share/man \&#xA;--extra-cflags=&#x27;-O2 -g&#x27; \&#xA;--extra-version=rpmfusion \&#xA;--enable-bzlib  \&#xA;--enable-nonfree \&#xA;--enable-libopenjpeg \&#xA;--enable-libx264  \&#xA;--enable-avfilter \&#xA;--enable-postproc \&#xA;--enable-pthreads \&#xA;--disable-static \&#xA;--enable-shared \&#xA;--enable-gpl \&#xA;--enable-runtime-cpudetect \&#xA;--arch=x86_64&#xA;

    &#xA;&#xA;

    My opencv CMAKE :

    &#xA;&#xA;

    cmake -D CMAKE_BUILD_TYPE=RELEASE \&#xA;-D CMAKE_INSTALL_PREFIX=/Users/johndoe/work/myproject/venv/local/ \&#xA;-D INSTALL_C_EXAMPLES=OFF \&#xA;-D PYTHON_PACKAGES_PATH=/Users/johndoe/work/myproject/venv/lib/python2.7/site-packages \&#xA;-D INSTALL_PYTHON_EXAMPLES=ON \&#xA;-D PYTHON_EXECUTABLE=/Users/johndoe/work/myproject/venv/bin/python \&#xA;-D WITH_CUDA=OFF ..&#xA;

    &#xA;&#xA;

    I tryed various other formats reencoding my original video (ie : ffmpeg -i out.mp4 out.asf) :

    &#xA;&#xA;

    >>> v=cv2.VideoCapture(&#x27;/data/out.avi&#x27;)&#xA;VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C&#x2B;&#x2B; exception!&#xA;&#xA;>>> v=cv2.VideoCapture(&#x27;/data/out.flv&#x27;)&#xA;VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C&#x2B;&#x2B; exception!&#xA;&#xA;>>> v=cv2.VideoCapture(&#x27;/data/out.asf&#x27;)&#xA;VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C&#x2B;&#x2B; exception!&#xA;

    &#xA;