Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (64)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (9840)

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

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