
Recherche avancée
Médias (1)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (87)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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 (14930)
-
PermissionError : [Errno 13] Permission denied : 'ffprobe' (AudioSegment)
22 juin 2022, par AYAI am trying to get
AudioSegment
working on my local computer. After resolving some issues, I am stuck on a permission error that I cannot seem to resolve. Let me detail what I have done so far (so that the error is easy to detect) :

I
pip
installed bothffprobe
andffmpeg
. But when Iimport ffprobe
, it raisedImportError: cannot import name 'FFProbe'
. Thankfully, was able to fix it following a brilliant post here. But now when I runaudio = AudioSegment.from_file(audioname)
, it raises the following error :PermissionError: [Errno 13] Permission denied: 'ffprobe'
. Based on one of the comments here, I manually adjusted the permissions using (which I think is the maximum permission granted to a folder ?) :

import os
import stat
os.chmod('/path/to/ffmpeg', stat.S_IRWXU)
os.chmod('/path/to/ffprobe', stat.S_IRWXU) 



Just to be 100% sure, I then manually adjusted the permissions for all the files in
ffmpeg
andffprobe
folders usingstat.S_IRWXU
, but to no avail (also tried chmod 755). I also confirmed if execution permission was actually granted (usingos.access(my_file, os.X_OK)
) but still get the same error. (Also changed the permission for the.mp3
file, no luck)

Additional details :


- 

- Based on a suggestion somewhere, I also added the following options right after importing
AudioSegment
:




AudioSegment.converter = "/path/to/ffmpeg"
AudioSegment.ffmpeg = "/path/to/ffmpeg"
AudioSegment.ffprobe = "/path/to/ffprobe"



- 

- There is also a runtime warning (that I don't think has anything to do with the error I get) but mentioning it here for completion :




/opt/anaconda3/lib/python3.8/site-packages/pydub/utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
 warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)



Thanks !


- Based on a suggestion somewhere, I also added the following options right after importing
-
How to convert the stream from h265 to h264
12 avril 2021, par Hrithik AnchaliyaI'm trying to create a media server using nodejs, and i have no problem streaming any formats but
Since web browsers cant play H265 codec videos i need to convert them to H264 while createReadStream creates a chunk so that i dont have to convert them completely before hand, just that chunk which is sent by the server to the browser.


const path = 'assets/yourfavmov.mkv';
const stat = fs.statSync(path);
const fileSize = stat.size;
const range = req.headers.range;
if (range) { 
const rangeArray = range.replace(/bytes=/, "").split("-"); 
console.log(rangeArray) 
const start = parseInt(rangeArray[0], 10); 
const end = rangeArray[1] ? parseInt(rangeArray[1], 10) : fileSize-1; 
const chunksize = (end-start) + 1; 
const fileChunk = fs.createReadStream(path, {start, end});
const head = {
 'Content-Range': `bytes ${start}-${end}/${fileSize}`, 
 'Accept-Ranges': 'bytes', 
 'Content-Length': chunksize, 
 'Content-Type': 'video/x-matroska' 
};
res.writeHead(206, head); 
fileChunk.pipe(res); 
} else {
 res.end("wont let you stream");
}



I tried to convert the stream using ffmpeg-stream, like so


const converter = new Converter();
const input = converter.createInputStream({
 f: "matroska,webm",
 vcodec : "hevc"
})
const fileChunk = fs.createReadStream(path, {start, end}); 
fileChunk.pipe(input);
converter
 .createOutputStream({ f: "matroska,webm", vcodec: "h264" })
 .pipe(res);



But i have no idea what i did is correct or wrong, so no luck
so is there an way to do it right ?


Thanks in advance.


-
Intercept ffmpeg stdout with Process() in Swift
3 avril 2021, par TAFKASI've to admit that I'm quite inexperienced in Swift, but nonetheless I'm trying to build an OS X app to convert a video in a particular format and size with ffmpeg using Swift.
My goal is to have the ffmpeg stdout in a separate window to show the progress to the user.
Before posting here, I've read all that exist on the internet about the subject :-) and I've not found yet a solution to my problem of not having any output whatsoever in my textView but only in the Xcode console.
I've found this post here :
Real time NSTask output to NSTextView with Swift
that seems very promising but is not working anyway. I've tried to use the command /bin/sh in the example with the provided arguments in my code and it works like a charm. Probably it's me and my inexperience, but I think that is something related to the way ffmpeg output his progress, that won't work. It seems that even removing the -v and -stat options the ffmpeg command still output to the Xcode console but not in my TextField.
I hope that someone can shed a light in my swift coding darkness.
Thanks in advance


STEFANO


UPDATE - SOLVED


I had an EUREKA moment and I've assigned the pipe to the standarderror and voilà it worked


import Cocoa

var videoLoadURL = ""

class ViewController: NSViewController {
 @IBOutlet weak var filenameLabel: NSTextField!
 @IBOutlet weak var progressText: NSTextField!
 @IBOutlet weak var progressIndicator: NSProgressIndicator!

override func viewDidLoad() {
 super.viewDidLoad()

 // Do any additional setup after loading the view.
 progressIndicator.isHidden = true
 
}

@IBAction func loadVIdeo(_ sender: NSButton) {
 
 let openPanel = NSOpenPanel()
 openPanel.allowsMultipleSelection = false
 openPanel.canChooseFiles = true
 openPanel.runModal()
 
 if let path = openPanel.url?.lastPathComponent {
 
 filenameLabel.stringValue = path
 }
 
 if let path = openPanel.url?.absoluteURL {
 
 videoLoadURL = path.absoluteString

 }

}

@IBAction func convert(_ sender: NSButton) {
 
 progressIndicator.isHidden = false
 let savePanel = NSSavePanel()
 var videoSaveURL: String = ""
 savePanel.nameFieldStringValue = "Converted_\(filenameLabel.stringValue).mp4"
 savePanel.runModal()
 
 if let path = savePanel.url?.absoluteURL {
 
 videoSaveURL = path.absoluteString
 }

 let startLaunch: CFTimeInterval = CACurrentMediaTime()
 
 progressIndicator.startAnimation(self)
 
 let task = Process()
 task.launchPath = "/usr/local/bin/ffmpeg"
 task.arguments = ["-i", "\(videoLoadURL)", "-y", "-g", "1", "-crf", "29","-b", "0", "-pix_fmt", "yuv420p", "-strict", "-2", "\(videoSaveURL)"]
 let pipe = Pipe()
 task.standardError = pipe
 let outHandle = pipe.fileHandleForReading
 outHandle.waitForDataInBackgroundAndNotify()

 var observer1: NSObjectProtocol!
 observer1 = NotificationCenter.default.addObserver(forName: NSNotification.Name.NSFileHandleDataAvailable, object: outHandle, queue: nil, using: { notification -> Void in
 let data = outHandle.availableData
 if data.count > 0 {
 
 if let str = NSString(data: data, encoding: String.Encoding.utf8.rawValue) {
 
 self.progressText.stringValue = str as String
 
 }
 
 outHandle.waitForDataInBackgroundAndNotify()
 
 } else {
 
 print("EOF on stdout from process")
 NotificationCenter.default.removeObserver(observer1)
 }
 
 })

 var observer2: NSObjectProtocol!
 observer2 = NotificationCenter.default.addObserver(forName: Process.didTerminateNotification, object: task, queue: nil, using: { notification -> Void in
 
 print("terminated")
 NotificationCenter.default.removeObserver(observer2)

 })

 do {
 
 try task.run()
 
 }catch {
 
 print("error")
 }
 
 task.waitUntilExit()
 
 let elapsedTime: CFTimeInterval = CACurrentMediaTime() - startLaunch
 NSSound.beep()
 progressIndicator.stopAnimation(self)
 progressIndicator.isHidden = true
 if task.terminationStatus == 0 {
 
 let alertOK = NSAlert()
 alertOK.messageText = "Tutto bene"
 alertOK.addButton(withTitle:"OK")
 alertOK.addButton(withTitle: "Cancel")
 alertOK.informativeText = "Conversione eseguita in \(elapsedTime) secondi"
 alertOK.runModal()
 
 } else {
 
 let alertOK = NSAlert()
 alertOK.messageText = "Errore"
 alertOK.addButton(withTitle:"OK")
 alertOK.informativeText = "La conversione è fallita"
 alertOK.runModal()
 
 }
}



}