
Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (71)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
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. -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (9043)
-
Clips from a Live Video
12 mai 2022, par Jorge Borreguero SanmartinI am doing a program in Python that gets clips from a live video. To do so, with opencv I get the currrrent_frame_position and with the fps I get the start and final time to run this command :


ffmpeg -i live_video.ts -ss 00:01:30 -to 00:02:00 -c:v copy output.ts


To improve, I want to start dumping the live_video on the new file once I know the starting time, and finish once I get the final time. My intention is to make this process faster and get the result file sooner. It is not necessary to use ffmpeg but it is the tool that I have been using. How can I do this ?


-
ffmpeg merge video and audio + fade out
1er mai 2016, par jacky brownI have one video file and one audio file.
I want to merge them together that the final output video will be in the length of the video and will contain the audio in the background.i did :
ffmpeg -i output.avi -i bgmusic.mp3 -filter_complex " [1:0] apad " -shortest out.avi
but the background audio is cut in the end of the final merge movie.
i want it to fade out nicely.how can i do it ??
but the background audio is cut in the end of the final merge movie.
i want it to fade out nicely.how can i do it ??
thanks.
-
How to compensate frame rate underrun while muxing video to mp4 container with libav
17 septembre 2021, par Nuno SantosI have a process that generates video frames in real time. I’m muxing the generated video frames stream in a video file (x264 codec on a mp4 container).


I'm using ffmpeg-libav and I'm basing myself on the muxing.c example. The problem with the example is that isn't a real world scenario as frames are being generated on a while loop for a given stream duration, never missing a frame.


On my program, frames are supposed to be generated at FPS, however, depending on the hardware capacity it might produce less than FPS. When I initialize the video stream context I declare that frame rate is FPS :


AVRational r = { 1, FPS };
ost->st->time_base = r;



This specifies that the video is going to have FPS frame rate but if less frames are produced, the playback will be faster because it will still reproduce the video as it if had all the declared frames per second.


After googling a lot about this topic I understand that the key to fix this is to manipulate pts and dts but I still haven't found a solution that works.


There are two key functions when writing video frames in the muxing.c example, routines that I'm using in my program :


AVFrame* get_video_frame(int timestamp, OutputStream *ost, const QImage &image)
{
 /* when we pass a frame to the encoder, it may keep a reference to it
 * internally; make sure we do not overwrite it here */
 if (av_frame_make_writable(ost->frame) < 0)
 exit(1);

 av_image_fill_arrays(ost->tmp_frame->data, ost->tmp_frame->linesize, image.bits(), AV_PIX_FMT_RGBA, ost->frame->width, ost->frame->height, 8);
 libyuv::ABGRToI420(ost->tmp_frame->data[0], ost->tmp_frame->linesize[0], ost->frame->data[0], ost->frame->linesize[0], ost->frame->data[1], ost->frame->linesize[1], ost->frame->data[2], ost->frame->linesize[2], ost->tmp_frame->width, -ost->tmp_frame->height);

 #if 1 // this is my attempt to rescale pts, but crashes with ptsframe->pts = av_rescale_q(timestamp, AVRational{1, 1000}, ost->st->time_base);
 #else
 ost->frame->pts = ost->next_pts++;
 #endif

 return ost->frame;
}



On the original code, the pts is simply an incremeting integer for each frame. What I'm trying to do is to pass a timestamp in ms since the beggining of the recording so that I can rescale the pts. When I rescale pts the program crashes complaining that pts is lower then dts.


From what I've been reading, the pts/dts manipulation is supposed to be done at the packet level so I have also tried to manipulate things on write_frame routine without success.


int write_frame(AVFormatContext *fmt_ctx, AVCodecContext *c, AVStream *st, AVFrame *frame)
{
 int ret;

 // send the frame to the encoder
 ret = avcodec_send_frame(c, frame);

 if (ret<0)
 {
 fprintf(stderr, "Error sending a frame to the encoder\n");
 exit(1);
 }

 while (ret >= 0)
 {
 AVPacket pkt = { 0 };

 ret = avcodec_receive_packet(c, &pkt);

 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 {
 break;
 }
 else if (ret<0)
 {
 //fprintf(stderr, "Error encoding a frame: %s\n", av_err2str(ret));
 exit(1);
 }

 /* rescale output packet timestamp values from codec to stream timebase */
 av_packet_rescale_ts(&pkt, c->time_base, st->time_base);
 pkt.stream_index = st->index;

 /* Write the compressed frame to the media file. */
 //log_packet(fmt_ctx, &pkt);
 ret = av_interleaved_write_frame(fmt_ctx, &pkt);
 av_packet_unref(&pkt);

 if (ret < 0)
 {
 //fprintf(stderr, "Error while writing output packet: %s\n", av_err2str(ret));
 exit(1);
 }
 }

 return ret == AVERROR_EOF ? 1 : 0;
}



How should I manipulate dts and pts so that I can achieve a video at certain frame that does not have all the frames as specified in the stream initialization ? Where should I do that manipulation ? On get_video_frame ? On write_frame ? On both ?


Am I heading in the right direction ? What am I missing ?