
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (47)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (8006)
-
Lossless trim and crop of MJPEG video
28 avril 2021, par prouastI 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 JI 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 nullwhere 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 tzujanI 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)