
Recherche avancée
Médias (21)
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (96)
-
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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (12436)
-
How to add a watermark to video on firebase storage using ffmpeg
31 décembre 2020, par awabsI am trying to add a watermark to a video using firebase functions and ffmpeg, but I do know the right code for it. I know is that ffmpen is now available in google cloud env so this approach should work.
Any help is appreciated.


const functions = require('firebase-functions');
const { Storage } = require('@google-cloud/storage');
const projectId = 'video-demo-a57fa';
let gcs = new Storage ({
 projectId
});
const os =require('os');
const path =require('path');
const spawn = require('child-process-promise').spawn;


exports.addLogo = functions.storage.object().onFinalize(event =>{
 
 const bucket =event.bucket;
 const contentType =event.contentType;
 const filePath =event.name;
 console.log(path.dirname(filePath));

 console.log('File change detected, function execution started');


 if (path.basename(filePath).startsWith('resized-')) {
 console.log('We already renamed that file!');
 return;
 }

 const destBucket = gcs.bucket(bucket);
 const tmpFilePath = path.join(os.tmpdir(), path.basename(filePath));
 const metadata = { contentType: contentType };
 return destBucket.file(filePath).download({
 destination: tmpFilePath
 }).then(()=>{
 return spawn('ffmpeg',['-i', 'video.mp4'], tmpFilePath )
 }).then(() => {
 console.log(tmpFilePath);
 return destBucket.upload(tmpFilePath, {
 destination: path.dirname(filePath)+'/resized-' + path.basename(filePath),
 metadata: metadata
 
 })
 }).catch(err=>{
 console.log(err);
 });
})



-
How to add a watermark to video on firebase storage using firebase functions and ffmpeg
1er janvier 2021, par awabsI am trying to add a watermark to a video using firebase functions and ffmpeg, but I do know the right code for it. I know is that ffmpen is now available in google cloud env so this approach should work.
But I think that the problem is that ffmpeg is not able to locate watermark.png, where should I put this image file ?
Any help is appreciated.


const functions = require('firebase-functions');
const { Storage } = require('@google-cloud/storage');
const projectId = 'video-demo-a57fa';
let gcs = new Storage ({
 projectId
});
const os =require('os');
const path =require('path');
const spawn = require('child-process-promise').spawn;


exports.addLogo = functions.storage.object().onFinalize(event =>{
 
 const bucket =event.bucket;
 const contentType =event.contentType;
 const filePath =event.name;
 console.log(path.dirname(filePath));

 console.log('File change detected, function execution started');


 if (path.basename(filePath).startsWith('resized-')) {
 console.log('We already renamed that file!');
 return;
 }

 const destBucket = gcs.bucket(bucket);
 const tmpFilePath = path.join(os.tmpdir(), path.basename(filePath));
 const metadata = { contentType: contentType };
 return destBucket.file(filePath).download({
 destination: tmpFilePath
 }).then(()=>{
 return spawn('ffmpeg', ['-i', tmpFilePath, '-i', './watermark.png', '-filter_complex', '"overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2"', tmpFilePath]);
 }).then(() => {
 console.log(tmpFilePath);
 return destBucket.upload(tmpFilePath, {
 destination: path.dirname(filePath)+'/resized-' + path.basename(filePath),
 metadata: metadata
 
 })
 }).catch(err=>{
 console.log(err);
 });
})



-
Why storage access functions not working on android 10 API-29 ? error=13, Permission denied ?
8 janvier 2021, par Rpatel

This example code is to create video from images and music.
Code running on till API level 28 but when I just upgrade to
Build version 29 then it starts crashing. I tried the most solution
but could not find the proper reason and solution.

Please let me know...



2


021-01-08 19:48:16.045 18413-19578/com.example.photovideomaker E/audio: io
 java.io.IOException: Cannot run program "/data/user/0/com.example.photovideomaker/files/ffmpeg": error=13, Permission denied
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)
 at java.lang.Runtime.exec(Runtime.java:698)
 at java.lang.Runtime.exec(Runtime.java:563)
 at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)
 at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)
 at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)
 at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)
 at android.os.Handler.dispatchMessage(Handler.java:107)
 at android.os.Looper.loop(Looper.java:214)
 at android.os.HandlerThread.run(HandlerThread.java:67)
 Caused by: java.io.IOException: error=13, Permission denied
 at java.lang.UNIXProcess.forkAndExec(Native Method)
 at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)
 at java.lang.ProcessImpl.start(ProcessImpl.java:141)
 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
 at java.lang.Runtime.exec(Runtime.java:698) 
 at java.lang.Runtime.exec(Runtime.java:563) 
 at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252) 
 at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89) 
 at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83) 
 at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78) 
 at android.os.Handler.dispatchMessage(Handler.java:107) 
 at android.os.Looper.loop(Looper.java:214) 
 at android.os.HandlerThread.run(HandlerThread.java:67) 
</init>




This function throwing the error "On Process.runtime"




private void createVideo() {
 long startTime = System.currentTimeMillis();
 toatalSecond = (application.getSecond() * ((float) application.getSelectedImages().size())) - DEFAULT_FONT_SCALE;
 joinAudio();
 while (true) {
 if (ImageCreatorService.isImageComplate) {
 Log.e("image creation ", " complte");

 break;
 }else {
 Log.e("image creation ", "not complte");
 }
 }
 Log.e("createVideo", "video create start");
 new File(FileUtils.TEMP_DIRECTORY, "video.txt").delete();
 for (int i = 0; i < application.videoImages.size(); i++) {
 appendVideoLog(String.format("file '%s'", application.videoImages.get(i)));
 }

 File r0=new File(FileUtils.TEMP_DIRECTORY, "video.txt");
 String videoPath = new File(FileUtils.APP_DIRECTORY, getVideoName()).getAbsolutePath();
 String[] inputCode = application.getMusicData() != null ? new String[]{
 FileUtils.getFFmpeg(this), "-r",
 String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),
 "-f", "concat", "-safe", "0", "-i", r0.getAbsolutePath(), "-i",
 audioFile.getAbsolutePath(), "-strict", "experimental", "-r", "30",
 "-t", String.valueOf(toatalSecond), "-c:v", "libx264", "-preset",
 "ultrafast", "-pix_fmt", "yuv420p", "-ac", "2", videoPath}
 : new String[]{FileUtils.getFFmpeg(this),
 "-r", String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),
 "-f", "concat", "-i", r0.getAbsolutePath(), "-r", "30", "-c:v", "libx264", "-preset", "ultrafast", "-pix_fmt", "yuv420p", videoPath};

 System.gc();
 Process process = null;
 try {
 process = Runtime.getRuntime().exec(inputCode);
 while (!Util.isProcessCompleted(process)) {
 BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
 while (true) {
 String line = reader.readLine();
 if (line != null) {
 Log.e("process", line);
 appendLog(line);
 final int incr = durationToprogtess(line);
 new Handler(Looper.getMainLooper()).post(new Runnable() {
 public void run() {
 if (receiver != null) {
 receiver.onVideoProgressUpdate(incr);
 }
 }
 });
 mBuilder.setProgress(100, ((int) ((75.0f * ((float) incr)) / 100.0f)) + 25, false);
 mNotifyManager.notify(1001, mBuilder.build());
 }else {
 break;
 }
 }
 }
 } catch (IOException e) {
 e.printStackTrace();
 } finally {
 Util.destroyProcess(process);
 }
 mBuilder.setContentText("Video created :" + FileUtils.getDuration(System.currentTimeMillis() - startTime)).setProgress(0, 0, false);
 mNotifyManager.notify(1001, mBuilder.build());
 try {
 long fileSize = new File(videoPath).length();
 String artist = getResources().getString(R.string.artist_name);
 ContentValues values = new ContentValues();
 values.put("_data", videoPath);
 values.put("_size", Long.valueOf(fileSize));
 values.put("mime_type", "video/mp4");
 values.put("artist", artist);
 values.put("duration", Float.valueOf(toatalSecond * 1000.0f));
 getContentResolver().insert(Media.getContentUriForPath(videoPath), values);
 } catch (Exception e2) {
 e2.printStackTrace();
 }
 try {
 sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(new File(videoPath))));
 } catch (Exception e3) {
 e3.printStackTrace();
 }

 buildNotification(videoPath);
 final String str = videoPath;
 new Handler(Looper.getMainLooper()).post(new Runnable() {
 public void run() {
 if (receiver != null) {
 receiver.onVideoProgressUpdate(100);
 receiver.onProgressFinish(str);
 }
 }
 });
 FileUtils.deleteTempDir();
 stopSelf();
 }



I have tried checking the directory in storage and check mkdir is working or not but this function purely works for creating video from a collection of images, themes, and audio. as per android