
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (97)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (7847)
-
FFmpeg : Encoder did not produce proper pts, making some up
22 novembre 2022, par ChrolumaI'm trying to convert a yuv image to jpg format via FFmpeg. But I occured
[image2 @ 0x38750] Encoder did not produce proper pts, making some up.
while the program was encoding. I looked up some references that someone saidavcodec_send_frame
can only be used when the frames is more than one. Can I use this way to achieve image conversion ? Here is my code :

int ff_yuv422P_to_jpeg(int imgWidth, int imgHeight, uint8_t* yuvData, int yuvLength)
{
 /* ===== define ===== */
 const char* OutputFileName = "img.jpg";
 int retval = 0;

 /* ===== context ===== */
 struct AVFormatContext* pFormatCtx = avformat_alloc_context();
 avformat_alloc_output_context2(&pFormatCtx, NULL, NULL, OutputFileName);
 struct AVOutputFormat* fmt = pFormatCtx->oformat;

 struct AVStream* video_st = avformat_new_stream(pFormatCtx, 0);
 if (!video_st)
 {
 retval = 1;
 perror("ff_yuv422_to_jpeg(): avformat_new_stream");
 goto out_close_ctx;
 }

 /* ===== codec ===== */
 struct AVCodecContext* pCodecCtx = avcodec_alloc_context3(NULL);
 if (avcodec_parameters_to_context(pCodecCtx, video_st->codecpar) < 0)
 {
 retval = 2;
 perror("ff_yuv422_to_jpeg(): avcodec_parameters_to_context");
 goto out_close_ctx;
 }

 pCodecCtx->codec_id = fmt->video_codec;
 pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
 pCodecCtx->pix_fmt = AV_PIX_FMT_YUVJ422P;
 pCodecCtx->width = imgWidth;
 pCodecCtx->height = imgHeight;
 pCodecCtx->time_base.num = 1;
 pCodecCtx->time_base.den = 25;

 //dump info
 av_dump_format(pFormatCtx, 0, OutputFileName, 1);

 struct AVCodec *pCodec = avcodec_find_encoder(pCodecCtx->codec_id);
 if (!pCodec)
 {
 retval = 3;
 perror("ff_yuv422_to_jpeg(): avcodec_find_encoder");
 goto out_close_st;
 }

 if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0)
 {
 retval = 4;
 perror("ff_yuv422_to_jpeg(): avcodec_open2");
 goto out_close_st;
 }

 /* ===== frame ===== */
 struct AVFrame* pictureFrame = av_frame_alloc();
 pictureFrame->width = pCodecCtx->width;
 pictureFrame->height = pCodecCtx->height;
 pictureFrame->format = AV_PIX_FMT_YUVJ422P;

 int picSize = av_image_get_buffer_size(AV_PIX_FMT_YUVJ422P, pCodecCtx->width, pCodecCtx->height, 1);
 uint8_t* pictureBuffer = (uint8_t*)av_malloc(picSize);
 av_image_fill_arrays(pictureFrame->data, pictureFrame->linesize, pictureBuffer, AV_PIX_FMT_YUVJ422P, pCodecCtx->width, pCodecCtx->height, 1);

 /* ===== write header ===== */
 int notUseRetVal = avformat_write_header(pFormatCtx, NULL);
 
 struct AVPacket* pkt = av_packet_alloc();
 av_new_packet(pkt, imgHeight * imgWidth * 3);
 pictureFrame->data[0] = pictureBuffer + 0 * (yuvLength / 4);
 pictureFrame->data[1] = pictureBuffer + 2 * (yuvLength / 4);
 pictureFrame->data[2] = pictureBuffer + 3 * (yuvLength / 4);

 /* ===== encode ===== */
 int ret = avcodec_send_frame(pCodecCtx, pictureFrame);
 while (ret >= 0)
 {
 pkt->stream_index = video_st->index;
 ret = avcodec_receive_packet(pCodecCtx, pkt);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 {
 retval = 5;
 perror("ff_yuv422_to_jpeg(): avcodec_receive_packet");
 goto out_close_picture;
 }
 else if (ret < 0)
 {
 retval = 6;
 perror("ff_yuv422_to_jpeg(): avcodec_receive_packet ret < 0");
 goto out_close_picture;
 }
 av_write_frame(pFormatCtx, pkt);
 }
 av_packet_unref(pkt);

 /* ===== write trailer ===== */
 av_write_trailer(pFormatCtx);

#if Print_Debug_Info
 printf("yuv2jpg Encode Success.\n");
#endif

out_close_picture:
 if (pictureFrame) av_free(pictureFrame);
 if (pictureBuffer) av_free(pictureBuffer);

out_close_st:
 // old school
 // if (video_st) avcodec_close(video_st->codec);

out_close_ctx:
 if (pFormatCtx) avformat_free_context(pFormatCtx);

out_return:
 return retval;
}



and my log :


Output #0, image2, to 'img.jpg':
 Stream #0:0: Unknown: none
[image2 @ 0x38750] Encoder did not produce proper pts, making some up.
ff_yuv422_to_jpeg(): avcodec_receive_packet: Success



I looked up the avcodec_receive_packet()'s reference, and my code return error code
AVERROR(EAGAIN)
.

-
x86inc : Avoid creating unnecessary local labels
16 octobre 2015, par Henrik Gramnerx86inc : Avoid creating unnecessary local labels
The REP_RET workaround is only needed on old AMD cpus, and the labels clutter
up the symbol table and confuse debugging/profiling tools, so use EQU to
create SHN_ABS symbols instead of creating local labels. Furthermore, skip
the workaround completely in functions that definitely won’t run on such cpus.Note that EQU is just creating a local label when using nasm instead of yasm.
This is probably a bug, but at least it doesn’t break anything. -
Using ffmpeg to interpolate images without making video
28 août 2020, par interwebjillThe following ffmpeg command works well to interpolate my set of images :


ffmpeg -r <fps> -i <input /> -filter:v minterpolate=fps=:scd=none:mi_mode=blend -pix_fmt yuvj420p <output>
</output></fps>


however, instead of outputting a video, I would like to instead output a directory of image files which include the original images plus the interpolated images. Is this possible with ffmpeg and if so, what are the commands ?


I could not find a solution in the ffmpeg documentation or on the wiki.