
Recherche avancée
Autres articles (22)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
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 (...) -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)
Sur d’autres sites (3838)
-
How to check if a .mp4 file is not corrupt and not missing movie frames or audio segments programmatically
2 novembre 2019, par forgodsakeholdWith youtube-dl I was able to download quite a couple of .mp4 files. However, I have just discovered, after manually playing some of them, that they are missing movie frames in some parts while still playing audio (so a blank screen is shown), or missing audio while still playing movie frames.
Hence,
(1) Why doesn’t youtube-dl detect or warn against such a scenario ? It looks like the movie segments and audio track were merged and .mp4 produced without any warning. Is there a way to configure youtube-dl to detect such cases and redownload the movie ?
(2) Otherwise, are there other ways to detect such cases programmatically ? (considering that one might have thousands of such .mp4 files and may not be able to manually go thru all of them ?) A solution with FFmpeg or php will be appreciated. -
Create movie programatically with ffmpeg
16 janvier 2019, par Martin DelilleI would like to create a movie programatically with ffmpeg.
Here is my code :
QString fileName = "test.mov";
static char errorString[AV_ERROR_MAX_STRING_SIZE];
printf("Video encoding\n");
AVOutputFormat *outputFormat = av_guess_format(nullptr, fileName.toStdString().c_str(), nullptr);
if (outputFormat == nullptr) {
qDebug() << "Could not find suitable format for" << fileName;
return false;
}
enum AVCodecID codec_id = AV_CODEC_ID_MJPEG;
qDebug() << "Format Name:" << outputFormat->name;
qDebug() << "Format Video Codec:" << outputFormat->video_codec;
outputFormat->video_codec = codec_id;
/// allocate the output media context, formatContext
AVFormatContext *formatContext = avformat_alloc_context();
formatContext->oformat = outputFormat;
// find the mpeg1 video encoder
AVCodec *codec = avcodec_find_encoder(codec_id);
if (!codec) {
qDebug() << "codec not found";
return false;
}
qDebug() << "Codec name:" << codec->name;
AVStream *videoStream = avformat_new_stream(formatContext, codec);
// put sample parameters
videoStream->codecpar->bit_rate = 400000;
videoStream->codecpar->width = width;
videoStream->codecpar->height = height;
videoStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
videoStream->codecpar->format = AV_PIX_FMT_YUVJ422P;
videoStream->time_base.num = 1;
videoStream->time_base.den = 25;
AVCodecContext *codecContext = avcodec_alloc_context3(nullptr);
codecContext->codec_id = codec_id;
codecContext->codec_type = AVMEDIA_TYPE_VIDEO;
codecContext->width = width;
codecContext->height = height;
codecContext->time_base.num = 1;
codecContext->time_base.den = 25;
codecContext->pix_fmt = AV_PIX_FMT_YUVJ422P;
if (int error = avcodec_parameters_to_context(codecContext, videoStream->codecpar)) {
qDebug() << "Error parameting the context:" << av_make_error_string(errorString, AV_ERROR_MAX_STRING_SIZE, error);
return false;
}
// open it
if (int error = avcodec_open2(codecContext, codec, nullptr)) {
qDebug() << "Could not open codec:" << av_make_error_string(errorString, AV_ERROR_MAX_STRING_SIZE, error);
return false;
}
// alloc image and output buffer
AVFrame *frame = av_frame_alloc();
frame->format = codecContext->pix_fmt;
frame->width = codecContext->width;
frame->height = codecContext->height;
if (int error = av_image_alloc(frame->data, frame->linesize, frame->width, frame->height, static_cast<enum avpixelformat="avpixelformat">(frame->format), 0)) {
qDebug() << "Error allocating image data:" << av_make_error_string(errorString, AV_ERROR_MAX_STRING_SIZE, error);
return false;
}
// Open the output file, if needed
if (!(outputFormat->flags & AVFMT_NOFILE)) {
if (avio_open(&formatContext->pb, fileName.toStdString().c_str(), AVIO_FLAG_WRITE) < 0) {
qDebug() << "Could not open" << fileName;
return false;
}
}
// some formats want stream headers to be separate
if (formatContext->oformat->flags & AVFMT_GLOBALHEADER) {
codecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
if (int error = avformat_write_header(formatContext, nullptr)) {
qDebug() << "error writing header:" << av_make_error_string(errorString, AV_ERROR_MAX_STRING_SIZE, error);
return false;
}
</enum>Unfortunately, when I execute it I have the following output :
Format Name: mov
Format Video Codec: 27
Codec name: mjpeg
[mov @ 0x1048c7000] Could not find tag for codec none in stream #0, codec not currently supported in container
error writing header: Invalid argumentWhat am I doing wrong ?
-
Encoding a readable movie by QuickTime using FFMPEG
29 juillet 2018, par itamarbI’m trying to encode an image sequence using the following command :
ffmpeg.exe -i %d.png -f mp4 -vcodec h264 test.mp4
However, QuickTime failed to open this file or sometimes play a black movie, while this movie plays great in VLC player. Any suggestions how to make it play well in QuickTime ?
Here is the output :
ffmpeg.exe -i %d.png -f mp4 -vcodec libx264 13.mp4
ffmpeg version N-49044-g89afa63 Copyright (c) 2000-2013 the FFmpeg developers
built on Jan 19 2013 20:36:06 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --e
nable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --e
nable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --en
able-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable
-libxavs --enable-libxvid --enable-zlib --enable-filter=frei0r
libavutil 52. 15.100 / 52. 15.100
libavcodec 54. 89.100 / 54. 89.100
libavformat 54. 61.101 / 54. 61.101
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.101 / 3. 32.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[image2 @ 0221b940] max_analyze_duration 5000000 reached at 5000000 microseconds
Input #0, image2, from '%d.png':
Duration: 00:01:19.36, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgb24, 639x480, 25 fps, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0221edc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE
4.2 AVX
[libx264 @ 0221edc0] profile High 4:4:4 Predictive, level 3.0, 4:4:4 8-bit
[libx264 @ 0221edc0] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deb
lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m
e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro
ma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 in
terlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b
_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecu
t=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '13.mp4':
Metadata:
encoder : Lavf54.61.101
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 639x480, q=-1--1
, 12800 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png -> libx264)
Press [q] to stop, [?] for help
frame= 76 fps=0.0 q=28.0 size= 3kB time=00:00:00.96 bitrate= 22.3kbits/
frame= 156 fps=155 q=28.0 size= 7kB time=00:00:04.16 bitrate= 14.7kbits/
frame= 219 fps=145 q=28.0 size= 12kB time=00:00:06.68 bitrate= 14.1kbits/
frame= 283 fps=141 q=28.0 size= 16kB time=00:00:09.24 bitrate= 14.2kbits/
frame= 352 fps=140 q=28.0 size= 25kB time=00:00:12.00 bitrate= 17.4kbits/