Recherche avancée

Médias (21)

Mot : - Tags -/Nine Inch Nails

Autres articles (96)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 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, par

    Multilang 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, par

    La 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 awabs

    I 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 awabs

    I 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&#xA;    java.io.IOException: Cannot run program "/data/user/0/com.example.photovideomaker/files/ffmpeg": error=13, Permission denied&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)&#xA;        at java.lang.Runtime.exec(Runtime.java:698)&#xA;        at java.lang.Runtime.exec(Runtime.java:563)&#xA;        at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)&#xA;        at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)&#xA;        at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)&#xA;        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)&#xA;        at android.os.Handler.dispatchMessage(Handler.java:107)&#xA;        at android.os.Looper.loop(Looper.java:214)&#xA;        at android.os.HandlerThread.run(HandlerThread.java:67)&#xA;     Caused by: java.io.IOException: error=13, Permission denied&#xA;        at java.lang.UNIXProcess.forkAndExec(Native Method)&#xA;        at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)&#xA;        at java.lang.ProcessImpl.start(ProcessImpl.java:141)&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)&#xA;        at java.lang.Runtime.exec(Runtime.java:698)&#xA0;&#xA;        at java.lang.Runtime.exec(Runtime.java:563)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)&#xA0;&#xA;        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)&#xA0;&#xA;        at android.os.Handler.dispatchMessage(Handler.java:107)&#xA0;&#xA;        at android.os.Looper.loop(Looper.java:214)&#xA0;&#xA;        at android.os.HandlerThread.run(HandlerThread.java:67)&#xA0;&#xA;</init>

    &#xA;

    &#xA;

    This function throwing the error "On Process.runtime"

    &#xA;

    &#xA;

    private void createVideo() {&#xA;        long startTime = System.currentTimeMillis();&#xA;        toatalSecond = (application.getSecond() * ((float) application.getSelectedImages().size())) - DEFAULT_FONT_SCALE;&#xA;        joinAudio();&#xA;        while (true) {&#xA;            if (ImageCreatorService.isImageComplate) {&#xA;                Log.e("image creation ", " complte");&#xA;&#xA;                break;&#xA;            }else {&#xA;                Log.e("image creation ", "not complte");&#xA;            }&#xA;        }&#xA;        Log.e("createVideo", "video create start");&#xA;        new File(FileUtils.TEMP_DIRECTORY, "video.txt").delete();&#xA;        for (int i = 0; i &lt; application.videoImages.size(); i&#x2B;&#x2B;) {&#xA;            appendVideoLog(String.format("file &#x27;%s&#x27;", application.videoImages.get(i)));&#xA;        }&#xA;&#xA;        File r0=new File(FileUtils.TEMP_DIRECTORY, "video.txt");&#xA;        String videoPath = new File(FileUtils.APP_DIRECTORY, getVideoName()).getAbsolutePath();&#xA;        String[] inputCode = application.getMusicData() != null ? new String[]{&#xA;                FileUtils.getFFmpeg(this), "-r",&#xA;                String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),&#xA;                "-f", "concat", "-safe", "0", "-i", r0.getAbsolutePath(), "-i",&#xA;                audioFile.getAbsolutePath(), "-strict", "experimental", "-r", "30",&#xA;                "-t", String.valueOf(toatalSecond), "-c:v", "libx264", "-preset",&#xA;                "ultrafast", "-pix_fmt", "yuv420p", "-ac", "2", videoPath}&#xA;        : new String[]{FileUtils.getFFmpeg(this),&#xA;                "-r", String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),&#xA;                "-f", "concat", "-i", r0.getAbsolutePath(), "-r", "30", "-c:v", "libx264", "-preset", "ultrafast", "-pix_fmt", "yuv420p", videoPath};&#xA;&#xA;        System.gc();&#xA;        Process process = null;&#xA;        try {&#xA;            process = Runtime.getRuntime().exec(inputCode);&#xA;            while (!Util.isProcessCompleted(process)) {&#xA;                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));&#xA;                while (true) {&#xA;                    String line = reader.readLine();&#xA;                    if (line != null) {&#xA;                        Log.e("process", line);&#xA;                        appendLog(line);&#xA;                        final int incr = durationToprogtess(line);&#xA;                        new Handler(Looper.getMainLooper()).post(new Runnable() {&#xA;                            public void run() {&#xA;                                if (receiver != null) {&#xA;                                    receiver.onVideoProgressUpdate(incr);&#xA;                                }&#xA;                            }&#xA;                        });&#xA;                        mBuilder.setProgress(100, ((int) ((75.0f * ((float) incr)) / 100.0f)) &#x2B; 25, false);&#xA;                        mNotifyManager.notify(1001, mBuilder.build());&#xA;                    }else {&#xA;                        break;&#xA;                    }&#xA;                }&#xA;            }&#xA;        } catch (IOException e) {&#xA;            e.printStackTrace();&#xA;        } finally {&#xA;            Util.destroyProcess(process);&#xA;        }&#xA;        mBuilder.setContentText("Video created :" &#x2B; FileUtils.getDuration(System.currentTimeMillis() - startTime)).setProgress(0, 0, false);&#xA;        mNotifyManager.notify(1001, mBuilder.build());&#xA;        try {&#xA;            long fileSize = new File(videoPath).length();&#xA;            String artist = getResources().getString(R.string.artist_name);&#xA;            ContentValues values = new ContentValues();&#xA;            values.put("_data", videoPath);&#xA;            values.put("_size", Long.valueOf(fileSize));&#xA;            values.put("mime_type", "video/mp4");&#xA;            values.put("artist", artist);&#xA;            values.put("duration", Float.valueOf(toatalSecond * 1000.0f));&#xA;            getContentResolver().insert(Media.getContentUriForPath(videoPath), values);&#xA;        } catch (Exception e2) {&#xA;            e2.printStackTrace();&#xA;        }&#xA;        try {&#xA;            sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(new File(videoPath))));&#xA;        } catch (Exception e3) {&#xA;            e3.printStackTrace();&#xA;        }&#xA;&#xA;        buildNotification(videoPath);&#xA;        final String str = videoPath;&#xA;        new Handler(Looper.getMainLooper()).post(new Runnable() {&#xA;            public void run() {&#xA;                if (receiver != null) {&#xA;                    receiver.onVideoProgressUpdate(100);&#xA;                    receiver.onProgressFinish(str);&#xA;                }&#xA;            }&#xA;        });&#xA;        FileUtils.deleteTempDir();&#xA;       stopSelf();&#xA;    }&#xA;

    &#xA;

    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

    &#xA;