Recherche avancée

Médias (0)

Mot : - Tags -/publication

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

Autres articles (111)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Que fait exactement ce script ?

    18 janvier 2011, par

    Ce script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
    Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
    Installation de dépendances de MediaSPIP
    Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
    Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...)

Sur d’autres sites (9502)

  • Lossless trim and crop of MJPEG video

    28 avril 2021, par prouast

    I am working on a project where I need to trim and crop MJPEG videos without any re-encoding. I have working code that accomplishes this by exporting the relevant frames as JPEGs, cropping them individually, and then joining them back together into an MJPEG.

    


    However, this seems quite inefficient and slow. I am looking for pointers how to improve this approach. For example, would it be possible to store the JPEGs in-memory ?

    


    import ffmpeg
import os
import shutil
import subprocess

def lossless_trim_and_crop(path, output_path, start, end, x, y, width, height, fps):
  # Trim the video in time and export all individual jpeg with ffmpeg + mjpeg2jpeg
  jpeg_folder = os.path.splitext(output_path)[0]
  jpeg_path = os.path.join(jpeg_folder, "frame_%03d.jpg")
  stream = ffmpeg.input(path, ss=start/fps, t=(end-start)/fps)
  stream = ffmpeg.output(stream, jpeg_path, vcodec='copy', **{'bsf:v': 'mjpeg2jpeg'})
  stream.run(quiet=True)
  # Crop all individual jpeg with jpegtran
  for filename in os.listdir(jpeg_folder):
    filepath = os.path.join(jpeg_folder, filename)
    out_filepath = os.path.splitext(filepath)[0] + "_c.jpg"
    subprocess.call(
      "jpegtran -perfect -crop {}x{}+{}+{} -outfile {} {}".format(
        width, height, x, y, out_filepath, filepath), shell=True)
    os.remove(filepath)
  # Join individual jpg back together
  cropped_jpeg_path = os.path.join(jpeg_folder, "frame_%03d_c.jpg")
  stream = ffmpeg.input(cropped_jpeg_path, framerate=fps)
  stream = ffmpeg.output(stream, output_path, vcodec='copy')
  stream.run(quiet=True)
  # Delete jpeg directory
  shutil.rmtree(jpeg_folder)


    


  • How to detect a common section in a set of videos with ffmpeg [on hold]

    7 août 2019, par Hans J

    I have a set of videos that are assumed to contain common (or very similar) sections. I want to be able to detect (with FFmpeg) how long each common section is, and where the sections are in each individual video.

    An individual section can have multiple scene changes, and is continuous. A common section would also be assumed to be longer than 10 seconds (This is an arbitrary choice, it can be changed).

    The final output of the command would include the various time-codes of the instance of each section in each video. Assuming a timebase 1/1, with 1 common section that is 60 seconds long, an output would along the lines of :

    Video1.mp4 0 60
    Video2.mp4 120 180
    Video3.mp4 50 110
    Video4.mp4 null

    where video1, video2, video3, and video4 are the input videos. In this case, video4 does not contain a common section.

    For example, I could have three episodes of a TV show. They all contain the same commercial. Without knowing what that commercial is, I want to be able to find where that commercial shows up in each of the episodes. Ideally the function would detect additional common commercials as well.

    Edit : Another example would be removing the intro sequence in all three episodes.

    Note : For the purpose of a good solution, the common sections do not have to exactly match. Because there could be artifacts or embedded subtitles in one episode and not the other.

  • How to export wave slices to the same bits per sample as the original file

    23 avril 2019, par tzujan

    I am looping through a large wave file, via a dictionary of new file names, lengths and versions. The loop exports the individual slices as files :

    mix.export(key, format='wav')

    However, it converts the original 24-bit file to 32-bit slices. I have been doing a round trip to pro tools to get the files back to 24, as I can’t figure out either ffmpeg settings, or getting the slice into a subprocess.

    I have tried several variations of this theme :

    mix.export(key, format='wav', codec='pcm_s24le')

    As well as this one :

    mix.export(k, format='wav', parameters=['ffmpeg', '-i', '-acodec', 'pcm_s24le', '-ar', '48000'])

    I can’t seem to get the individual slices to work in the following subprocess call. key is the file name from the key-value pair. This works well in the 32-bit export, but not sure how to make it work when a slice’s temp file, such as /var/folders/vc/q7jggn7900l099w45463lgx40000gn/T/tmpw_6mxyg8 needs to be called.

    subprocess.call(['ffmpeg', '-i', key,
                    '-acodec', 'pcm_s24le', '-ar', '48000', 'output.wav'])

    Hoping for slices of the exact same format as the original input :

    mix_file = AudioSegment.from_wav(file_name)