
Recherche avancée
Autres articles (62)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (8176)
-
Revision 37011 : Un petit test pour voir si ffmpeg2theora est dispo sur le serveur (pour ...
6 avril 2010, par kent1@… — LogUn petit test pour voir si ffmpeg2theora est dispo sur le serveur (pour l’utiliser au cas où plus tard)
-
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)
.

-
When rTorrent finishes, run FFmpeg and convert audio track in mkv to ac-3 5.1
11 septembre 2021, par miniHesselWhat is the best approach for this ? I saw the following answer, is that still a valid approach ? If so, how do you execute that when a torrent finishes ? I mostly want to convert dts-hd either 5.1 or 7.1. Sometimes also Atmos.