Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (76)

  • 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 (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (12231)

  • Replace video frames with png image using ffmpeg [closed]

    21 février 2024, par P0W

    I have a folder with list of png images named as following format {frameno}.png

    


    Example : 1.png, 42.png, 618.png, etc.

    


    I need to replace only these frames in original video while keeping the video intact, how can I achieve this with ffmpeg utility ?

    



    


    Follow on question : Is it possible to accept a txt/csv/json file that can tell how many times a png needs to be repeated as frame ?

    


    If this requires some coding, I would appreciate some snippet in python.

    



    


    PS : If that matters, I have these png with OCR text as boundary box, that I need to overlay on the original video along with some profanity check.

    


  • Blur MP4 video section for x seconds using FFmpeg

    23 mai 2021, par sigur7

    I am trying to blur out an account ID that is showing in the footer of my video for the first 47s.

    


    I have managed to do an entire page blur for 47 seconds and blurred out the desired section for the entire video, but not managed to be able mix the two to get the desired result ? Adding the between section to the original blurbox command keeps throwing errors.

    


    Blurs entire video for first 48 seconds
ffmpeg -i original.mp4 -vf "boxblur=enable='between(t,0,47)'" -codec:a copy blurred.mp4

    


    Blurs a certain segment, but for the whole video
ffmpeg -i original.mp4 -filter_complex "[0:v]crop=450:200:150:1000,boxblur=10[fg];   [0:v][fg]overlay=150:1000[v]" -map "[v]" -map 0:a -c:v libx264 -c:a copy -movflags +faststart blurredsection.mp4

    


    How can I blur the x/y section AND only do it in the first 48 seconds ?

    


  • ffmpeg audio file cropping breaking on longer audio files

    5 août 2021, par connor449

    I have a bunch of audio files. I am trying to crop the first and last 10% of the files off, keeping only the middle 80%.

    


    Essentially what I am doing :

    


      

    • read file
    • 


    • get duration of audio file in seconds
    • 


    • use ffmpeg to crop the file from duration0.1 to duration0.9
    • 


    


    I am using this code :

    


    import wave
import contextlib
import subprocess
import glob

data = []
duration_L = []

for path in glob.glob('audio/*/*.wav'):
    name = str(path).split('/')[-1].split('.')[0]
    label = str(path).split('/')[-2]

    with contextlib.closing(wave.open(path,'r')) as f:
        frames = f.getnframes()
        rate = f.getframerate()
        duration = frames / float(rate)
        duration_L.append([duration, label])
        save_path = f"audio_edited/{label}/{name}.wav"
    if duration >= 3:
        command = f"ffmpeg -y -i {name_} -ss {duration*0.1} -to {duration*0.9} -c copy {save_path}"
        subprocess.call(command, shell=True)
        print('original length: ', duration)
        print("0.1 of duration:    ", duration*0.1)
        print("0.9 of duration:    ", duration*0.9)
        print(f"file should now be {(duration*0.9) - (duration*0.1)} long")
        with contextlib.closing(wave.open(save_path,'r')) as f:
            frames = f.getnframes()
            rate = f.getframerate()
            newduration = frames / float(rate)
        print('new length is:  ',newduration)
        print("\n")



    


    It appears to work okay on smaller duration files, but it breaks on larger ones. For example, here is a sample of the print out from a bunch of files :

    


    original length:  3.3436734693877552
0.1 of duration:     0.33436734693877557
0.9 of duration:     3.00930612244898
file should now be 2.6749387755102045 long
new length is:   2.647074829931973


original length:  4.365351473922902
0.1 of duration:     0.43653514739229027
0.9 of duration:     3.928816326530612
file should now be 3.492281179138322 long
new length is:   3.4829931972789114


original length:  8.080544217687075
0.1 of duration:     0.8080544217687076
0.9 of duration:     7.272489795918368
file should now be 6.4644353741496605 long
new length is:   6.315827664399093


original length:  12.167256235827665
0.1 of duration:     1.2167256235827666
0.9 of duration:     10.950530612244899
file should now be 9.733804988662133 long
new length is:   5.897868480725624


original length:  5.061950113378685
0.1 of duration:     0.5061950113378685
0.9 of duration:     4.555755102040816
file should now be 4.049560090702948 long
new length is:   4.08671201814059


original length:  3.3901133786848074
0.1 of duration:     0.33901133786848076
0.9 of duration:     3.051102040816327
file should now be 2.712090702947846 long
new length is:   2.693514739229025


original length:  9.195102040816327
0.1 of duration:     0.9195102040816328
0.9 of duration:     8.275591836734694
file should now be 7.356081632653062 long
new length is:   6.222947845804988


    


    Notice that on files over 7 seconds, the new length is not what the file length should be. Instead the file is cropped to be much shorter.

    


    What is going on ?