
Recherche avancée
Médias (91)
-
Chuck D with Fine Arts Militia - No Meaning No
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Paul Westerberg - Looking Up in Heaven
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Le Tigre - Fake French
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Thievery Corporation - DC 3000
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Dan the Automator - Relaxation Spa Treatment
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Gilberto Gil - Oslodum
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (18)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...) -
MediaSPIP Player : problèmes potentiels
22 février 2011, parLe lecteur ne fonctionne pas sur Internet Explorer
Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)
Sur d’autres sites (4725)
-
Elegant early exit from a spawned ffmpeg process in C
21 octobre 2016, par jackson80I have a program where I build an ffmpeg command string to capture videos with options input through a gtk3 gui. Once I have all my options selected, I spawn a process with the ffmpeg command string. And I add a child watch to tell me when the process has completed.
// Spawn child process
ret = g_spawn_async (NULL, argin, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid1, NULL);
if ( !ret )
{
g_error ("SPAWN FAILED");
return;
}
/* Add watch function to catch termination of the process. This function
* will clean any remnants of process */
g_child_watch_add (pid1, (GChildWatchFunc)cb_child_watch, widget );Executing ffmpeg from a terminal using a command line, the program will give an option to input a "q" at the terminal to end the ffmpeg process early.
Is there any way to send a "q" to that spawned process to elegantly end the ffmpeg ? I’m fairly sure I could kill the process using the process id, but I would rather stop it using a mechanism that allows ffmpeg to gracefully exit..
This is running Centos 7, kernel 4.7.5, ffmpeg version 3.0.2.
Since I can still access the terminal where the ffmpeg output is displayed, I’ve tried typing a "q", but it has no effect on the process. -
AttributeError : 'FFmpegAudio' object has no attribute '_process' while trying to play audio from URL
13 août 2022, par jmcamacho7I can't find any solution online and I don't know what's wrong.


My code is : (Not pasting the URL getting since that works fine)


from urllib import parse, request
import re
import pafy
from discord import FFmpegPCMAudio, PCMVolumeTransformer

FFMPEG_OPTIONS = {
 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'
}

@bot.command(pass_context=True)
async def play(ctx, * , search):
 query_string = parse.urlencode({'search_query': search})
 html_content = request.urlopen('http://www.youtube.com/results?' + query_string)
 search_results=re.findall('watch\?v=(.{11})',html_content.read().decode('utf-8'))
 print(search_results[0])
 
 if(ctx.author.voice):
 channel = ctx.message.author.voice.channel
 await ctx.send("https://www.youtube.com/watch?v="+search_results[0]) 
 url = "https://www.youtube.com/watch?v="+search_results[0]
 conn = await channel.connect()
 conn.play(discord.FFmpegAudio(url, **FFMPEG_OPTIONS))
 else:
 await ctx.send("Necesitas estar en un canal de audio para usar este comando")



It just gives me this error everytime I try it :


Traceback (most recent call last):
 File "/home/runner/HakuBot/venv/lib/python3.8/site-packages/discord/player.py", line 103, in __del__
 self.cleanup()
 File "/home/runner/HakuBot/venv/lib/python3.8/site-packages/discord/player.py", line 154, in cleanup
 proc = self._process
AttributeError: 'FFmpegAudio' object has no attribute '_process'



Anyway to solve this ?


-
AWS Lambda in Node JS with FFMPEG Lambda Layer
29 mars 2023, par mwcwge23I'm trying to make a Lambda that takes a video and puts a watermark image on it.
I'm using Lambda with NodeJS and FFMPEG Lambda Layer I took from here :
https://serverlessrepo.aws.amazon.com/applications/us-east-1/145266761615/ffmpeg-lambda-layer


I got these two errors and I don't have a clue what do I did wrong :
errors


Please help me :)


(by the way, if you have an easier solution to put a watermark image on video that'll also be great)


That's my code (trying to put a watermark image on a video file) :


const express = require("express");
const childProcess = require("child_process");
const path = require("path");
const fs = require("fs");
const util = require("util");
const os = require("os");
const { fileURLToPath } = require("url");
const { v4: uuidv4 } = require("uuid");
const bodyParser = require("body-parser");
const awsServerlessExpressMiddleware = require("aws-serverless-express/middleware");
const AWS = require("aws-sdk");
const workdir = os.tmpdir();

const s3 = new AWS.S3();

// declare a new express app
const app = express();
app.use(bodyParser.json());
app.use(awsServerlessExpressMiddleware.eventContext());

// Enable CORS for all methods
app.use(function (req, res, next) {
 res.header("Access-Control-Allow-Origin", "*");
 res.header("Access-Control-Allow-Headers", "*");
 next();
});

const downloadFileFromS3 = function (bucket, fileKey, filePath) {
 "use strict";
 console.log("downloading", bucket, fileKey, filePath);
 return new Promise(function (resolve, reject) {
 const file = fs.createWriteStream(filePath),
 stream = s3
 .getObject({
 Bucket: bucket,
 Key: fileKey,
 })
 .createReadStream();
 stream.on("error", reject);
 file.on("error", reject);
 file.on("finish", function () {
 console.log("downloaded", bucket, fileKey);
 resolve(filePath);
 });
 stream.pipe(file);
 });
};

const uploadFileToS3 = function (bucket, fileKey, filePath, contentType) {
 "use strict";
 console.log("uploading", bucket, fileKey, filePath);
 return s3
 .upload({
 Bucket: bucket,
 Key: fileKey,
 Body: fs.createReadStream(filePath),
 ACL: "private",
 ContentType: contentType,
 })
 .promise();
};

const spawnPromise = function (command, argsarray, envOptions) {
 return new Promise((resolve, reject) => {
 console.log("executing", command, argsarray.join(" "));
 const childProc = childProcess.spawn(
 command,
 argsarray,
 envOptions || { env: process.env, cwd: process.cwd() }
 ),
 resultBuffers = [];
 childProc.stdout.on("data", (buffer) => {
 console.log(buffer.toString());
 resultBuffers.push(buffer);
 });
 childProc.stderr.on("data", (buffer) => console.error(buffer.toString()));
 childProc.on("exit", (code, signal) => {
 console.log(`${command} completed with ${code}:${signal}`);
 if (code || signal) {
 reject(`${command} failed with ${code || signal}`);
 } else {
 resolve(Buffer.concat(resultBuffers).toString().trim());
 }
 });
 });
};

app.post("/api/addWatermark", async (req, res) => {
 try {
 const bucketName = "bucketName ";
 const uniqeName = uuidv4() + Date.now();
 const outputPath = path.join(workdir, uniqeName + ".mp4");
 const key = "file_example_MP4_480_1_5MG.mp4";
 const localFilePath = path.join(workdir, key);
 const watermarkPngKey = "watermark.png";
 const watermarkLocalFilePath = path.join(workdir, watermarkPngKey);

 downloadFileFromS3(bucketName, key, localFilePath)
 .then(() => {
 downloadFileFromS3(bucketName, watermarkPngKey, watermarkLocalFilePath)
 .then(() => {
 fs.readFile(localFilePath, (err, data) => {
 if (!err && data) {
 console.log("successsss111");
 }
 });
 fs.readFile(watermarkLocalFilePath, (err, data) => {
 if (!err && data) {
 console.log("successsss222");
 }
 });

 fs.readFile(outputPath, (err, data) => {
 if (!err && data) {
 console.log("successsss3333");
 }
 });

 spawnPromise(
 "/opt/bin/ffmpeg",
 [
 "-i",
 localFilePath,
 "-i",
 watermarkLocalFilePath,
 "-filter_complex",
 `[1]format=rgba,colorchannelmixer=aa=0.5[logo];[0][logo]overlay=5:H-h-5:format=auto,format=yuv420p`,
 "-c:a",
 "copy",
 outputPath,
 ],
 { env: process.env, cwd: workdir }
 )
 .then(() => {
 uploadFileToS3(
 bucketName,
 uniqeName + ".mp4",
 outputPath,
 "mp4"
 );
 });
 });
 });
 } catch (err) {
 console.log({ err });
 res.json({ err });
 }
});

app.listen(8136, function () {
 console.log("App started");
});

module.exports = app;