
Recherche avancée
Autres articles (58)
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...) -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)
Sur d’autres sites (4791)
-
Unable to access user selected file via NSOpenPanel in FFMPEG process in macOS app
12 décembre 2019, par RaptorI am new to macOS development via SwiftUI. I’m trying to run a FFMPEG process after I selected a MP4 file via
NSOpenPanel
. However, theFFMPEG
responded with :file :///Users/MyUsername/Documents/Video.mp4 : No such file or directory
Here is my simple codes :
import SwiftUI
struct ContentView: View {
@State var selectedURL: URL?
var body: some View {
VStack {
if selectedURL != nil {
Text("Selected: \(selectedURL!.absoluteString)")
} else {
Text("Nothing selected")
}
Button(action: {
let panel = NSOpenPanel()
panel.allowedFileTypes = ["mp4"]
panel.canChooseDirectories = false
panel.canCreateDirectories = false
panel.allowsMultipleSelection = false
let result = panel.runModal()
if result == .OK {
self.selectedURL = panel.url
let savePath = self.getDownloadDirectory().appendingPathComponent("video.webm")
self.convertVideo(inputFilePath: self.selectedURL!.absoluteString, outputFilePath: savePath.absoluteString, callback: {(s) in
// omit the callback at this moment
})
}
}) {
Text("Select File")
}
}
.frame(width: 640, height: 480)
}
func getDownloadDirectory() -> URL {
let paths = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask)
return paths[0]
}
func convertVideo(inputFilePath: String, outputFilePath: String,
callback: @escaping (Bool) -> Void) -> (Process, DispatchWorkItem)? {
guard let launchPath = Bundle.main.path(forResource: "ffmpeg", ofType: "") else {
return nil
}
let process = Process()
let task = DispatchWorkItem {
process.launchPath = launchPath
process.arguments = [
"-y",
"-i", inputFilePath,
"-vcodec", "vp8",
"-acodec", "libvorbis",
"-pix_fmt", "yuva420p",
"-metadata:s:v:0",
"alpha_mode=\"1\"",
"-auto-alt-ref", "0",
outputFilePath
]
process.standardInput = FileHandle.nullDevice
process.launch()
process.terminationHandler = { process in
callback(process.terminationStatus == 0)
}
}
DispatchQueue.global(qos: .userInitiated).async(execute: task)
return (process, task)
}
}What did I miss to allow FFMPEG process to access my selected file ? Thanks !
-
Upload ffmpeg file output to AWS s3 using NodeJS
29 janvier 2020, par DurraniThe
ffmpeg.output("path/file.mp4")
need astring
path as an argument to write the output file to it. But s3bucket.upload(parms, ...)
need a Binary File as a value to theBody:
in parms JSONProblem : Unable to provide file data using the file path to s3 bucket in NodeJS Environment
FFmpeg()
.input("source.mp4") //video
.setStartTime(startTime)
.setDuration(duration)
.output(output) //output file path: string
.on("end", function() {
console.log("Processing finished successfully");
var params = {
Bucket: process.env.S3_BUCKET,
Key: "videos/filename.mp4",
Body: output //binary file data to be provided not file path
};
const bucket = new S3({
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
region: process.env.S3_REGION
});
bucket.upload(params, function(err, data) {
console.log(err, data);
});
})
.run(); -
How do I stop ffmpeg from spamming itself when I auto restart ?
15 décembre 2019, par billy61300const fs = require("fs");
const express = require("express");
const app = express();
const path = require("path");
const ffmpeg = require("fluent-ffmpeg");
const md5 = require("md5");
const readline = require("readline");
const formidable = require("formidable");
const dir = "Custom/Dir";
const thumb = __dirname + "/thumb";
const ph = __dirname + "/placeholder";
app.use("/serve", express.static(dir));
app.use("/thumb", express.static(thumb));
app.use("/ph", express.static(ph));
const list = [];
const listThumb = [];
process.on("uncaughtException", (err) => {
console.log("Caught Exception: " + err);
});
let passwords = fs.readFileSync("passwords.txt").toString().split("\n");
app.get("/", (req, res) => {
res.sendFile(__dirname + "/index.html")
});
app.get("/upload", (req, res) => {
res.sendFile(__dirname + "/upload.html");
});
app.post("/uploadFile", (req, res) => {
let form = new formidable.IncomingForm();
form.parse(req, (err, fields, files) => {
if (passwords.includes(md5(fields.password))) {
fs.readFile(files.filetoupload.path, (err, data) => {
let newPath = dir + "/" + files.filetoupload.name;
if (!fs.existsSync(newPath)) {
fs.writeFile(newPath, data, (err) => {
res.writeHead(200, {"Content-Type": "text/html"});
res.write("<h1>File Uploaded</h1>");
res.end();
});
} else {
res.writeHead(200, {"Content-Type": "text/html"});
res.write("<h1>File already exists. Upload with a different name please.</h1>");
res.end();
}
});
}
});
});
fs.readdir(dir, (err, files) => {
if (err) {
throw err;
} else {
let i = 0;
files.forEach((file) => {
list[i] = path.basename(file);
if (!fs.existsSync(__dirname + "\\thumb\\" + list[i] + ".png")) {
console.log("Generating: " + list[i] + ".png");
let proc = new ffmpeg({source: dir + "/" + file, nolog: true});
proc.setFfmpegPath(__dirname + "\\ffmpeg.exe");
proc.screenshots({
timestamps: [0.0],
filename: list[i] + ".png",
folder: __dirname + "\\thumb\\",
size: "100x100"
});
}
i++;
});
let serveDoc = "";
for (let j = 0; j < list.length; j++) {
if (path.extname(list[j]).toLowerCase() !== ".jpg" && path.extname(list[j]).toLowerCase() !== ".jpeg" && path.extname(list[j]).toLowerCase() !== ".png") {
if (path.extname(list[j]).toLowerCase() == ".mp3" || path.extname(list[j]).toLowerCase() == ".wav") {
serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address" + list[j] + "">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address" />" + "</a> ";;
}/* else if (path.extname(list[j]).toLowerCase() == ".webm") {
serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address" + list[j] + "">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address" />" + "</a> ";;
}*/ else {
serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address" + list[j] + "">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address" + list[j] + ".png" />" + "</a> ";
}
} else {
serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address" + list[j] + "">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address" + list[j] + "" />" + "</a> ";
}
}
serveDoc += "";
fs.writeFile("index.html", serveDoc, (err) => {
if (err) throw err;
});
}
});
setTimeout(() => {
process.exit(0);
}, 1000 * 60 * 30);
app.listen(80, (err) => {
if (err) {
throw err;
} else {
console.log("Listening on port 80.");
}
});Issue is that the program needs to be restarted every X minutes so that the list of media will update on it’s own. However, upon a restart, ffmpeg goes crazy and starts to spam a batch window under it’s name repeatedly over and over again without stopping. The only way out of it is to restart my computer.
I’ve tried to use PM2, Forever, Supervisor. Nodemon afaik won’t auto restart.