
Recherche avancée
Autres articles (93)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Les images
15 mai 2013 -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (6488)
-
Cloud Functions for Firebase : completing long processes without touching maximum timeout
17 février, par Scott EwingI have to transcode videos from webm to mp4 when they're uploaded to firebase storage. I have a code demo here that works, but if the uploaded video is too large, firebase functions will time out on me before the conversion is finished. I know it's possible to increase the timeout limit for the function, but that seems messy, since I can't ever confirm the process will take less time than the timeout limit.



Is there some way to stop firebase from timing out without just increasing the maximum timeout limit ?



If not, is there a way to complete time consuming processes (like video conversion) while still having each process start using firebase function triggers ?



If even completing time consuming processes using firebase functions isn't something that really exists, is there some way to speed up the conversion of fluent-ffmpeg without touching the quality that much ? (I realize this part is a lot to ask. I plan on lowering the quality if I absolutely have to, as the reason webms are being converted to mp4 is for IOS devices)



For reference, here's the main portion of the demo I mentioned. As I said before, the full code can be seen here, but this section of the code copied over is the part that creates the Promise that makes sure the transcoding finishes. The full code is only 70 something lines, so it should be relatively easy to go through if needed.



const functions = require('firebase-functions');
const mkdirp = require('mkdirp-promise');
const gcs = require('@google-cloud/storage')();
const Promise = require('bluebird');
const ffmpeg = require('fluent-ffmpeg');
const ffmpeg_static = require('ffmpeg-static');




(There's a bunch of text parsing code here, followed by this next chunk of code inside an onChange event)



function promisifyCommand (command) {
 return new Promise( (cb) => {
 command
 .on( 'end', () => { cb(null) } )
 .on( 'error', (error) => { cb(error) } )
 .run();
 })
}
return mkdirp(tempLocalDir).then(() => {
 console.log('Directory Created')
 //Download item from bucket
 const bucket = gcs.bucket(object.bucket);
 return bucket.file(filePath).download({destination: tempLocalFile}).then(() => {
 console.log('file downloaded to convert. Location:', tempLocalFile)
 cmd = ffmpeg({source:tempLocalFile})
 .setFfmpegPath(ffmpeg_static.path)
 .inputFormat(fileExtension)
 .output(tempLocalMP4File)
 cmd = promisifyCommand(cmd)
 return cmd.then(() => {
 //Getting here takes forever, because video transcoding takes forever!
 console.log('mp4 created at ', tempLocalMP4File)
 return bucket.upload(tempLocalMP4File, {
 destination: MP4FilePath
 }).then(() => {
 console.log('mp4 uploaded at', filePath);
 });
 })
 });
 });



-
ffmpeg stream freezes so often (it stays alive and working for no more than 30mins) when trying to stream with a cloud ubuntu linux instance
22 novembre 2022, par MohamedElShabI'm trying to stream on Youtube with a cloud ubuntu 22.04 instance, but it freezes after no more than 30 mins or so, the ffmpeg process keeps running in the background, and Youtube is keeping the stream up, no video, no music, it's just there loading, frozen, I kill the process and rerun it with
nohup
in the background, and it freezes again after a short amount of time, the log file fromnohup
contains only warnings of things like :
[libx264 @ 0xaaaaee6feb60] VBV is incompatible with constant QP, ignored.

which I think are not really important, but I see in the log that it exits normally :
Exiting normally, received signal 15.


I'm using this bash script to stream :


#! /bin/bash

VBR="4500k"
FPS="24"
QUAL="ultrafast"

YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
KEY="XXXX-XXXX-XXXX-XXXX-XXXX"


VIDEO_SOURCE="/home/ubuntu/video.mp4"
AUDIO_SOURCE="/home/ubuntu/audio.mp3"

ffmpeg \
 -re -f lavfi -i "movie=filename=$VIDEO_SOURCE:loop=0, setpts=N/(FRAME_RATE*TB)" \
 -thread_queue_size 512 -i "$AUDIO_SOURCE" \
 -map 0:v:0 -map 1:a:0 \
 -map_metadata:g 1:g \
 -vcodec libx264 -pix_fmt yuv420p -preset $QUAL -crf 0 -r $FPS -g $(($FPS * 2)) -b:v $VBR \
 -acodec libmp3lame -ar 44100 -threads 6 -crf 0 -b:a 320000 -bufsize 512k \
 -f flv \
 -flvflags no_duration_filesize \
 "$YOUTUBE_URL/$KEY"



I'm unexperienced in this, so if anyone knows a solution, please explain in details if possible and with commands.


-
creating a modern nodejs video rendering app (ffmpeg microservice / cloud hosting)
5 avril 2020, par MartinI'm thinking of making a nodejs website like tunestotube.com or audioship.io that will :



- 

-
accept an audio file / image file input
-
render a video using ffmpeg
-
upload that video to youtube









I just have a question on the best way to go about doing this, I want to host over GCP eventually, and am thinking about the best / most efficient way to handle the ffmpeg video rendering, since I want it to be scaleable and have a load balancer (ingress ?) queue to handle getting multiple requests at once.



Would it make sense to containerize my web service ? Have the main website be one docker image ; and have another image / microservice 'video-renderer' that would accept the inputs, render the video, and return the rendered video ?



Does this idea make sense, and would going about it in the way I describe above work ? I'm also trying to find tutorials / example projects with handling microservices / load balancers in node js / gcp if anyone has any ideas / recomendations, thanks


-