Recherche avancée

Médias (91)

Autres articles (20)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (4167)

  • Get frame time in ffmpeg

    30 mai 2023, par Srv19

    I 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 is AVCodecContext.

    


    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.

    


  • With ffmpeg print onto clipped video hh:mm:ss time *from original* and hh:mm:ss total duration from original

    25 mai 2023, par Kes

    I am using arch linux and bash and ffmpeg, all are up to date and the latest versions.

    


    I am clipping a video that is 30 seconds long and wish to clip from 5 secs to 10 seconds to a new file, from the original.

    


    In the bottom right hand corner of the clip I wish to show timestamps from the original video as follows

    


      

    • in the 5th second "00:00:05/ 00:00:30"
    • 


    • in the 6th second "00:00:06/ 00:00:30"
      
etc
    • 


    • in the 10th second "00:00:10/ 00:00:30"
    • 


    


    This is an apparentley simple question(?) but the syntax of the command is not at all obvious and I am hoping an expert may shed some light on this.

    


    All I have so far for the drawtext part, which does not do what I want as it only counts the elapsed time from t=0 of the new clip, whereas I want it to show the timestamp and total duration of the original clip

    


    drawtext I started with

    


    "drawtext=text='%{pts\:gmtime\:0\:%M\\\\\:%S}':fontsize=24:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)"


    


    ffmpeg line with drawtext I have started with

    


    ffmpeg -ss 00:00:05 -i  "$in_file" -filter_complex "drawtext=fontfile=font.ttf:text='sample text':x=10:y=10:fontsize=12:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5,drawtext=text='%{duration\:hms}':fontsize=12:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)" -t 5 -c:a copy -c:v libx264 out_file.mp4


    


  • Using ffmpeg to print onto video clip actual time and duration from original clip

    24 mai 2023, par Kes

    I am using arch linux and bash and ffmpeg, all are up to date and the latest versions.

    


    I am clipping a video that is 30 seconds long and wish to clip from 5 secs to 10 seconds to a new file, from the original.

    


    In the bottom right hand corner of the clip I wish to show timestamps from the original video as follows

    


      

    • in the 5th second "00:00:05/ 00:00:30"
    • 


    • in the 6th second "00:00:06/ 00:00:30"
      
etc
    • 


    • in the 10th second "00:00:10/ 00:00:30"
    • 


    


    This is an apparentley simple question(?) but the syntax of the command is not at all obvious and I am hoping an expert may shed some light on this.

    


    All I have so far for the drawtext part, which does not do what I want as it only counts the elapsed time from t=0 of the clip, whereas I want it to show the timestamp and total duration of the original clip

    


    drawtext I started with

    


    "drawtext=text='%{pts\:gmtime\:0\:%M\\\\\:%S}':fontsize=24:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)"


    


    ffmpeg line with drawtext I have started with

    


    ffmpeg -ss 00:00:05 -i  "$in_file" -filter_complex "drawtext=fontfile=font.ttf:text='sample text':x=10:y=10:fontsize=12:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5,drawtext=text='%{duration\:hms}':fontsize=12:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)" -t 5 -c:a copy -c:v libx264 out_file.mp4