Recherche avancée

Médias (91)

Autres articles (83)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

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

  • variable length of segments in HLS

    12 août 2019, par shubham vashisht

    I am using FFmpeg to create a hls streaming manifest from a audio file.
    So far i can break the audio file into several segments based on the duration. Let’s say 10. But the requirement is to break audio file in such way that first few segments are of lesser size say 4 seconds and following segments of 10 seconds long.
    I am calling ffmpeg from a python script like this

       result = subprocess.Popen(['ffmpeg -y -i {}  -acodec copy -f segment -segment_time {} -segment_list {}.m3u8 {}%03d.ts'.format(pathToDownloadedMediaFile, 10, mediaFileName,mediaFileName)],stdout=subprocess.PIPE,stderr=subprocess.STDOUT, shell=True)

    is there any way to create first few segments of different duration than the rest ?

  • How do I timestamp an excel document using Pandas ?

    16 juillet 2015, par Andy Do

    I have a script that uses FFMPEG and CMD to cut video files based off of an excel document row by row. I would like python to add a timestamp after it is done with a row. Can you guys please help ?

    import subprocess as sp, pandas as pd

    ffmpeg = 'C:/FFMPEG/bin/ffmpeg.exe' # on Windows
    datafile = r'C:\Users\A_Do\Dropbox\1. Projects\2. Python\TM Creator\tm_creator_test1.xlsx'

    xl = pd.ExcelFile(datafile,index = False)
    df = xl.parse('Sheet1')

    def create_tm():
       row_iterator = df.iterrows()
        # take first item from row_iterator
       for i, row in row_iterator:
           infile = row['filename']
           outputfile = row['outputfilename']
           timein = row['timein']
           duration = row['duration']
           decision = row['Create TM?']
           if decision == "Y":
               sp.call(ffmpeg + " -y -i " + infile + " -map 0:0 -map 0:1 -map 0:2 -acodec copy -ss " + str(timein) + " -codec copy -t " + str(duration) + " " + outputfile,shell=True) #this works

           elif decision != decision: #this gets rid of the NaN
               break
           else:
               print "You said you didn't want to make a TM for " + str(infile)

    create_tm()

    Thanks !

    My final code :

    import subprocess as sp, pandas as pd
    # (1) new import
    from openpyxl import load_workbook
    # (2) new import
    from datetime import datetime

    ffmpeg = 'D:/FFMPEG/bin/ffmpeg.exe' # on Windows
    datafile = r'D:\Dropbox\1. Projects\2. Python\TM Creator\tm_creator_test1.xlsx'

    # (3) open the file in openpyxl first:
    book = load_workbook(datafile)

    xl = pd.ExcelFile(datafile,index = False)
    df = xl.parse('Sheet1')

    def create_tm():
       row_iterator = df.iterrows()
        # take first item from row_iterator
       for i, row in row_iterator:
           infile = row['filename']
           outputfile = row['outputfilename']
           timein = row['timein']
           duration = row['duration']
           decision = row['Create TM?']
           if decision == "Y":
               sp.call(ffmpeg + " -y -i " + infile + " -map 0:0 -map 0:1 -acodec copy -ss " + str(timein) + " -codec copy -t " + str(duration) + " " + outputfile,shell=True) #this works
               # (4) Wherever in the code you want to put the timestamp:
               df.loc[i, 'Timestamp'] = str(datetime.now())
               # (5) This saves the sheet back into the original file, without removing
               # any of the old sheets.
               writer = pd.ExcelWriter(datafile)
               writer.book = book
               writer.sheets = dict((ws.title, ws) for ws in book.worksheets)
               df.to_excel(writer, index=False)
               writer.save()
           elif decision != decision: #this gets rid of the NaN
               break
           else:
               print "You said you didn't want to make a TM for " + str(infile)
  • How to add blurred border on top and bottom based on the video

    5 avril 2023, par Noob69

    I am trying to modify a video to 1080x1920 scale and I want to add to the borders on top and bottom, a blurred version of the video based on the pixel on the edge.

    


    import subprocess

input_file = "my_video1.mp4"
output_file = "my_video_processed1.mp4"

command = f'ffmpeg -i {input_file} -vf "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,eq=saturation=2.0:gamma=1.2:contrast=1.2,unsharp=lx=5:ly=5:la=0.5:cx=5:cy=5:ca=0.5" -c:v libx264 -preset slow -crf 18 -c:a copy {output_file}'
subprocess.call(command, shell=True)



    


    I tried
mode = replicate, however it is not working for the latest version of ffmpeg from Windows builds by BtbN.