
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (16)
-
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 (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)
Sur d’autres sites (3389)
-
ffmpeg quality conversion options (video compression)
25 septembre 2020, par Jason HunterCan you provide a link, or an explanation, to the
-q:v 1
argument that deals with video/image quality, and compression, in ffmpeg.

Let me explain...


for f in *
 do 
 extension="${f##*.}"
 filename="${f%.*}"
 ffmpeg -i "$f" -q:v 1 "$filename"_lq."$extension"
 rm -f "$f"
 done



The ffmpeg
for
loop above compresses all images and videos in your working directory, it basically lowers the quality which results in smaller file sizes (the desired outcome).

I'm most interested in the
-q:v 1
argument of thisfor
loop. The1
in the-q:v 1
argument is what controls the amount of compression. But I can't find any documentation describing how to change this value of1
, and describing what it does. Is it a percentage ? Multiplier ? How do I adjust this knob ? Can/should I use negative values ? Integers only ? Min/max values ? etc.

I started with the official documentation but the best I could find was a section on video quality, and the
-q
flag description is sparse.



-frames[:stream_specifier] framecount (output,per-stream)

Stop writing to the stream after framecount frames.

.

-q[:stream_specifier] q (output,per-stream)



-qscale[:stream_specifier] q (output,per-stream)

Use fixed quality scale (VBR). The meaning of q/qscale is codec-dependent. If qscale is used without a stream_specifier then it applies only to the video stream, this is to maintain compatibility with previous behavior and as specifying the same codec specific value to 2 different codecs that is audio and video generally is not what is intended when no stream_specifier is used.



-
aacenc_tns : remove unused header
22 août 2015, par Rostislav Pehlivanov -
FFmpeg, access violation on av_frame_free when running though Unity
27 octobre 2016, par MockarutanI’m working on a video recording plugin for Unity using ffmpeg. I’m new to the video encoding domain and just got my code to work today. But I think a might have a few memory leaks and trying to fix them crashes Unity.
The plugin is written i c++ (as external "C" code) and imported in a c# script in unity with a simple DllImport. Again, this is not my comfort area either, but it works.
When a screen buffer is rendered, I put in a RGB24 buffer and send it to my c++ function, this one :
int encode_frame(uint8_t* rgb24Data)
{
AVFrame *frame = av_frame_alloc();
if (!frame)
return COULD_NOT_ALLOCATE_FRAME;
frame->format = codec_context->pix_fmt;
frame->width = codec_context->width;
frame->height = codec_context->height;
int ret = av_image_alloc(frame->data, frame->linesize, codec_context->width, codec_context->height, codec_context->pix_fmt, 32);
if (ret < 0)
return COULD_NOT_ALLOCATE_PIC_BUF;
SwsContext * ctx = sws_getContext(codec_context->width, codec_context->height,
AV_PIX_FMT_RGB24, codec_context->width, codec_context->height,
AV_PIX_FMT_YUV420P, 0, 0, 0, 0);
uint8_t * inData[1] = { rgb24Data };
int inLinesize[1] = { 3 * codec_context->width };
sws_scale(ctx, inData, inLinesize, 0, codec_context->height, frame->data, frame->linesize); // From RGB to YUV
frame->pts = frame_counter++;
ret = avcodec_send_frame(codec_context, frame);
if (ret < 0)
return ERROR_ENCODING_FRAME_SEND;
AVPacket pkt;
av_init_packet(&pkt);
pkt.data = NULL;
pkt.size = 0;
while (true)
{
ret = avcodec_receive_packet(codec_context, &pkt);
if (!ret)
{
if (pkt.pts != AV_NOPTS_VALUE)
pkt.pts = av_rescale_q(pkt.pts, codec_context->time_base, video_st->time_base);
if (pkt.dts != AV_NOPTS_VALUE)
pkt.dts = av_rescale_q(pkt.dts, codec_context->time_base, video_st->time_base);
av_write_frame(outctx, &pkt);
av_packet_unref(&pkt);
}
else if (ret == AVERROR(EAGAIN))
{
frame->pts = frame_counter++;
ret = avcodec_send_frame(codec_context, frame);
if (ret < 0)
return ERROR_ENCODING_FRAME_SEND;
}
else if (ret < 0)
return ERROR_ENCODING_FRAME_RECEIVE;
else
break;
}
// This one
av_frame_free(&frame);
}Now, this code might have a lot of issues that I’m not aware of, and you are free to point them out if you like. But the line that gives me error is
av_frame_free(&frame);
.If I run this in a synthetic test app in c++ that I made, it works. I can even run it in a c# synthetic test app (exactly like the c++ one), and it works. But if I run it though Unity, it crashes on the first frame. The log says "Read from location fe7f8097 caused an access violation.".
I have tried with
av_freep()
andav_free()
. Not sure exactly what makes them different (different example codes use different ones), but none work.So, what I’m I missing ? The
frame
is leaking if I don’t free it right ? But why does it crash in Unity ?The whole thing works great in Unity if I don’t have the
av_frame_free(&frame);
. Resulting video looks great !PS. I’m aware (as far as I know) that the frame also leaks if something fails and returns an error code. But one thing at a time.