
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (40)
-
Submit bugs and patches
13 avril 2011Unfortunately 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, parLes 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, parLors 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 user3763774I 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 
#include 
#include 
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>opt.h>
#define WIDTH 400
#define HEIGHT 300

const AVCodec *videocodec;

bool init_video_encoder(AVCodecContext *c, int width, int height) {
 int ret;
 
 const AVRational tb_rat = {1, 30};
 const AVRational fr_rat = {30, 1};

 fprintf(stderr, "init video encoder\n");
 // video
 //fprintf(stderr, "speed= %d \n", videocodec->speed);
 c->bit_rate = 400000;
 c->width = width;
 c->height = height;
 c->time_base = tb_rat;
 c->framerate = fr_rat;
 c->gop_size = 10;
 c->max_b_frames = 1;
 c->pix_fmt = AV_PIX_FMT_RGB24;
 if( videocodec->id == AV_CODEC_ID_H264 ) 
 av_opt_set(c->priv_data, "preset", "slow", 0);
 
 ret = avcodec_open2(c, videocodec, NULL);
 if( ret < 0 ) {
 fprintf(stderr, "failure to open codec: %s\n", av_err2str(ret));
 return false;
 }
 //avcodec_free_context(&c);
 return true;
}

int main(int argc, char **argv) {

 AVCodecContext *context = NULL;

 videocodec = avcodec_find_encoder_by_name("libx264rgb");
 if( videocodec == NULL ) {
 fprintf(stderr, "video encoder 'libx264rgb' not found");
 exit;
 }

 context = avcodec_alloc_context3(videocodec);
 if( context == NULL ) {
 fprintf(stderr, "could not allocate context with codec");
 return false;
 }
 if( init_video_encoder( context, WIDTH, HEIGHT ) ) 
 fprintf(stderr, " success initializing video encoder case one\n");
 else
 fprintf(stderr, " failure to initialize video encoder case one\n");
 avcodec_close( context );

 context = avcodec_alloc_context3(NULL);
 if( context == NULL ) {
 fprintf(stderr, "could not allocate context without codec");
 return false;
 }
 if( init_video_encoder( context, WIDTH, HEIGHT ) ) 
 fprintf(stderr, " success initializing video encoder case two\n");
 else
 fprintf(stderr, " failure to initialize video encoder case two\n");
 avcodec_close( context );
}



Here is the error message :


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


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


-
Error opening video file with openCV cv2VideoCapture
19 mai 2017, par kolloI 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.0With 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.0If 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.0My 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_64My 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 kolloI 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!