
Recherche avancée
Autres articles (35)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (4628)
-
Transcode each stream in a different thread with ffmpeg
30 mai 2018, par hedgar2017Is there a way of forcing ffmpeg to encode each audio stream in a different thread ?
ffmpeg
-i audio1.ac3 -c:a libopus
-i audio2.ac3 -c:a libopus
-i audio3.ac3 -c:a libopus
output.mkvI mean only ffmpeg’s own instruments, without multiple processes and other OS features.
Normally, there is only one core saturated, so encoding a file with many audio streams is very long.
Exact command :
ffmpeg -loglevel verbose
-i 'Ярость (Fury).mkv'
-i 'Fury (2014) [Ukr & Eng, Sub Eng] BDRip-AVC [Hurtom & HELLYWOOD].mkv'
-threads 0 -max_muxing_queue_size 65536 -avoid_negative_ts 1 -metadata title=2014.Fury.BDRip.HEVC.1080p
-map 0:0 -c:v copy -metadata:s:v:0 title=2014.Fury.BDRip.HEVC.1080p -disposition:v:0 +defaug-[forced
-map 0:2 -c:a libopus -application audio -vbr on -packet_loss 0 -frame_duration 20 -mapping_family 255 -compression_level 10 -metadata:s:a:0 language=eng -metadata:s:a:0 title=Original -disposition:a:0 +defaug-[forced
-map 1:1 -c:a libopus -application audio -vbr on -packet_loss 0 -frame_duration 20 -mapping_family 255 -compression_level 10 -metadata:s:a:1 language=ukr -disposition:a:1 -default-forced
-map 0:1 -c:a libopus -application audio -vbr on -packet_loss 0 -frame_duration 20 -mapping_family 255 -compression_level 10 -metadata:s:a:2 language=rus -metadata:s:a:2 title=Dub -disposition:a:2 -default-forced
-map 0:10 -c:s copy -metadata:s:s:0 language=eng -metadata:s:s:0 title=Original -disposition:s:0 -default-forced
-f matroska ./2014.Fury.BDRip.HEVC.1080p.mkvLog :
... inputs ...
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:2 -> #0:1 (dts (dca) -> opus (libopus))
Stream #1:1 -> #0:2 (ac3 (native) -> opus (libopus))
Stream #0:1 -> #0:3 (ac3 (native) -> opus (libopus))
Stream #0:10 -> #0:4 (copy)
Press [q] to stop, [?] for help
[graph_2_in_0_1 @ 0000019ca2cb29c0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
[format_out_0_3 @ 0000019ca2cb20c0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_3'
[auto_resampler_0 @ 0000019ca2cb27c0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:flt r:48000Hz
[libopus @ 0000019ca2c9f3c0] No bit rate set. Defaulting to 384000 bps.
[graph_0_in_0_2 @ 0000019ca2cb1ac0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
[format_out_0_1 @ 0000019ca2cb1bc0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
[auto_resampler_0 @ 0000019ca2cb14c0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:flt r:48000Hz
[libopus @ 0000019ca292c980] No bit rate set. Defaulting to 384000 bps.
[graph_1_in_1_1 @ 0000019ca2cb2bc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x60f
[format_out_0_2 @ 0000019ca2cb26c0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_2'
[auto_resampler_0 @ 0000019ca2cb0dc0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:6 chl:5.1(side) fmt:flt r:48000Hz
[libopus @ 0000019ca292e980] No bit rate set. Defaulting to 384000 bps.
Output #0, matroska, to './2014.Fury.BDRip.HEVC.1080p.mkv':
Metadata:
DATE_RELEASED : 2014
title : 2014.Fury.BDRip.HEVC.1080p
Released by : Buba5473 for NNM-Club
Copyright : Encoded by Goor80
encoder : Lavf58.12.100
Chapter #0:0: start 0.000000, end 478.228000
Metadata:
title : Chapter 01
... chapters ...
Stream #0:0: Video: hevc (Main 10), 1 reference frame, yuv420p10le(tv), 1920x800 (0x0) [SAR 1:1 DAR 12:5], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
Stream #0:1(eng): Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, 5.1(side), flt, delay 312, 384 kb/s (default)
Stream #0:2(ukr): Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, 5.1(side), flt, delay 312, 384 kb/s
Stream #0:3(rus): Audio: opus (libopus) ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, 5.1(side), flt, delay 312, 384 kb/s
Stream #0:4(eng): Subtitle: subrip
[matroska @ 0000019ca2d17f00] Starting new cluster due to timestamp=6175.5kbits/s speed=10.2x
[matroska @ 0000019ca2d17f00] Starting new cluster due to timestamp=7530.8kbits/s speed=8.74x
[matroska @ 0000019ca2d17f00] Starting new cluster due to timestamp=7955.1kbits/s speed=9.02x
frame=156607 fps=205 q=-1.0 size= 8321971kB time=01:48:51.85 bitrate=10437.1kbits/s speed=8.55x
... not finished yet ...fps is always around 3000/number_of_audio_channels, meaning all audio transcoding is done with the only thread.
-
Batch splitting large audio files into small fixed-length audio files in moments of silence
26 juillet 2023, par Haldjärvito train the SO-VITS-SVC neural network, we need 10-14 second voice files. As a material, let's say I use phrases from some game. I have already made a batch script for decoding different files into one working format, another batch script for removing silence, as well as a batch script for combining small audio files into files of 13-14 seconds (I used Python, pydub and FFmpeg). To successfully automatically create a training dataset, it remains only to make one batch script - Cutting audio files lasting more than 14 seconds into separate files lasting 10-14 seconds, cutting in places of silence or close to silence is highly preferable.


So, it is necessary to batch cut large audio files (20 seconds, 70 seconds, possibly several hundred seconds) into segments of approximately 10-14 seconds, however, the main task is to look for the quietest place in the cut areas so as not to cut phrases in the middle of a word (this is not very good for model training). So, is it really possible to do this in a very optimal way, so that the processing of a 30-second file does not take 15 seconds, but is fast ? Quiet zone detection is required only in the area of cuts, that is, 10-14 seconds, if counted from the very beginning of the file.


I would be very grateful for any help.


I tried to write a script together with ChatGPT, but all options gave completely unpredictable results and were not even close to what I needed... I had to stop at the option with a sharp cut of files for exactly 14000 milliseconds. However, I hope there is a chance to make a variant with cutting exactly in quiet areas.


import os
from pydub import AudioSegment

input_directory = ".../RemSilence/"
output_directory = ".../Split/"
max_duration = 14000

def split_audio_by_duration(input_file, duration):
 audio = AudioSegment.from_file(input_file)
 segments = []
 for i in range(0, len(audio), duration):
 segment = audio[i:i + duration]
 segments.append(segment)
 return segments

if __name__ == "__main__":
 os.makedirs(output_directory, exist_ok=True)
 audio_files = [os.path.join(input_directory, file) for file in os.listdir(input_directory) if file.endswith(".wav")]
 audio_files.sort(key=lambda file: len(AudioSegment.from_file(file)))
 for file in audio_files:
 audio = AudioSegment.from_file(file)
 if len(audio) > max_duration:
 segments = split_audio_by_duration(file, max_duration)
 for i, segment in enumerate(segments):
 output_filename = f"output_{len(os.listdir(output_directory))+1}.wav"
 output_file_path = os.path.join(output_directory, output_filename)
 segment.export(output_file_path, format="wav")
 else:
 output_filename = f"output_{len(os.listdir(output_directory))+1}.wav"
 output_file_path = os.path.join(output_directory, output_filename)
 audio.export(output_file_path, format="wav")



-
How can I retain 2x pixel density when encoding Retina screen capture with ffmpeg ?
26 février 2018, par hfossliWhenever I use ffmpeg to encode a HiDPI/Retina screen recording, the video plays at 2x the size, so it looks fuzzy, because the pixel density is not retained.
How can I retain the original pixel density of HiDPI screen recordings with ffmpeg ?
How to reproduce :
- Use QuickTime Player to create a Screen Recording on a Retina Mac.
- Play the video you recorded in QuickTime Player using the
⌘1 Actual Size
view. Notice that it’s playing 2:1 on your Retina Display, so the video looks sharp. It’s playing in half the space of the actual recorded pixels. -
Use ffmpeg to encode the video using a command like this :
ffmpeg -i haha.mov -c:v libx264 -crf 23 haha-lg.mov
- Play the new ffmpeg-compressed video in QuickTime Player using the
⌘1 Actual Size
view. Notice that it’s playing 1:1, so the video looks fuzzy.
To clarify, the video does not look blurry because it was compressed. Rather, it looks blurry because the video is being played twice as big as it should be, at a 1:1 pixel density, instead of the required 2:1 pixel density, presumably because some metadata is being discarded when encoding.
For the record, VLC plays both videos too big (blurry). So being able to play HiDPI videos seems to be a feature of QuickTime Player.
Here is the detailed information ffmpeg shows for the original screen recording :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'haha.mov':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2018-02-26T16:46:00.000000Z
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iMac18,3
com.apple.quicktime.software: Mac OS X 10.13.3 (17D102)
com.apple.quicktime.creationdate: 2018-02-26T10:45:50-0600
Duration: 00:00:04.35, start: 0.000000, bitrate: 10947 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1396x928 [SAR 1:1 DAR 349:232], 10701 kb/s, 60 fps, 60 tbr, 6k tbn, 12k tbc (default)
Metadata:
creation_time : 2018-02-26T16:46:00.000000Z
handler_name : Core Media Data Handler
encoder : H.264And here is the information for the ffmpeg-compressed version :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'haha-lg.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf57.83.100
Duration: 00:00:04.35, start: 0.000000, bitrate: 1923 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1396x928 [SAR 1:1 DAR 349:232], 1783 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : DataHandler
encoder : Lavc57.107.100 libx264