
Recherche avancée
Médias (1)
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (107)
-
Formulaire personnalisable
21 juin 2013, parCette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire. (...) -
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 (...) -
Qu’est ce qu’un masque de formulaire
13 juin 2013, parUn masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
Chaque formulaire de publication d’objet peut donc être personnalisé.
Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)
Sur d’autres sites (12154)
-
Formatting ffmpeg arguments correctly in Swift
22 octobre 2019, par NCrusherI deleted my previous post about this because I’ve gone through a lot more trial and error on it and I needed to be sure I was giving current and relevant information.
I’m trying to create a very simple audio conversion app for MacOS using ffmpeg. Because it’s geared at audiobooks, the audio options are pretty basic.
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"]
}
}
}I don’t want to inundate this post with code, but I’m not sure what all is necessary here for people to help me troubleshoot this problem. This is the code that allows me to get my input and output paths set up :
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 conversion 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 format from conversionSelection
let outputFile = inputFileUrl!.deletingPathExtension()
let outputFilename = outputFile.lastPathComponent
let outputDirectory = outputDirectoryUrl!.path
outputFilePath = outputDirectory + "/" + outputFilename + "\(outputExtension)"
}
outputTextDisplay.stringValue = outputFilePath
}
// update input and output text fields
func updateInputText(inputString: String, inputField: NSTextField) {
conversionSelection()
inputTextDisplay.stringValue = inputFilePath
}Everything on the Swift side appears to be working. The input and output Browse buttons work fine. The input and output file paths are written to text fields exactly as they should be. When I select a different conversion option, it updates the file extension for my output file.
Here are my methods for actually launching ffmpeg :
func ffmpegConvert(inputPath: String, filters: String, outputPath: String) {
guard let launchPath = Bundle.main.path(forResource: "ffmpeg", ofType: "") else { return }
do {
let convertTask: Process = Process()
convertTask.launchPath = launchPath
convertTask.arguments = [
"-i", inputPath,
filters,
outputPath
]
convertTask.standardInput = FileHandle.nullDevice
convertTask.launch()
convertTask.waitUntilExit()
}
}
@IBAction func startConversionClicked(_ sender: Any) {
ffmpegConvert(inputPath: inputFilePath, filters: ffmpegFilters.joined(), outputPath: "outputFilePath")
}The errors are coming from ffmpeg. But I’m fairly certain the PROBLEM is that I haven’t figured out how to write them so that Swift will pass them on to ffmpeg properly.
If I use the argument arrays exactly as they are formatted above, these are my results :
When I choose the default option (
.m4b, "-c copy"
) I get this error :Unrecognized option ’c copy’. Error splitting the argument list :
Option not foundIf I choose any of the other options (mp3 or flac), I get both a warning that reads
Trailing options were found on the commandline.
Then it will actually read in the metadata of my input file (so I know my input path works at least) and then it will tell me :
At least one output file must be specified
So while it’s reading my input file correctly, perhaps it’s not reading my output file path ?
Moving on.
I then put double hyphens in the argument strings, thinking that perhaps the reason ffmpeg was reading "-c copy" as "c copy" is because the hyphen is a mathematical operator. My results are as follows :
(Still doesn’t read metadata)
Unrecognized option ’-c copy’.
Error splitting the argument list : Option not found(choosing .mp3 output options)
(doesn’t read metadata this time)
Unrecognized option ’-c:a libmp3lame—ac 1—ar 22050—q:a 9’.
Error splitting the argument list : Option not found(choosing .flac output option)
(doesn’t read metadata this time)
Unrecognized option ’-c:a flac’.
Error splitting the argument list : Option not foundSo. No help there. Time for a different approach.
This time, I added a whitespace in front of my arguments. Results :
(reads metadata)
[NULL @ 0x106800000] Unable to find a suitable output format for ’ -c copy’
-c copy : Invalid argument(reads metadata)
[NULL @ 0x10b004400] Unable to find a suitable output format for ’ -c:a libmp3lame -ac 1 -ar 22050 -q:a 9’
-c:a libmp3lame -ac 1 -ar 22050 -q:a 9 : Invalid argument(reads metadata)
NULL @ 0x10580c400] Unable to find a suitable output format for ’ -c:a flac’
-c:a flac : Invalid argumentSo, again, I have fairly decent confirmation that it’s reading my input file correctly, but possibly not my output file. Which might make sense in that the process of stringing together my output filepath is a lot more complex than the process for my input file, but I have visual confirmation that my output file path is accurate displayed in my
outputTextDisplay
box, which displays theoutputFilePath
perfectly.I really have no idea what isn’t working here. I’m sorry for the long post, but I’m not able to narrow the pertinent information down any further.
-
Révision 18368 : Révision du code HTML produit par le filtre agenda_memo (et son utilisation impl...
22 août 2011, par esj@rezo.netremplacement de "cellpadding" par la propriété CSS "padding" * remplacement de "cellspacing=0" par la propriété CSS "border-collapse : collapse * remplacement de la plupart des tables par des Div positionnéés, afin d’évacuer certaines tables imbriquées * mise en Ajax du triple mini-agenda aparaissant au (...)
-
Révision 18369 : Report de r18368 : Révision du code HTML produit par le filtre agenda_memo (et so...
22 août 2011, par esj@rezo.netremplacement de "cellpadding" par la propriété CSS "padding" * remplacement de "cellspacing=0" par la propriété CSS "border-collapse : collapse * remplacement de la plupart des tables par des Div positionnéés, afin d’évacuer certaines tables imbriquées * mise en Ajax du triple mini-agenda aparaissant au (...)