
Recherche avancée
Médias (39)
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (111)
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin 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 (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...) -
Que fait exactement ce script ?
18 janvier 2011, parCe 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 (9265)
-
Adjusting The Timetable and SQL Shame
My Game Music Appreciation website has a big problem that many visitors quickly notice and comment upon. The problem looks like this :
The problem is that all of these songs are 2m30s in length. During the initial import process, unless a chiptune file already had curated length metadata attached, my metadata utility emitted a default play length of 150 seconds. This is not good if you want to listen to all the songs in a soundtrack without interacting with the player page, but have various short songs (think “game over” or other quick jingles) that are over in a few seconds. Such songs still pad out 150 seconds of silence.
So I needed to correct this. Possible solutions :
- Manually : At first, I figured I could ask the database which songs needed fixing and listen to them to determine the proper lengths. Then I realized that there were well over 1400 games affected by this problem. This just screams “automated solution”.
- Automatically : Ask the database which songs need fixing and then somehow ask the computer to listen to the songs and decide their proper lengths. This sounds like a winner, provided that I can figure out how to programmatically determine if a song has “finished”.
SQL Shame
This play adjustment task has been on my plate for a long time. A key factor that has blocked me is that I couldn’t figure out a single SQL query to feed to the SQLite database underlying the site which would give me all the songs I needed. To be clear, it was very simple and obvious to me how to write a program that would query the database in phases to get all the information. However, I felt that it would be impure to proceed with the task unless I could figure out one giant query to get all the information.This always seems to come up whenever I start interacting with a database in any serious way. I call it SQL shame. This task got some traction when I got over this nagging doubt and told myself that there’s nothing wrong with the multi-step query program if it solves the problem at hand.
Suddenly, I had a flash of inspiration about why the so-called NoSQL movement exists. Maybe there are a lot more people who don’t like trying to derive such long queries and are happy to allow other languages to pick up the slack.
Estimating Lengths
Anyway, my solution involved writing a Python script to iterate through all the games whose metadata was output by a certain engine (the one that makes the default play length 150 seconds). For each of those games, the script queries the song table and determines if each song is exactly 150 seconds. If it is, then go to work trying to estimate the true length.The forgoing paragraph describes what I figured was possible with only a single (possibly large) SQL query.
For each song represented in the chiptune file, I ran it through a custom length estimator program. My brilliant (err, naïve) solution to the length estimation problem was to synthesize seconds of audio up to a maximum of 120 seconds (tightening up the default length just a bit) and counting how many of those seconds had all 0 samples. If the count reached 5 consecutive seconds of silence, then the estimator rewound the running length by 5 seconds and declared that to be the proper length. Update the database.
There were about 1430 chiptune files whose songs needed updates. Some files had 1 single song. Some files had over 100. When I let the script run, it took nearly 65 minutes to process all the files. That was a single-threaded solution, of course. Even though I already had the data I needed, I wanted to try to hand at parallelizing the script. So I went to work with Python’s multiprocessing module and quickly refactored it to use all 4 CPU threads on the machine where the files live. Results :
- Single-threaded solution : 64m42s to process corpus (22 games/minute)
- Multi-threaded solution : 18m48s with 4 CPU threads (75 games/minute)
More than a 3x speedup across 4 CPU threads, which is decent for a primarily CPU-bound operation.
Epilogue
I suspect that this task will require some refinement or manual intervention. Maybe there are songs which actually have more than 5 legitimate seconds of silence. Also, I entertained the possibility that some songs would generate very low amplitude noise rather than being perfectly silent. In that case, I could refine the script to stipulate that amplitudes below a certain threshold count as 0. Fortunately, I marked which games were modified by this method, so I can run a new script as necessary.SQL Schema
Here is the schema of my SQlite3 database, for those who want to try their hand at a proper query. I am confident that it’s possible ; I just didn’t have the patience to work it out. The task is to retrieve all the rows from the games table where all of the corresponding songs in the songs table is 150000 milliseconds.
-
CREATE TABLE games
-
(
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
-
uncompressed_sha1 TEXT,
-
uncompressed_size INTEGER,
-
compressed_sha1 TEXT,
-
compressed_size INTEGER,
-
system TEXT,
-
game TEXT,
-
gme_system TEXT default NULL,
-
canonical_url TEXT default NULL,
-
extension TEXT default "gamemusicxz",
-
enabled INTEGER default 1,
-
redirect_to_id INT DEFAULT -1,
-
play_lengths_modified INT DEFAULT NULL) ;
-
CREATE TABLE songs
-
(
-
game_id INTEGER,
-
song_number INTEGER NOT NULL,
-
song TEXT,
-
author TEXT,
-
copyright TEXT,
-
dumper TEXT,
-
length INTEGER,
-
intro_length INTEGER,
-
loop_length INTEGER,
-
play_length INTEGER,
-
play_order INTEGER default -1) ;
-
CREATE TABLE tags
-
(
-
game_id INTEGER,
-
tag TEXT NOT NULL,
-
tag_type TEXT default "filename") ;
-
CREATE INDEX gameid_index_songs ON songs(game_id) ;
-
CREATE INDEX gameid_index_tag ON tags(game_id) ;
-
CREATE UNIQUE INDEX sha1_index ON games(uncompressed_sha1) ;
-
Best way to encode a jpg/png file ? [on hold]
29 juin 2013, par ShirohigeAssuming that I use a command like this :
ffmpeg -i song.mp3 -loop 1 -i cover.jpg -r 1 -t 180 -acodec copy output.mp4
I used an audio file with variable bitrate and everything took about 5 minutes for ffmpeg to encode it while with Camtasia Studio 8 it took 1 minute. In Camtasia I specified the following settings (using the mp4 container) : http://img197.imageshack.us/img197/1222/psrs.png
and since Camtasia doesn't allow to put the audio directly into the container Camtasia converted the audio into an constant bitrate mp3. All together it took 1 minute for the encoding job (audio and video encoding) to be done but the result was a 3 times larger file (compared to the ffmpeg encode) with a visible quality deformation of the picture (again compared to the ffmpeg encode).I would like to know (since I just use one picture throughout the whole video), is there a way to encode it faster with ffmpeg (sacrificing a bit of the quality of the picture) ? I want to upload my videos to Youtube and as far as I know, Google's servers will encode every video anyway and that's why I don't encode the audio file but just put it into the mp4 container.
EDIT :
I am sorry, I will delete it when I am allowed to do so (it says after 2 days).
EDIT 2 :
ffmpeg log file : https://dl.dropboxusercontent.com/u/63836714/ffmpeg-20130628-234613.log
-
After a while of being idle, my bot, hosted on CentOS 7, can no longer find ffmpeg and requires a restart
14 août 2019, par Liam McMillen-MeyersSo I have a discord bot running with discord.js on a CentOS 7 machine. After a while (I’m not exactly sure how long) it will start throwing errors when I try to play a song, saying it can’t find ffmpeg, except that ffmpeg is installed. After I quickly restart the bot it works fine again.
I genuinely have no idea what causes this, I have a little experience with CentOS but I’m by no means an experienced user, is it something I did when it installed ? I have tried searching for answers online but I can’t find anything
Error : FFMPEG not found
at Function.selectFfmpegCommand (/user/DiscordBot/folder1/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:46:13)
at new FfmpegTranscoder (/user/DiscordBot/folder1/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:7:37)
at new MediaTranscoder (/user/DiscordBot/folder1/node_modules/prism-media/src/transcoders/MediaTranscoder.js:10:19)
at new Prism (/user/DiscordBot/folder1/node_modules/prism-media/src/Prism.js:5:23)
at new VoiceConnection (/user/DiscordBot/folder1/node_modules/discord.js/src/client/voice/VoiceConnection.js:46:18)
at Promise (/user/DiscordBot/folder1/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:63:22)
at new Promise ()
at ClientVoiceManager.joinChannel (/user/DiscordBot/folder1/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:45:12)
at VoiceChannel.join (/user/DiscordBot/folder1/node_modules/discord.js/src/structures/VoiceChannel.js:130:30)
at execute (/user/DiscordBot/folder1/bot.js:467:40)