
Recherche avancée
Médias (16)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (105)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (9631)
-
Revision 3130 : La page d’inscription ne doit être visible que si elle est autorisée dans ...
24 mars 2010, par kent1 — LogLa page d’inscription ne doit être visible que si elle est autorisée dans la configuration de SPIP
-
Revision 3273 : On utilise notation et on définit un critère _dist pour notation plutot
18 avril 2010, par kent1 — LogOn utilise notation et on définit un critère _dist pour notation plutot
-
ffmpeg not reading string correctly in Swift MacOS app
21 octobre 2019, par NCrusherI’m so close to having a working app that does a simple audio conversion calling ffmpeg but I’m stuck on what appears to be the silliest error.
in the Console, ffmpeg prints the following error when I try to run the conversion :
"Unrecognized option ’c copy’. Error splitting the argument list :
Option not found"Which is strange because that’s not the argument I’m giving it. My method for producing the string it’s getting its argument from is as follows :
func conversionSelection() {
if inputFileUrl != nil {
let conversionChoice = conversionOptionsPopup.indexOfSelectedItem
switch conversionChoice {
case 1 :
outputExtension = ".mp3"
ffmpegFilters = "-c:a libmp3lame -ac 1 -ar 22050 -q:a 9"
case 2 :
outputExtension = ".mp3"
ffmpegFilters = "-c:a libmp3lame -ac 2 -ar 44100 -q:a 5"
case 3 :
outputExtension = ".mp3"
ffmpegFilters = "-c:a libmp3lame -ac 1 -ar 22050 -b:a 32k"
case 4:
outputExtension = ".flac"
ffmpegFilters = "-c:a flac"
default :
outputExtension = ".m4b"
ffmpegFilters = "-c copy"
}
}
}Then the code I use to launch ffmpeg is as follows :
func ffmpegConvert(inputPath: String, filters: String, outputPath: String) {
guard let launchPath = Bundle.main.path(forResource: "ffmpeg", ofType: "") else { return }
do {
let compressTask: Process = Process()
compressTask.launchPath = launchPath
compressTask.arguments = [
"-y",
"-i", inputPath,
filters,
outputPath
]
compressTask.standardInput = FileHandle.nullDevice
compressTask.launch()
compressTask.waitUntilExit()
}
}Which I call when my "Start Conversion" button is clicked :
@IBAction func startConversionClicked(_ sender: Any) {
ffmpegConvert(inputPath: inputFilePath, filters: ffmpegFilters, outputPath: outputFilePath)
}(
inputFilePath
andoutputFilePath
are strings obviously generated by other methods which appear to be working fine.)So it appears the only obstacle to my having a working app here is that for some reason, I’m losing that hyphen at the start of the
ffmpegFilters
string.How is that happening and what do I need to do to fix it ?
EDIT : Having tried the basic script I’m trying to create in XCode from the Terminal, I realized I’d forgotten to take into account the fact that paths with spaces in them need to have the spaces converted to "\ ". So that may actually be the cause and the error is misleading ? Which is strange because ffmpeg gives me the exact error in Terminal so maybe not ?
FURTHER EDIT : Upon further experimentation, I discovered it would recognize the hyphen at the beginning of the argument string as long as I used two hyphens—which I should have realized sooner because duh, mathematical operator, just like && and ==.
But it’s still telling me
Unrecognized option '-c copy'
which really makes no sense, because "-c copy" is definitely a valid ffmpeg argument.I tried converting the file paths with the .addingPercentEncoding option, and it was still giving me the error about the argument rather than saying the file/directory being invalid, so either XCode was already passing a perfectly formatted file path string to ffmpeg, or ffmpeg is too busy complaining about the invalid argument to get around to telling me I have an invalid path.
AND A STILL FURTHER EDIT : I’m still battering my head against this issue, because I’m convinced it’s going to be something stupid and minor. I’m just throwing things at the wall and seeing what sticks.
I put a whitespace at the beginning of the arguments string inside my quotes for the filters argument (so it reads
" -c copy"
instead of"-c copy"
) and that seemed to make a little headway. It actually read the metadata of my input file before telling me :Unable to find a suitable output format for ’ -c copy’
-c copy : Invalid argumentWhich suggests to me that the issue is that the method for stringing together all the strings might not be either putting (or not putting ?) whitespace between the adjacent strings where appropriate ?
Because of course a whitespace needs to go between the inputFilePath string and the
ffmpegFilters
string. A whitespace also needs to go between theffmpegFilters
string and theoutputFilePath
string, but NOT between the individual components comprising the output string.If that’s the issue, it’s actually going to a little tough to troubleshoot at my current level of understanding, because the output path is composed of different components derived from different methods.
This is the method I use to pull it all together, which yields a string that gets displayed in a text field, and also provides the
outputFilePath
I use in theffmpegConvert
process.func updateOutputText(outputString: String, outputField: NSTextField) {
if inputFileUrl != nil && outputDirectoryUrl == nil {
// derive output path and filename from input and tack on a new extension if a different output format is chosen
let outputFileUrl = inputFileUrl!.deletingPathExtension()
let outputPath = outputFileUrl.path
outputFilePath = outputPath + "\(outputExtension)"
} else if inputFileUrl != nil && outputDirectoryUrl != nil {
// derive output directory from outputBrowseButton action, derive filename from input file, and derive output extension from conversion format selection
let outputFile = inputFileUrl!.deletingPathExtension()
let outputFilename = outputFile.lastPathComponent
let outputDirectory = outputDirectoryPath
outputFilePath = outputDirectory + "/" + outputFilename + "\(outputExtension)"
}
outputTextDisplay.stringValue = outputFilePath
}From the error ffmpeg kicked back this time, either there’s NOT a space between the
ffmpegFilters
string and theoutputFilePath
string, or there IS an unwanted space between theoutputFilename
and"\(outputExtension)"
components of theoutputFilePath
string.And it’s such a strangely put together string that I’m not sure what to do if that’s the case.