
Recherche avancée
Autres articles (77)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...) -
Diogene : création de masques spécifiques de formulaires d’édition de contenus
26 octobre 2010, parDiogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
A quoi sert ce plugin
Création de masques de formulaires
Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)
Sur d’autres sites (8154)
-
FFmpeg - calculate the remaining conversion time
27 avril 2017, par MPM Уеб ДизайнI use ffmpeg to convert a clip video.mp4 to video.mp3 for example.
Is there a way to calculate the remaining conversion time ? -
FFmpeg for marking time video based on a reference date
3 août 2016, par Denio MarizI am trying to mark a timestamp in a video using Drawtext filter.
FFmpeg easily marks timestamps based on localtime, gmtime or even PTS. However, I want to assign a reference time (start time) for the timestamp in order to represent the time the video was recorded (not encoded).Reading the documentation, I found that option "basetime" can be used for this purpose. However it seems that is not working or I am missing something.
The command line I am using is :
ffmpeg -y -i input.mp4 -filter_complex drawtext="fontfile=/tmp/UbuntuMono-B.ttf: fontsize=36: fontcolor=yellow: box=1: boxcolor=black@0.4: text='Wall Clock Time\: %{gmtime\:%Y-%m-%d %T}': basetime=1456007118" output.mp4
By using basetime=1456007118", it was expected the start time was set to ’02/20/2016 20:25:18’ since 1456007118 is the UTC time for that time and date :
date -d '02/20/2016 20:25:18' +"%s" # format MM/DD/AAAA hh:mm:ss
1456007118However, no error is issued by FFMpeg and the video is marked with current GMT, ignoring "basetime" option.
Any hint ?
Thanks.Complete information about FFmpeg version and output is :
ffmpeg -y -i /home/denio/Videos/Interstellar_2014_Trailer_4_5.1-1080p-HDTN.mp4 -filter_complex drawtext="fontfile=/tmp/UbuntuMono-B.ttf: fontsize=36: fontcolor=yellow: box=1: boxcolor=black@0.4: text='Wall Clock Time\: %{gmtime\:%Y-%m-%d %T}': basetime=1470226363" /tmp/x.mp4
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2.1) 20160413
configuration: --enable-libxavs --enable-bzlib --enable-libfaac --enable-libfreetype --enable-libfontconfig --enable-libmp3lame --enable-libschroedinger --enable-libspeex --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-zlib --enable-x11grab --enable-static --enable-pthreads --enable-gpl --enable-nonfree --enable-version3 --disable-ffserver --enable-libgsm --enable-librtmp --enable-libvpx --enable-libschroedinger --enable-libopencore-amrnb --enable-libopenjpeg
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
...
... -
Get frame time in ffmpeg
30 mai 2023, par Srv19I am trying to make a little video player that has seek bar (with ffmpeg, of course). For that i need function that will, using data from frame and/or packet, get me current time in the video that should be set in seek slider.


It should work like this :


my_time = get_cur_time()
seek(my_time + 10)
assert(my_time+10 == get_cur_time())
seek(my_time - 10)
assert(my_time-10 == get_cur_time())



I do understand that ffmpeg does not support precise seeking, so equality here means "something reasonably close".


What code have i used for this thus far :


frame_time = frame->pts * av_q2d(video_dec_ctx->time_base) * 1000;



where frame is
AVFrame
and video_dec_ctx isAVCodecContext
.

And for seeking :


int fn = ffmpeg::av_rescale(tsms,fmt_ctx->streams[video_stream->index]->time_base.den,
 fmt_ctx->streams[video_stream->index]->time_base.num);
int frame = fn / 1000;

printf("\t avformat_seek_file to %d\n",frame);
int flags = AVSEEK_FLAG_FRAME;
if (frame < this->frame->pts)
 flags |= AVSEEK_FLAG_BACKWARD;
if (ffmpeg::av_seek_frame(fmt_ctx, video_stream->index, frame, flags))
{
 printf("\nFailed to seek for time %d",frame);
 return false;
}

avcodec_flush_buffers(video_dec_ctx);
int got_frame = 0;
do
if (av_read_frame(fmt_ctx, &pkt) >= 0) {
 decode_packet_ro(&got_frame, 0);
 av_free_packet(&pkt);
}
else
{
 read_cache = true;
 pkt.data = NULL;
 pkt.size = 0;
 break;
}
while (!(got_frame && this->frame->pts >= frame));



The code does forward seeking passably, but after any attempt of backward seeking my second assertion fails. After seeking to previous position, my method of getting time does not return position less that one before seeking. That causes my seek slider to work grossly incorrectly.