Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (51)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Les notifications de la ferme

    1er décembre 2010, par

    Afin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
    Les notifications de changement de statut
    Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
    À la demande d’un canal
    Passage au statut "publie"
    Passage au (...)

Sur d’autres sites (6072)

  • Duration of wav file saved in S3 using AWS Lambda

    3 juin 2021, par Salim Shamim

    Objective

    


    To calculate the duration of a wav file which is saved in S3 by AWS Lambda using node.js. I had to add ffmpeg and ffprobe executable inside a lambda layer (Downloaded linux-64 version from here). These files could be found in /opt folder on lambda file system.

    


    What I have tried

    


    I have been trying using ffprobe in numerous ways, but I get Invalid Data as error.
Here's one example

    


    const AWS = require('aws-sdk');
const s3 = new AWS.S3();
const fs = require('fs');
const ffmpeg = require('fluent-ffmpeg');

exports.handler = async function(event) {
    let path = await load();
    console.log(`Saved Path ${path}`);

    ffmpeg.setFfmpegPath('/opt/ffmpeg');
    ffmpeg.setFfprobePath("/opt/ffprobe");

    let dur = await duration(path).catch(err => {
        console.log(err);
    })
    console.log(dur);
}


function duration(path) {
    return new Promise((resolve, reject) => {
        ffmpeg(path).ffprobe(path, function(err, metadata) {
            //console.dir(metadata); // all metadata
            if (err) {
                reject(err);
            }
            else {
                resolve(metadata.format.duration);

            }
        });
    })
}

async function listFiles(path) {
    console.log('list files');
    return new Promise((resolve, reject) => {
        fs.readdir(path, (err, files) => {
            if (err) {
                console.error('Error in readdir');
                reject(err);
            }
            else {
                console.log('recieved files');
                resolve(files);
            }

        });

    });

}

async function load() {
    return new Promise((resolve, reject) => {
        let params = {
            Key: 'Fanfare60.wav',
            Bucket: 'samplevideosshamim'
        };
        console.log(`Getting s3 object : ${JSON.stringify(params)}`);
        s3.getObject(params, (err, data) => {
            if (err) {
                console.error(err);
                reject(err);
            }
            else if (data) {
                console.log('Recieved Data');
                let path = `/tmp/${params.Key}`;
                console.log('Path: ' + path);
                fs.writeFileSync(path, data.body);
                resolve(path);
            }
        });
    });

}


    


    Error :

    


    Error: ffprobe exited with code 1&#xA;ffprobe version 4.2.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2019 the FFmpeg developers&#xA;  built with gcc 6.3.0 (Debian 6.3.0-18&#x2B;deb9u1) 20170516&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;/tmp/Fanfare60.wav: Invalid data found when processing input&#xA;&#xA;    at ChildProcess.<anonymous> (/var/task/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)&#xA;    at ChildProcess.emit (events.js:314:20)&#xA;    at ChildProcess.EventEmitter.emit (domain.js:483:12)&#xA;    at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)&#xA;</anonymous>

    &#xA;

    I am guessing it doesn't support wav format, but internet searches provide no proof of that.

    &#xA;

    A point to note here is, I was able to get the duration of a local file when I ran this code on my local machine, but I have a windows machine, so perhaps only linux executable of ffprobe has issue ?

    &#xA;

    Possible Solutions I am looking for

    &#xA;

      &#xA;
    1. Is there a way to specify format ?
    2. &#xA;

    3. Can I use a different library (code example for the same) ?
    4. &#xA;

    5. Any possible way to get duration of a wav file in the mentioned scenario (AWS Lambda NodeJS and S3 file (private file) ?
    6. &#xA;

    &#xA;

  • Merge Audio with Video is not working probably using android 9 & 8

    22 juillet 2021, par ebdaa app

    I am trying to use the following code to merge audio with video,

    &#xA;

        cmd = "-stream_loop -1 -i " &#x2B; videoUri &#x2B; " -i " &#x2B; audioPath &#x2B; " -shortest -map 0:v:0 -map 1:a:0 -y " &#x2B; videoOutputPath;&#xA;&#xA;    long executionId = FFmpeg.executeAsync(cmd, new ExecuteCallback() {&#xA;&#xA;        @Override&#xA;        public void apply(final long executionId, final int returnCode) {&#xA;            if (returnCode == RETURN_CODE_SUCCESS) {&#xA;                playVedio(videoOutputPath);&#xA;            } else {&#xA;                ErrorLogger();&#xA;            }&#xA;        }&#xA;    });&#xA;

    &#xA;

    as you can see the above code does the following things :

    &#xA;

      &#xA;
    1. replace audio in video with new one.
    2. &#xA;

    3. loop the video until the new audio ends.
    4. &#xA;

    &#xA;

    everything works perfectly when trying to run the code using both android 11 and 10 , however , when try to use android 9 or 8 , the first and the last 2 seconds of the new audio will be trimmed in the generated video and I am not able to know why

    &#xA;

    I am using 4.4 version of the mobile-ffmpeg

    &#xA;

     com.arthenica:mobile-ffmpeg-full:4.4&#xA;

    &#xA;

    please find the log from android 8/9

    &#xA;

     I/mobile-ffmpeg: ffmpeg version v4.4-dev-416&#xA;      Copyright (c) 2000-2020 the FFmpeg developers&#xA;       built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)&#xA;       configuration: --cross-prefix=i686-linux-android- --sysroot=/files/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-x86/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=i686 --cpu=i686 --cc=i686-linux-android24-clang --cxx=i686-linux-android24-clang&#x2B;&#x2B; --extra-libs=&#x27;-L/home/taner/Projects/mobile-ffmpeg/prebuilt/android-x86/cpu-features/lib -lndk_compat&#x27; --target-os=android --disable-neon --disable-asm --disable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec&#xA;       libavutil      56. 55.100 / 56. 55.100&#xA;       libavcodec     58. 96.100 / 58. 96.100&#xA;       libavformat    58. 48.100 / 58. 48.100&#xA;       libavdevice    58. 11.101 / 58. 11.101&#xA;       libavfilter     7. 87.100 /  7. 87.100&#xA;       libswscale      5.  8.100 /  5.  8.100&#xA;       libswresample   3.  8.100 /  3.  8.100&#xA; I/mobile-ffmpeg: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/storage/emulated/0/Download/Videoes/share_video_2.mp4&#x27;:&#xA;       Metadata:&#xA;         major_brand     : &#xA;     isom&#xA;         minor_version   : &#xA;     512&#xA;         compatible_brands: &#xA;     isomiso2avc1mp41&#xA;         encoder         : &#xA; I/mobile-ffmpeg: Lavf58.44.100&#xA;       Duration: &#xA;     00:00:08.21&#xA;     , start: &#xA;     0.000000&#xA;     , bitrate: &#xA;     477 kb/s&#xA;         Stream #0:0&#xA;     (und)&#xA;     : Video: h264 (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 473 kb/s&#xA;     , &#xA;     29.97 fps, &#xA;     29.97 tbr, &#xA;     30k tbn, &#xA;     59.94 tbc&#xA;      (default)&#xA;         Metadata:&#xA;           handler_name    : &#xA;     VideoHandler&#xA; I/mobile-ffmpeg: Input #1, mp3, from &#x27;/storage/emulated/0/Download/001001.mp3&#x27;:&#xA; I/mobile-ffmpeg:   Metadata:&#xA;         album           : &#xA;     Mishary Alafasi Musshaf&#xA;         artist          : &#xA;     Mishary Alafasi&#xA;         comment         : &#xA;     www.mp3quran.net&#xA;         genre           : &#xA;     Quran&#xA;         title           : &#xA;     Al-Fatihah&#xA;         date            : &#xA;     2007&#xA;         encoder         : &#xA;     Lavf58.48.100&#xA;       Duration: &#xA;     00:00:12.41&#xA;     , start: &#xA;     0.011995&#xA;     , bitrate: &#xA;     132 kb/s&#xA;         Stream #1:0&#xA; I/mobile-ffmpeg: : Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s&#xA;         Metadata:&#xA;           encoder         : &#xA;     Lavf&#xA;         Stream #1:1&#xA;     : Video: png, pal8(pc), 200x159 [SAR 2835:2835 DAR 200:159]&#xA;     , &#xA;     90k tbr, &#xA;     90k tbn, &#xA;     90k tbc&#xA;      (attached pic)&#xA;         Metadata:&#xA;           comment         : &#xA;     Cover (front)&#xA; I/mobile-ffmpeg: Stream mapping:&#xA;       Stream #0:0 -> #0:0&#xA;      (h264 (native) -> mpeg4 (native))&#xA;       Stream #1:0 -> #0:1&#xA;      (mp3 (mp3float) -> aac (native))&#xA;     Press [q] to stop, [?] for help&#xA; I/mobile-ffmpeg: frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    &#xA; W/mobile-ffmpeg: [graph 0 input from stream 0:0 @ 0xd429d2e0] sws_param option is deprecated and ignored&#xA; D/EGL_emulation: eglMakeCurrent: 0xf08c6ee0: ver 2 0 (tinfo 0xf08d2810)&#xA; I/mobile-ffmpeg: Output #0, mp4, to &#x27;/storage/emulated/0/Download/v001001.mp4&#x27;:&#xA;       Metadata:&#xA;         major_brand     : &#xA;     isom&#xA;         minor_version   : &#xA; I/mobile-ffmpeg: 512&#xA;         compatible_brands: &#xA;     isomiso2avc1mp41&#xA;         encoder         : &#xA;     Lavf58.48.100&#xA;         Stream #0:0&#xA;     (und)&#xA;     : Video: mpeg4 (mp4v / 0x7634706D), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s&#xA;     , &#xA;     29.97 fps, &#xA;     30k tbn, &#xA;     29.97 tbc&#xA;      (default)&#xA;         Metadata:&#xA;           handler_name    : &#xA;     VideoHandler&#xA;           encoder         : &#xA;     Lavc58.96.100 mpeg4&#xA;         Side data:&#xA; I/mobile-ffmpeg:       &#xA;     cpb: &#xA;     bitrate max/min/avg: 0/0/200000 buffer size: 0 &#xA;     vbv_delay: N/A&#xA; I/mobile-ffmpeg:     Stream #0:1&#xA;     : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s&#xA;         Metadata:&#xA;           encoder         : &#xA;     Lavc58.96.100 aac&#xA; I/mobile-ffmpeg: frame=   83 fps=0.0 q=30.2 size=       0kB time=00:00:02.78 bitrate=   0.1kbits/s speed=5.54x    &#xA; I/mobile-ffmpeg: frame=  199 fps=198 q=31.0 size=     256kB time=00:00:06.64 bitrate= 315.8kbits/s speed=6.61x    &#xA; I/mobile-ffmpeg: frame=  300 fps=199 q=31.0 size=     512kB time=00:00:10.00 bitrate= 419.1kbits/s speed=6.65x    &#xA; I/mobile-ffmpeg: frame=  372 fps=204 q=31.0 Lsize=     733kB time=00:00:12.39 bitrate= 484.5kbits/s speed= 6.8x    &#xA;     video:526kB audio:195kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: &#xA;     1.630239%&#xA; I/mobile-ffmpeg: [aac @ 0xd431fc00] Qavg: 164.571&#xA;

    &#xA;

  • Audio on TS File Falls Progressively Out of Sync

    8 août 2021, par Steve Brown

    I would really appreciate some help with this...

    &#xA;

    I have a .ts file I've downloaded from the internet, when I play in Quicktime the video progressively falls behind the audio. It becomes noticeable after a couple of minutes and is a few seconds out after about ten minutes. It plays fine in VLC, but I want to be able to play on my AppleTV which does the same as Quicktime.

    &#xA;

    I've tried everything I can think of to resolve...

    &#xA;

      &#xA;
    • Convert with VLC, which does work, but every few seconds the audio skips.
    • &#xA;

    • Convert with Handbrake, which again works, but every few seconds the audio skips like with VLC.
    • &#xA;

    • Convert with FFMpeg using -async, but I get the same result again with the audio skips.
    • &#xA;

    • Extracted the audio and video to two separate files and recreated a new file with FFMpeg, this makes no difference and is the same as playing the original file.
    • &#xA;

    • Tried "stretching" the audio with FFMpeg using "aresample=async=1000", which synchronises but the audio is distorted.
    • &#xA;

    &#xA;

    I think the audio skips I'm getting from the -async option are caused because the audio is being trimmed to sync with the video. What I want to do is adjust the video to fit with the audio and leave the audio unchanged.

    &#xA;

    I've tried to do this with -vsync, but the the results are the same as the original file. The FFMpeg user guide says the following :

    &#xA;

    With -map you can select from which stream the timestamps should be taken. You can leave either video or audio unchanged and sync the remaining stream(s) to the unchanged one.

    &#xA;

    But I cannot figure out the syntax. This is what I'm trying but the output is the same as the original...

    &#xA;

    ffmpeg -vsync 1 -I test.ts -map 0:1 -map 0:0 -y test.mp4

    &#xA;

    I've tried the above using vsync with 0, 1 and 2, but the result is still the same.

    &#xA;

    Could anyone please help me with the syntax to sync the video stream to the audio stream and leave the audio unchanged ? Or suggest an alternative method I could use ?

    &#xA;

    Any help would be really, really appreciated. Thanks.

    &#xA;

    Here is the ffprobe for test.ts...

    &#xA;

    ffprobe version 4.4 Copyright (c) 2007-2021 the FFmpeg developers&#xA;built with Apple clang version 12.0.0 (clang-1200.0.32.29)&#xA;configuration : —prefix=/usr/local/Cellar/ffmpeg/4.4_1 —enable-shared —enable-pthreads —enable-version3 —enable-avresample —cc=clang —host-cflags= —host-ldflags= —enable-ffplay —enable-gnutls —enable-gpl —enable-libaom —enable-libbluray —enable-libdav1d —enable-libmp3lame —enable-libopus —enable-librav1e —enable-librubberband —enable-libsnappy —enable-libsrt —enable-libtesseract —enable-libtheora —enable-libvidstab —enable-libvorbis —enable-libvpx —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxml2 —enable-libxvid —enable-lzma —enable-libfontconfig —enable-libfreetype —enable-frei0r —enable-libass —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libspeex —enable-libsoxr —enable-libzmq —enable-libzimg —disable-libjack —disable-indev=jack —enable-videotoolbox&#xA;libavutil 56. 70.100 / 56. 70.100&#xA;libavcodec 58.134.100 / 58.134.100&#xA;libavformat 58. 76.100 / 58. 76.100&#xA;libavdevice 58. 13.100 / 58. 13.100&#xA;libavfilter 7.110.100 / 7.110.100&#xA;libavresample 4. 0. 0 / 4. 0. 0&#xA;libswscale 5. 9.100 / 5. 9.100&#xA;libswresample 3. 9.100 / 3. 9.100&#xA;libpostproc 55. 9.100 / 55. 9.100&#xA;Input #0, mpegts, from 'TEst.ts' :&#xA;Duration : 02:13:05.51, start : 1.406000, bitrate : 4579 kb/s&#xA;Program 1&#xA;Metadata :&#xA;service_name : Service01&#xA;service_provider : FFmpeg&#xA;Stream #0:0[0x100] : Video : h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080, 23.98 tbr, 90k tbn, 1411200000.00 tbc&#xA;Stream #0:1[0x101] : Audio : aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 195 kb/s

    &#xA;