Recherche avancée

Médias (91)

Autres articles (73)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (12263)

  • ffmpeg jpg batch script with timestamp

    3 juillet 2021, par Chris

    I currently have this batch script using ffmpeg to scale images and place in a new location with the same folder structure. How do i include the timestamp from the original jpg file in the filename of the new scaled jpg file ?

    


    This gives files named m-H-S_IMG_0305

    


    @echo off &setlocal
set /a nfile=0
echo Copying directory structure from %1 to %2 ...
xcopy /T "%~1" "%~2"
REM walk directory structure and convert each file in quiet mode
set "sourcefolder=%~1"
set "targetfolder=%~2"
for /R "%sourcefolder%" %%a in (*.JPG) do (
    echo converting "%%~nxa" ...
    set "sourcefile=%%~fa"
    set "sourcepath=%%~dpa"
    set "targetfile=%%~na.JPG"
    setlocal enabledelayedexpansion
    set "targetfolder=%targetfolder%!sourcepath:%sourcefolder%=!"
    ffmpeg -v quiet -i "!sourcefile!" -vf scale=256x256 -q:v 1 -strftime 1 "!targetfolder!%Y-%m-%d_%H-%M-%S_!targetfile!"
    endlocal
    set /A nfile+=1
)
echo Done! Converted %nfile% file(s)


    


    Working version for file modify date :

    


    @echo off &setlocal
set /a nfile=0
echo Copying directory structure from %1 to %2 ...
xcopy /T "%~1" "%~2"
REM walk directory structure and convert each file in quiet mode
set "sourcefolder=%~1"
set "targetfolder=%~2"
for /R "%sourcefolder%" %%a in (*.JPG) do (
    echo converting "%%~nxa" ...
    echo which has a timestamp of "%%~ta" ...
    set "sourcefile=%%~fa"
    set "sourcepath=%%~dpa"
    set "targetfile=%%~na.JPG"
    set "timestamp=%%~ta"
    setlocal enabledelayedexpansion
    set "timestamp=!timestamp: =_!"
    set "timestamp=!timestamp::=-!"
    set "timestamp=!timestamp:/=-!"
    set "targetfolder=%targetfolder%!sourcepath:%sourcefolder%=!"
    ffmpeg -v quiet -i "!sourcefile!" -vf scale=256x256 -q:v 1 "!targetfolder!!timestamp!_!targetfile!"
    endlocal
    set /A nfile+=1
)
echo Done! Converted %nfile% file(s)


    


    File Creation date option attempt using exiftool (This works but it stops frequently so there is an error somewhere) :

    


    @echo off &setlocal
set /a nfile=0
echo Copying directory structure from %1 to %2 ...
xcopy /T "%~1" "%~2"
REM walk directory structure and convert each file in quiet mode
set "sourcefolder=%~1"
set "targetfolder=%~2"
for /R "%sourcefolder%" %%a in (*.JPG) do (
    echo converting "%%~nxa" ...
    echo which has a timestamp of "%%~ta" ...
    set "sourcefile=%%~fa"
    set "sourcepath=%%~dpa"
    set "targetfile=%%~na.JPG"
    set "timestamp=('exiftool -d %%Y%%m%%d_%%H%%M%%S -CreateDate %%~a')"
    for /f "tokens=1,2 delims=x" %%a in ('exiftool -T -d %%Y%%m%%d_%%H%%M%%S -CreateDate "%%a"') do (
        set "timestamp=%%a"
    )
    setlocal enabledelayedexpansion
    set "targetfolder=%targetfolder%!sourcepath:%sourcefolder%=!"
    ffmpeg -v quiet -i "!sourcefile!" -vf scale=256x256 -q:v 1 "!targetfolder!!timestamp!_!targetfile!"
    endlocal
    set /A nfile+=1
)
echo Done! Converted %nfile% file(s)


    


  • ffmpeg, add static image to beginning and end with transitions

    14 mars 2021, par CreateChange

    ffmpeg noob here, trying to help my mother with some videos for real estate walkthroughs. I'd like to set up a simple pipeline that I can run videos through and have outputted as such :

    


      

    • 5 second (silent) title card ->
    • 


    • xfade transition ->
    • 


    • property walk through ->
    • 


    • xfade transition ->
    • 


    • 5 second (silent) title card
    • 


    


    Considerations :

    


      

    • The intro / outro card will be the same content.
    • 


    • The input walkthrough videos will be of variable length so, if possible, a dynamic solution accounting for this would be ideal. If this requires me to script something using ffprobe, I can do that - just need to gain an understanding of the syntax and order of operations.
    • 


    • The video clip will come in with some audio already overlaid. I would like for the title cards to be silent, and have the video/audio clip fade in/out together.
    • 


    


    I have gotten a sample working without the transitions :

    


    ffmpeg -loop 1 -t 5 -i title_card.jpg \
    -i walkthrough.MOV \
    -f lavfi -t 0.1 -i anullsrc \
    -filter_complex "[0][2][1:v][1:a][0][2]concat=n=3:v=1:a=1[v][a]" \
    -map "[v]" -map "[a]" \
    -vcodec libx265 \
    -crf 18 \
    -vsync 2 \
    output_without_transitions.mp4


    


    I have been unable to get it to work with transitions. See below for the latest iteration :

    


    ffmpeg -loop 1 -t 5 -r 60 -i title_card.jpg \
    -r 60 -i walkthrough.MOV \
    -f lavfi -t 0.1 -i anullsrc \
    -filter_complex \
    "[0][1:v]xfade=transition=fade:duration=0.5:offset=4.5[v01]; \
    [v01][0]xfade=transition=fade:duration=0.5:offset=12.8[v]" \
    -map "[v]" \
    -vcodec libx265 \
    -crf 18 \
    -vsync 2 \
    output_with_transitions.mp4


    


    This half-works, resulting in the initial title card, fading into the video, but the second title card never occurs. Note, I also removed any references to audio, in an effort to get the transitions alone to work.

    


    I have been beating my head against the wall on this, so help would be appreciated :)

    


  • ffmpeg mkv to mp4 converter drops part of the audio, how to configure in python ?

    14 mars 2021, par user3486773

    I am converting several mkv files to mp4 via ffmpeg and python. However when I go to play them, the background audio is synced up perfect, but it's as if it's dropped all the voices. Is there a way to set all the audio to mono ?

    


    or how do I specify the number of channels ?

    


    The following audio and video settings work in vlc :

    


    video settings:
Codec = H-265
bitrate = 800 kb/s

audio settings:
Codec = MP3
bitrate = 128 kb/s
channels = 2
sample rate = 8000Hz


    


    my python code :

    


    import os
import ffmpeg
import glob

start_dir = os.chdir("C:/Users/Me/Downloads/")
files = [file for file in glob.glob("*.mkv")]

def convert_to_mp4(mkv_file):
    name, ext = os.path.splitext(mkv_file)
    out_name = name + ".mp4"
    ffmpeg.input(mkv_file).output(out_name).run()
    print("Finished converting {}".format(mkv_file))

print(os.getcwd())
for path, folder, files in os.walk(os.getcwd()):
    for file in files:
        if file.endswith('.mkv'):
            print("Found file: %s" % file)
            convert_to_mp4(os.path.join(os.getcwd(), file))
        else:
            pass