
Recherche avancée
Autres articles (39)
-
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 (...)
-
MediaSPIP Init et Diogène : types de publications de MediaSPIP
11 novembre 2010, parÀ l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (7382)
-
Google Speech API "Sample rate in request does not match FLAC header"
13 février 2017, par kjdion84I’m trying to convert an mp4 video clip into a FLAC audio file and then have google speech spit out the words from the video so that I can detect if specific words were said.
I have everything working except that I am getting an error from the Speech API :
{
"error": {
"code": 400,
"message": "Sample rate in request does not match FLAC header.",
"status": "INVALID_ARGUMENT"
}
}I am using FFMPEG in order to convert the mp4 into a FLAC file. I am specifying that the FLAC file be 16 bits in the command, but when I right click on the FLAC file Windows is telling me it is 302kbps.
Here is my PHP code :
// convert mp4 video to 16 bit flac audio file
$cmd = 'C:/wamp/www/ffmpeg/bin/ffmpeg.exe -i C:/wamp/www/test.mp4 -c:a flac -sample_fmt s16 C:/wamp/www/test.flac';
exec($cmd, $output);
// convert flac to text so we can detect if certain words were said
$data = array(
"config" => array(
"encoding" => "FLAC",
"sampleRate" => 16000,
"languageCode" => "en-US"
),
"audio" => array(
"content" => base64_encode(file_get_contents("test.flac")),
)
);
$json_data = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://speech.googleapis.com/v1beta1/speech:syncrecognize?key=MY_API_KEY');
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch); -
ffprobe/ffmpeg exec doesn't return result on local machine, but works on production system
27 juillet 2015, par KinesiasI want to get the duration of a movie, using ffprobe (part of ffmpeg).
The command line I’m using is this :ffprobe -v error -show_entries format=duration -of
default=noprint_wrappers=1:nokey=1
path/to/video.movIt works perfectly in the shell, gives me a result of 4.5554 (seconds).
However, if I call this command via exec on my local machine, I get an empty result.
var_dump( exec("ffprobe -v .......") );
returns string(0) ""Now comes the burner : It works perfectly on the production machine, though !!
These are my configurations :
Local machine: Mac OS 10.9.5, PHP 5.6.11 ffmpeg 2.7.1
Production machine: Mac OS Server 10.6 PHP 5.3.1 ffmpeg 2.7.2Is this kind of a bug in PHP 5.6 or something ???
Thanks, Matt -
Windows python can't pass system variables [duplicate]
14 mai 2016, par Soner BThis question already has an answer here :
I can cut video ffmpeg command prompt like this :
ffmpeg -ss 00:41:12.200 -i "the_video.mp4" -t 00:00:03.100 -c:v
libx264 -preset slow -profile:v high -crf 21 "the_video_cut.mp4" -yffmpeg.exe is in C :\Windows\System32
But I try with python.
import subprocess as sp
CRF_VALUE = '21'
PROFILE = 'high'
PRESET = 'slow'
cmd = ['ffmpeg', '-ss', '%s'%start_time, '-i', '"%s"'%inputFile, '-t', '%s'%diffTime, '-c:v', 'libx264', '-preset', PRESET, '-profile:v', PROFILE, '-crf', CRF_VALUE, '"%s_cut.%s"'%('_'.join(file_strip[:-1]),file_strip[-1]), '-y']
sp.call(' '.join(cmd))Error message :
Traceback (most recent call last):
File "test.py", line 81, in <module>
main(sys.argv[1:])
File "test.py", line 76, in main
isle(inputFile, start_time, diffTime)
File "test.py", line 48, in isle
sp.call(' '.join(cmd))
File "C:\Program Files (x86)\Python35-32\lib\subprocess.py", line 560, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Program Files (x86)\Python35-32\lib\subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "C:\Program Files (x86)\Python35-32\lib\subprocess.py", line 1220, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Sistem belirtilen dosyayı bulamıyor
</module>with try
sp.call(' '.join(cmd), shell=True)
This error message :
’ffmpeg’ is not recognized as an internal or external command,
operable program or batch file.If i copy ffmpeg.exe in the same folder test.py, it’s okey, working.