Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (40)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

Sur d’autres sites (4686)

  • Extracting MP3 Data from Generic Movie Files using FFMPEG

    21 février 2017, par MoonKnight

    I am using FFMPEG via MediaToolkit to extract MP3 data (to .mp3 file) from different movie files (merely .mp4 and .mov for now).

    MediaToolkit is just a C# wrapper for FFMPEG which calls FFMPEG via Process.Start, so to do this I am using the method

    public static string GenerateMp3FromVideoFile(string filePath)
    {
       string mp3Path = String.Empty;
       using (var engine = new Engine())
       {
           mp3Path = Path.GetFileNameWithoutExtension(filePath);
           mp3Path = Path.Combine(Utils.GetBuildRoamingAppDataDirectory(), mp3Path);
           mp3Path = Path.ChangeExtension(mp3Path, ".mp3");
           string paramString = String.Format(
               //"-i \"{0}\" -q:a 0 -map a \"{1}\"",
               //"-i \"{0}\" -ar 320K \"{1}\"",
               //"-i \"{0}\" -acodec libmp3lame -ar 44100 -b:a 192k -id3v2_version 3 -write_id3v1 1 \"{1}\"",
               //"-i \"{0}\" -vn -ar 44100 -ac 2 -ab 192k -f mp3 \"{1}\"",
               "-i \"{0}\" -acodec libmp3lame \"{1}\"",
               filePath,
               mp3Path);
           engine.CustomCommand(paramString);
       }
       return mp3Path;
    }

    All of the options I have tried above for the command line arguments passed to FFMPEG have worked for .mp4 video files and create the desired .mp3 output. However, for the .mov file I have I am getting the following System.Exception

    69 : video:0kB audio:1059kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : 0.030074%Conversion failed !

    I have tried a number of different methods to perform this extraction with varing control via the arguments passed to FFMPEG, but with no luck for the .mov file.

    Looking at https://linuxconfig.org/ffmpeg-audio-format-conversions it seems as though there is not conversion to MP3 from .mov files, so I have looked at first converting the .mov to .mp4 via

    ffmpeg -i mymovie.mov -vcodec copy -acodec copy out.mp4

    and then extracting the audio, but this is expensive for large files. Is there a way of extracting the MP3 data directly from the .mov file ?

    Thanks for your time.


    When the above command is run from FFMPEG.exe, the output is :

    [aac @ 00000000021b00a0] Inconsistent channel configuration.
    [aac @ 00000000021b00a0] get_buffer() failed
    Error while decoding stream #0:1 : Invalid argument
    [aac @ 00000000021b00a0] Reserved bit set.
    [aac @ 00000000021b00a0] Number of bands (6) exceeds limit (5).
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] Number of bands (16) exceeds limit (13).
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] channel element 3.7 is not allocated
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] channel element 3.8 is not allocated
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] Reserved bit set.
    [aac @ 00000000021b00a0] TNS filter order 28 is greater than maximum 12.
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] Number of bands (26) exceeds limit (18).
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] Sample rate index in program config element does not match the sample rate index configured by
    the container.
    [aac @ 00000000021b00a0] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git
    . If the problem still occurs, it means that your file has a feature which has not been implemented.
    [aac @ 00000000021b00a0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and cont
    act the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
    Error while decoding stream #0:1 : Not yet implemented in FFmpeg, patches welcome
    [aac @ 00000000021b00a0] Reserved bit set.
    [aac @ 00000000021b00a0] Prediction is not allowed in AAC-LC.
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] Reserved bit set.
    [aac @ 00000000021b00a0] ms_present = 3 is reserved.
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] Number of bands (3) exceeds limit (2).
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] SBR was found before the first channel element.
    [aac @ 00000000021b00a0] channel element 3.14 is not allocated
    Error while decoding stream #0:1 : Invalid data found when processing input
    [aac @ 00000000021b00a0] Sample rate index in program config element does not match the sample rate index configured by
    the container.

  • timelapse images into a movie, 500 at a time

    2 mars 2017, par molly78

    I am trying to make a script to turn a bunch of timelapse images into a movie, using ffmpeg.

    The latest problem is how to loop thru the images in, say, batches of 500.

    There could be 100 images from the day, or there could be 5000 images.

    The reason for breaking this apart is due to running out of memory.

    Afterwards I would need to cat them using MP4Box to join all together...

    I am entirely new to bash, but not entirely programming.

    What I think needs to happen is this

    1) read in the folders contents as the images may not be consecutively named

    2) send ffmpeg a list of 500 at a time to process (https://trac.ffmpeg.org/wiki/Concatenate)

    2b) while you’re looping thru this, set a counter to determine how many loops you’ve done

    3) use the number of loops to create the MP4Box cat command line to join them all at the end.

    the basic script that works if there’s only say 500 images is :

    #!/bin/bash

    dy=$(date '+%Y-%m-%d')

    ffmpeg -framerate 24 -s hd1080 -pattern_type glob -i "/mnt/cams/Camera1/$dy/*.jpg" -vcodec libx264 -pix_fmt yuv420p Cam1-"$dy".mp4

    MP4Box’s cat command looks like :

    MP4Box -cat Cam1-$dy7.mp4 -cat Cam1-$dy6.mp4 -cat Cam1-$dy5.mp4 -cat Cam1-$dy4.mp4 -cat Cam1-$dy3.mp4 -cat Cam1-$dy2.mp4 -cat Cam1-$dy1.mp4 "Cam1 - $dy1 to $dy7.mp4"

    Needless to say help is immensely appreciated for my project

  • Download,modify and upload video with S3

    9 février 2017, par Gold Fish

    I’m trying to write a Lambda function in nodejs that will download a file from S3 bucket, modify it, and then upload it back to another S3 bucket. For some reason, the algorithm prints the ’Modify Video’ log and then finishes and exit without error. What am I doing wrong ?

    var AWS = require('aws-sdk');
    var util = require('util');
    var ffmpeg = require('fluent-ffmpeg');
    var s3 = require('s3');

    // get reference to S3 client

    var awsS3Client = new AWS.S3();
    var options = {
     s3Client: awsS3Client,
    };
    var client = s3.createClient(options);

    exports.handler = function(event, context, callback) {
       // Read options from the event.
       console.log("Reading options from event:\n", util.inspect(event, {depth: 5}));
       var srcBucket = event.Records[0].s3.bucket.name;
       // Object key may have spaces or unicode non-ASCII characters.
       var srcKey    =
       decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " "));
       var dstBucket = srcBucket + "-dst";
       var dstKey    = "mod_" + srcKey;

       var dwnld_file_name = '/tmp/vid.mp4';
       var mdfy_file_name = '/tmp/mod_vid.mp4';

       // Sanity check: validate that source and destination are different buckets.
       if (srcBucket == dstBucket) {
           callback("Source and destination buckets are the same.");
           return;
       }

       // Infer the video type.
       var typeMatch = srcKey.match(/\.([^.]*)$/);
       if (!typeMatch) {
           callback("Could not determine the video type.");
           return;
       }
       var videoType = typeMatch[1];
       if (videoType != "mp4") {
           callback('Unsupported video type: ${videoType}');
           return;
       }
       console.log("Source bucket: ", srcBucket);
       console.log("srcKey: ", srcKey);
       console.log("Dest bucket: ", dstBucket);
       console.log("dstKey: ", dstKey);

       var params = {
         localFile: dwnld_file_name,

         s3Params: {
           Bucket: srcBucket,
           Key: srcKey,
         },
       };
       console.log("params for download: ", params);
       var downloader = client.downloadFile(params);
       downloader.on('error', function(err) {
         console.error("unable to download:", err.stack);
         callback("unable to download");
       });
       downloader.on('end', function() {
         console.log("done downloading");
         console.log("modify video");
         ffmpeg(dwnld_file_name)
             .setStartTime('00:00:01')
             .setDuration('1').output(mdfy_file_name).on('end', function() {
               console.log('Finished processing');
               params = {
                 localFile: mdfy_file_name,
                 //localFile: dwnld_file_name,
                 s3Params: {
                   Bucket: dstBucket,
                   Key: dstKey,
                 },
               };
               console.log("params for upload: ", params);
               var uploader = client.uploadFile(params);
               uploader.on('error', function(err) {
                 console.error("unable to upload:", err.stack);
                 callback("unable to upload");
               });
               uploader.on('end', function() {
                 console.log("done uploading");
                 callback('done');
                 return;
               });
           });  //
       });
    };