Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (111)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (8620)

  • Extract 5 seconds of a mp4 video for every 60 seconds of the video [duplicate]

    8 mars 2024, par transientflaw

    I'm trying to write a batch script with ffmpeg that takes every mp4 files in a folder, extracts 5 seconds out of them at 2 seconds after the start of the video, and then, if the original video lasts longer than 60 seconds, as well as that first segment, it takes another 5 seconds segment for every 60 seconds until it cannot because there are not enough seconds to segment.

    


    Is it clear ?

    


    I've tried this code

    


    @echo off

rem Set input and output directories
set "input_dir=C:\Users\Lex\Desktop\vtrip"
set "output_dir=C:\Users\Lex\Desktop\vtrip\output"

rem Loop through all MP4 files in the input directory
for %%I in ("%input_dir%\*.mp4") do (
    rem Extract 5 seconds starting 2 seconds after the start of the video
    ffmpeg -i "%%I" -ss 2 -t 5 "%output_dir%\temp_segment_1_%%~nI.mp4"

    rem Get total duration of the video
    for /f "tokens=*" %%a in ('ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "%%I"') do set "duration=%%a"

    rem Check if the duration exceeds 60 seconds
    if !duration! GTR 60 (
        rem Calculate the number of segments
        set /a "num_segments=!duration!/62"
        
        rem Extract 5-second segments every 62 seconds
        set /a "start_time=64"  REM Start from 2 seconds after the first segment
        for /l %%x in (2,1,!num_segments!) do (
            ffmpeg -i "%%I" -ss !start_time! -t 5 "%output_dir%\temp_segment_%%x_%%~nI.mp4"
            set /a "start_time+=62"
        )
    )
)



    


    I've tried it on 3 files, the 2 that are under 1 minute are fine but there is one that lasts 2m29 and it only extracts 1 segment for that last one whereas it should extract 3 5-seconds segments for this one video.

    


    Any way to fix that ?

    


  • Add a seconds counter text to a sliced video with ffmpeg that starts from 0

    16 mars 2024, par virtualdj

    I'm trying to convert a small part of a screen recording video into a GIF with ffmpeg. I would like to add a seconds counter on it as the frame rate of the GIF file is reduced, so I can guess the time passing from the counter.

    


    Normally, assuming to start at 43 seconds and cutting after 33 seconds, the example video would have been encoded to GIF with :

    


    ffmpeg -i in.mp4 -vf "scale=300:-1,fps=5,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -ss 43 -t 33 out.gif


    


    To print the timecode, I add the following after fps=5, :

    


    drawtext=text='%{pts\:hms}':font='Arial':fontcolor=red:fontsize=14:x=(w-text_w)/2:y=(h-text_h-6),


    


    Doing so, prints a timecode on the output that starts from 00:00:43.000, not from zero. Similarly the timecode option :

    


    drawtext=text='':font='Arial':fontcolor=red:fontsize=14:x=(w-text_w)/2:y=(h-text_h-6):timecode='00\:00\:00\:00':timecode_rate=5,


    


    will ouput 00:00:43:0. There doesn't seem to have a way to use the "output" timecode (that starts from 0) ; also, I would like to have the seconds only.

    


    How can I do that ?

    


  • FFMPEG : how to create a "title slide" for 3 seconds before a video [closed]

    15 mars 2024, par ashay

    I'm trying to make a lecture video to put online. I have the video itself, and I have a title slide that I'd like to play for 3 seconds before the main video.

    


    I tried using ffmpeg to (1) create a 3 second long video from the title slide and (2) concat the two videos together.

    


    I'm having issues concatenating the videos together — when I do so, the resulting video is much longer than it should be. When I look online, others have similar problems — and this seems to occur when the parameters of the two videos do not match perfectly.

    


    I'd prefer to do this without re-encoding the main video — and it seems this should be possible because I should be able to control what parameters are set for the "lecture slide video".

    


    Here are the commands I've run.
The main video has framerate 25, resolution 1920x1080, and an audio stream at #0:0 and a video stream at #0:1 (according to ffmpeg -i [video].

    


    To create the video of the title slide, I ran ffmpeg -framerate 25 -i lec01_title.png -t 3 -c:v libx264 -x265-params lossless=1 -pix_fmt yuvj420p -vf scale=1920:1080 lec01_title.mp4 -f lavfi -i anullsrc -c:a aac -shortest.
Then to reorder the streams to match the main video, I ran ffmpeg -i lec01_title.mp4 -map 0:a -map 0:v -c:v copy -c:a copy lec01_title_matched.mp4.

    


    Then to concatenate the two files together, I created a text file "concat_list" with :
file 'lec01_title_matched.mp4' file 'lec01.mp4', and ran the command ffmpeg -f concat -safe 0 -i concat_list.txt -c copy -movflags +faststart output.mp4.

    


    The main video is 53 minutes long, but the final output video after concatenating is 1 hour and 43 minutes long.

    


    I'm looking for advice for how to create the "lecture title video" properly to match the parameters of the second video so that I can concatenate them without problems.

    


    Here's the output of ffmpeg -i lec01.mp4 :

    


    ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dcai_lec01.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : 2-190-wideshot
    encoder         : Lavf60.16.100
  Duration: 00:47:39.08, start: 0.000000, bitrate: 1435 kb/s
  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1298 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.31.102 libx264


    


    Described above in detail.