
Recherche avancée
Autres articles (50)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Les notifications de la ferme
1er décembre 2010, parAfin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
Les notifications de changement de statut
Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
À la demande d’un canal
Passage au statut "publie"
Passage au (...)
Sur d’autres sites (6155)
-
Python, ffmpeg split list of audio files
24 novembre 2020, par emilI know how to split one single audio file with python and ffmpeg :


command = "ffmpeg -i a.wav -f segment -segment_time 60 -c copy out_dir/output%09d.wav"
command = shlex.split(command)
subprocess.run(command)



For my current task, I have a list of several hundred
.wav
files I want to split.

My current solution is :


def parse_and_split_dir(directory, out_dir):
 files = [x for x in os.listdir(directory) if ".wav" in x]
 print(files)
 cntr = 0
 for wav in files:
 wav = wav.replace(" ", "\ ")
 temp_dir = os.path.join(out_dir, str(cntr))
 Path(temp_dir).mkdir(parents=True, exist_ok=True)
 temp_dir = os.path.join(temp_dir, "output%05d.wav")
 command = "ffmpeg -i {} -f segment -segment_time 60 -c copy {}".format(os.path.join(directory, wav), temp_dir)
 command = shlex.split(command)
 subprocess.run(command)
 cntr += 1





I list all .wav files, and for each file I create a directory where I store the split files into. This implies that file naming start with index 1 for each new file.
E.g. folder 1 contains files
...1.wav
to...9.wav
, folder 2 contains...1.wav
to...13.wav
and so on.

In short, I ideally want to parse the whole directory with a single command, while keeping the naming continually from file to file, e.g. when the last wav saved its last split with
...10.split
, the next split for the next file should be saved as..11.split
.

I thought about first concatenating all the single files to one file, and then splitting them again (which introduces massive overhead), and unnecessarily consumes memory and disk space. An alternative I thought of was using a *.wav wildcard, but ffmpeg found no file called
*.wav
(which is expected).

Related question : 1


-
ffmpeg split audio file into individual segments
4 novembre 2022, par MartinI have a 00:15:24 length .mp3 file that I want to split up into three separate files, ideally using a txt file input like so :


segemnts.txt


00:00:00 00:04:55 seg1
00:04:55 00:08:41 seg2
00:08:41 00:15:24 seg3



How can I do this with a single command ?


-
referenced links (url#id) broke on split chapters
21 février 2016, par Grandtreferenced links (url#id) broke on split chapters
Fixed : referenced links (url#id) broke on split chapters.
Changed : Generated TOC file changed from using hardcoded spaces to
indent nested chapters, to using the CSS, defaulting to 2em per level.
The tocCss can override this by defining .level[1-n], though the default
only defines indents for levels 1-7. Reference links has their class as
class=".level1 reference"