
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 (47)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (4217)
-
Adding frame numbers to a video, along with total frame duration
21 novembre 2022, par Abraham ThomasI need to add frame numbers to videos along with total frame duration of the video. It should show the first frame and the last frame, along with the current frame.


In this forum someone had posted a command, which gives the current frame number ;
I've used this and this below command works for me :


ffmpeg -i inputvid.mp4 -vf "drawtext=fontfile=Arial.ttf : text='%frame_num' : start_number=1001 : x=(w-tw)/2 : y=h-(2*lh) : fontcolor=white : fontsize=55 : box=1 : boxcolor=black : boxborderw=5" -c:a copy D :\Test\outputvid.mp4


But it doesn't show the total frame duration ;
Is there a way to add to this command ; to show the first frame and last frame of the video as well (I'm on windows) ;


-
How do I use ffmpeg to extract the total time of a video slice without actually producing the video slice ?
18 juin 2022, par iChux

I have a video named 'ev.mp4'. Slice the video into segments :




# COMMAND 1
ffmpeg -i "ev.mp4" -c copy -map 0 -segment_time 15 -g 9 \
 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*9)" \
 -reset_timestamps 1 -f segment ev-%04d.mp4

ev-0000.mp4
ev-0001.mp4
ev-0002.mp4





Get each segment time




# COMMAND 2
for f in ev-*.mp4;
do
 echo $f == $(ffprobe -v error -show_entries \
 format=duration -of default=noprint_wrappers=1:nokey=1 $f);
done;

ev-0000.mp4 == 17.251000
ev-0001.mp4 == 17.918000
ev-0002.mp4 == 10.444000





I am only able to extract the duration of each sliced segment after the videos have existed in a sliced format on the hard drive e.g. ev-0000.mp4




My question : is it possible to get the duration of each slice from COMMAND 1 such that instead of producing the sliced files, I will get the duration of each slice ?


-
Slightly different number of total frames between my program (using libav) and ffprobe
16 juin 2022, par AlveinFor learning purposes, I made a routine that decodes each frame for each stream inside a given container.


I noticed that for some videos, the amount of frames returned by my code differs the one calculated by the tool ffprobe (which comes with ffmpeg).


I'm using ffprobe like this :


ffprobe <media file="file"> -v error -select_streams v:0 -count_frames -show_entries stream=nb_read_frames
</media>


Replacing "v:0" with "a:0" for audio, etc.


And this is my source code :


void showFrames(char *szFilename) {
 int iError;
 char szError[AV_ERROR_MAX_STRING_SIZE];
 AVFormatContext *fcFormatCtx;
 AVCodec *cdCodec;
 AVCodecParameters *cdpCodecParams;
 AVCodecContext *ccCodecCtx;
 AVPacket *pkPacket;
 AVFrame *frFrame;
 fcFormatCtx=avformat_alloc_context();
 iError=avformat_open_input(&fcFormatCtx,szFilename,NULL,NULL);
 if(0>iError) {
 av_strerror(iError,szError,sizeof(szError));
 fprintf(stderr,"avformat_open_input() failed: %s\n",szError);
 return;
 }
 iError=avformat_find_stream_info(fcFormatCtx,NULL);
 if(0>iError) {
 av_strerror(iError,szError,sizeof(szError));
 fprintf(stderr,"avformat_find_stream_info() failed: %s\n",szError);
 avformat_close_input(&fcFormatCtx);
 return;
 }
 for(uint uiSt=0;uiStnb_streams;uiSt++) {
 cdpCodecParams=fcFormatCtx->streams[uiSt]->codecpar;
 cdCodec=avcodec_find_decoder(cdpCodecParams->codec_id);
 if(NULL==cdCodec) {
 fprintf(stderr,"no codec found for stream %u\n",uiSt);
 continue;
 }
 fprintf(stderr,"stream %u\n",uiSt);
 if(AVMEDIA_TYPE_VIDEO==cdpCodecParams->codec_type)
 fprintf(stderr,"video codec id=%d name='%s'\n",
 cdCodec->id,cdCodec->long_name);
 else if(AVMEDIA_TYPE_AUDIO==cdpCodecParams->codec_type)
 fprintf(stderr,"audio codec id=%d name='%s'\n",
 cdCodec->id,cdCodec->long_name);
 else {
 fprintf(stderr,"unsupported codec id=%d name='%s'\n",
 cdCodec->id,cdCodec->long_name);
 continue;
 }
 ccCodecCtx=avcodec_alloc_context3(cdCodec);
 avcodec_parameters_to_context(ccCodecCtx,cdpCodecParams);
 iError=avcodec_open2(ccCodecCtx,cdCodec,NULL);
 if(0>iError) {
 av_strerror(iError,szError,sizeof(szError));
 fprintf(stderr,"avcodec_open2() failed: %s\n",szError);
 avcodec_free_context(&ccCodecCtx);
 continue;
 }
 pkPacket=av_packet_alloc();
 frFrame=av_frame_alloc();
 av_seek_frame(fcFormatCtx,uiSt,0,AVSEEK_FLAG_FRAME);
 while(0==av_read_frame(fcFormatCtx,pkPacket)) {
 if(uiSt==pkPacket->stream_index) {
 iError=avcodec_send_packet(ccCodecCtx,pkPacket);
 if(0>iError) {
 av_strerror(iError,szError,sizeof(szError));
 fprintf(stderr,"avcodec_send_packet() failed: %s\n",szError);
 break;
 }
 while(true) {
 iError=avcodec_receive_frame(ccCodecCtx,frFrame);
 if(0>iError)
 break;
 fprintf(stderr,"stream %u, frame %d\n",
 uiSt,ccCodecCtx->frame_number);
 av_frame_unref(frFrame);
 }
 if(AVERROR(EAGAIN)!=iError&&AVERROR_EOF!=iError) {
 av_strerror(iError,szError,sizeof(szError));
 fprintf(stderr,"avcodec_receive_frame() failed: %s\n",szError);
 break;
 }
 }
 av_packet_unref(pkPacket);
 }
 av_packet_free(&pkPacket);
 av_frame_free(&frFrame);
 avcodec_free_context(&ccCodecCtx);
 }
 avformat_close_input(&fcFormatCtx);
}



It's pretty much self contained but you may ignore all the initializations and go directly to the while after the call to av_seek_frame(). This is where the actual frames are being read.


BTW, I'm using av_seek_frame() because this program goes stream by stream, separating the frames, so I need to rewind with every stream found.


Anyway, I've tested the previous code with the following files :


#1. sample-10s.mp4 from https://samplelib.com/sample-mp4.html ...




My program : 301 video frames ; 440 audio frames


ffprobe : 303 video frames ; 440 audio frames




#2. production ID_3997798.mp4 from https://www.pexels.com/video/hands-hand-table-colorful-3997798/ ...




My program : 736 video frames ; no audio frames


ffprobe : 738 video frames ; no audio frames




I found more videos with this difference, but it ONLY happens in the video streams.


Is there something I am forgetting ? There seem to be always 2 frames behind what ffprobe shows.


Thank you.