Recherche avancée

Médias (1)

Mot : - Tags -/swfupload

Autres articles (65)

  • 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

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9005)

  • FFmpeg youtube stream get corrupted until restart

    19 février 2023, par unpwn

    I am streaming images from python to youtube using ffmpeg.
It's working fine with just one problem.
Sometimes the stream get somehow corrupted an the stream looks like this :

    


    Corrupted stream image

    


    Or you can see for yourself in the stream itself : https://www.youtube.com/watch?v=PG6NLtr0jjM (Scroll back to the beginning)

    


    Then I have to restart ffmpeg and its working fine. Sometimes an error occurs regarding the network and I have to automatically restart the stream. Then there is the possibility it is corrupted again.

    


    The parameters for ffmpeg are the following :

    


    cmd_out = ['ffmpeg',
       '-re',
       '-f', 'concat',
       '-i', os.path.join(BASE_DIR, 'music', 'music.txt').replace('\\', '/'),           
       '-r', '1',
       '-f', 'image2pipe',
       '-vcodec', 'png',
       '-r', '1',
       '-i', '-',
       '-c:v', 'libx264',
       '-c:a', 'copy',
       '-g', '4',
       '-f', 'flv',
       'rtmp://a.rtmp.youtube.com/live2/{}'.format(stream_key)]  


    


    I never had that problem testing it on windows. It just appears when I use my linux server.

    


    I am using ffmpeg version 3.2.18-0+deb9u1 and the generated images are fine, when I save them to a normal file.

    


    Does someone know how to fix it ? Or where the problem is comming from ?

    



    


    Solution : An old ffmpeg version was available while using docker. I solved the problem by using a static build from https://www.johnvansickle.com/ffmpeg/

    


    I used this to use it in docker :

    


    WORKDIR /app
ADD ./ffmpeg /app
RUN mv ffmpeg /usr/local/ffmpeg
RUN chmod +x /usr/local/ffmpeg


    


    Until now the error seems to be solved.

    


  • Node js async/await promise problem with ytdl and ffmpeg

    31 août 2020, par WorkoutBuddy

    I built a simple youtube downloader cli. It looks like this (without any arg parsing for easier reproduction) :

    


    const ytdl = require('ytdl-core');
const config = require('config');
const progressBar = require('./progressBar');
const logger = require('./logger');
const ffmpeg = require('fluent-ffmpeg');

const url = 'https://www.youtube.com/watch?v=Np8ibIagn3M';

const getInfo = async (url) => {
    logger.info(`Getting metadata for ${url}`);
    const response = await ytdl.getBasicInfo(url);
    const info = response.videoDetails.title;
    logger.info(`Title: ${info}`);
    return info;
};

const getStream = async (url) => {
    logger.info(`Downloading from ${url} ...`);

    let allReceived = false;
    return new Promise((resolve, reject) => {
        const stream = ytdl(url, {
            quality: 'highest',
            filter: (format) => format.container === 'mp4',
        })
            .on('progress', (_, totalDownloaded, total) => {
                if (!allReceived) {
                    progressBar.start(total, 0, {
                        mbTotal: (total / 1024 / 1024).toFixed(2),
                        mbValue: 0,
                    });
                    allReceived = true;
                }
                progressBar.increment();
                progressBar.update(totalDownloaded, {
                    mbValue: (totalDownloaded / 1024 / 1024).toFixed(2),
                });
            })
            .on('end', () => {
                progressBar.stop();
                logger.info('Successfully downloaded the stream!');
            });
        return resolve(stream);
    });
};

const convertToMp3 = async (stream, title) => {
    return new Promise((resolve, reject) => {
        ffmpeg({ source: stream })
            .output(`${config.get('audioDir')}/${title}.mp3`)
            .audioBitrate('192k')
            .run();
        return resolve();
    });
};

const main = async (url) => {
    const info = await getInfo(url);
    console.log('here 1');
    const stream = await getStream(url);
    console.log('here 2');
    await convertToMp3(stream, info);
    console.log('done');
};

main(url);


    


    The output looks like :

    


    ➜ node youtube.js
info:    Getting metadata for https://www.youtube.com/watch?v=Np8ibIagn3M
info:    Title: Tu boca -  (Bachata Remix Dj Khalid)
here 1
info:    Downloading from https://www.youtube.com/watch?v=Np8ibIagn3M ...
here 2
done
[Progress] [████████████████████████████████████████] 100% | Downloaded: 7.15/7.15 MB | Elapsed Time: 5s
info:    Successfully downloaded the stream!


    


    However, I would expect this output :

    


    ➜ node youtube.js
info:    Getting metadata for https://www.youtube.com/watch?v=Np8ibIagn3M
info:    Title: Tu boca -  (Bachata Remix Dj Khalid)
here 1
info:    Downloading from https://www.youtube.com/watch?v=Np8ibIagn3M ...
[Progress] [████████████████████████████████████████] 100% | Downloaded: 7.15/7.15 MB | Elapsed Time: 5s
here 2
info:    Successfully downloaded the stream!
done


    


    I think I have troubles to understand async/await. As far as I understood, promisifying a function allows me wait for the result. However, it seems that it does not work. I do not know why and how to properly debug it.

    


    EDITED :

    


    const getStream = async (url) => {
    logger.info(`Downloading from ${url} ...`);

    let allReceived = false;
    return new Promise((resolve, reject) => {
        const stream = ytdl(url, {
            quality: 'highest',
            filter: (format) => format.container === 'mp4',
        })
            .on('progress', (_, totalDownloaded, total) => {
                console.log('totalDownloaded: ' + totalDownloaded);
                if (!allReceived) {
                    console.log('total: ' + total);
                    progressBar.start(total, 0, {
                        mbTotal: (total / 1024 / 1024).toFixed(2),
                        mbValue: 0,
                    });
                    allReceived = true;
                }
                progressBar.increment();
                progressBar.update(totalDownloaded, {
                    mbValue: (totalDownloaded / 1024 / 1024).toFixed(2),
                });
            })
            .on('end', () => {
                progressBar.stop();
                logger.info('Successfully downloaded the stream!');
                resolve(stream);
            });
    });
};


    


    But now it is like this :

    


    ➜ node youtube.js
info:    Getting metadata for https://www.youtube.com/watch?v=Np8ibIagn3M
info:    Title: Tu boca -  (Bachata Remix Dj Khalid)
here 1
info:    Downloading from https://www.youtube.com/watch?v=Np8ibIagn3M ...
[Progress] [██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 14% | Downloaded: 1.02/7.15 MB | Elapsed Time: 52s


    


    Added console.log :

    


    totalDownloaded: 16384
total: 7493903
[Progress] [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% | Downloaded: 0/7.15 MB | Elapsed Time: 0stotalDownloaded: 32768
totalDownloaded: 49152
totalDownloaded: 65536
totalDownloaded: 81920
totalDownloaded: 98304
totalDownloaded: 114688
totalDownloaded: 131072
totalDownloaded: 147456
totalDownloaded: 163840
totalDownloaded: 180224
totalDownloaded: 196608
totalDownloaded: 212992
totalDownloaded: 229376
totalDownloaded: 245760
totalDownloaded: 262144
totalDownloaded: 278528
totalDownloaded: 294912
totalDownloaded: 311296
totalDownloaded: 327680
totalDownloaded: 344064
totalDownloaded: 360448
totalDownloaded: 376832
totalDownloaded: 393216
totalDownloaded: 409600
totalDownloaded: 425984
totalDownloaded: 442368
totalDownloaded: 458752
totalDownloaded: 475136
totalDownloaded: 491520
totalDownloaded: 507904
totalDownloaded: 524288
totalDownloaded: 540672
totalDownloaded: 557056
totalDownloaded: 573440
totalDownloaded: 589824
totalDownloaded: 606208
totalDownloaded: 622592
totalDownloaded: 638976
totalDownloaded: 655360
totalDownloaded: 671744
totalDownloaded: 688128
totalDownloaded: 704512
totalDownloaded: 720896
totalDownloaded: 737280
totalDownloaded: 753664
totalDownloaded: 770048
totalDownloaded: 786432
totalDownloaded: 802816
totalDownloaded: 819200
totalDownloaded: 835584
totalDownloaded: 851968
totalDownloaded: 868352
totalDownloaded: 884736
totalDownloaded: 901120
totalDownloaded: 917504
totalDownloaded: 933888
totalDownloaded: 950272
totalDownloaded: 966656
totalDownloaded: 983040
totalDownloaded: 999424
totalDownloaded: 1015808
totalDownloaded: 1032192
totalDownloaded: 1048576
totalDownloaded: 1064960
[Progress] [██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 14% | Downloaded: 1.02/7.15 MB | Elapsed Time: 25s


    


  • Merge commit ’6fee1b90ce3bf4fbdfde7016e0890057c9000487’

    5 mai 2013, par Michael Niedermayer
    Merge commit ’6fee1b90ce3bf4fbdfde7016e0890057c9000487’
    

    * commit ’6fee1b90ce3bf4fbdfde7016e0890057c9000487’ :
    avcodec : Add av_cold attributes to init functions missing them

    Conflicts :
    libavcodec/aacpsy.c
    libavcodec/atrac3.c
    libavcodec/dvdsubdec.c
    libavcodec/ffv1.c
    libavcodec/ffv1enc.c
    libavcodec/h261enc.c
    libavcodec/h264_parser.c
    libavcodec/h264dsp.c
    libavcodec/h264pred.c
    libavcodec/libschroedingerenc.c
    libavcodec/libxvid_rc.c
    libavcodec/mpeg12.c
    libavcodec/mpeg12enc.c
    libavcodec/proresdsp.c
    libavcodec/rangecoder.c
    libavcodec/videodsp.c
    libavcodec/x86/proresdsp_init.c

    Merged-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavcodec/aacpsy.c
    • [DH] libavcodec/ac3enc.c
    • [DH] libavcodec/atrac3.c
    • [DH] libavcodec/audio_frame_queue.c
    • [DH] libavcodec/avfft.c
    • [DH] libavcodec/bgmc.c
    • [DH] libavcodec/bink.c
    • [DH] libavcodec/binkdsp.c
    • [DH] libavcodec/dcadsp.c
    • [DH] libavcodec/dnxhdenc.c
    • [DH] libavcodec/dsputil.c
    • [DH] libavcodec/dvdsubdec.c
    • [DH] libavcodec/eac3enc.c
    • [DH] libavcodec/ffv1.c
    • [DH] libavcodec/ffv1enc.c
    • [DH] libavcodec/flac_parser.c
    • [DH] libavcodec/h261enc.c
    • [DH] libavcodec/h264_parser.c
    • [DH] libavcodec/h264chroma.c
    • [DH] libavcodec/h264dsp.c
    • [DH] libavcodec/h264pred.c
    • [DH] libavcodec/h264qpel.c
    • [DH] libavcodec/iirfilter.c
    • [DH] libavcodec/ituh263dec.c
    • [DH] libavcodec/ituh263enc.c
    • [DH] libavcodec/ivi_common.c
    • [DH] libavcodec/libschroedinger.c
    • [DH] libavcodec/libschroedingerenc.c
    • [DH] libavcodec/libxvid_rc.c
    • [DH] libavcodec/mlpdsp.c
    • [DH] libavcodec/mpc.c
    • [DH] libavcodec/mpeg12.c
    • [DH] libavcodec/mpeg12enc.c
    • [DH] libavcodec/mpeg4videoenc.c
    • [DH] libavcodec/mpegaudiodec.c
    • [DH] libavcodec/mpegaudiodsp.c
    • [DH] libavcodec/mpegaudiodsp_template.c
    • [DH] libavcodec/mpegvideo.c
    • [DH] libavcodec/msmpeg4enc.c
    • [DH] libavcodec/pngdsp.c
    • [DH] libavcodec/proresdsp.c
    • [DH] libavcodec/ralf.c
    • [DH] libavcodec/rangecoder.c
    • [DH] libavcodec/ratecontrol.c
    • [DH] libavcodec/roqvideoenc.c
    • [DH] libavcodec/sipr16k.c
    • [DH] libavcodec/utils.c
    • [DH] libavcodec/vc1.c
    • [DH] libavcodec/vc1_parser.c
    • [DH] libavcodec/videodsp.c
    • [DH] libavcodec/vorbisdsp.c
    • [DH] libavcodec/vp56dsp.c
    • [DH] libavcodec/wma.c
    • [DH] libavcodec/wmadec.c
    • [DH] libavcodec/wmaenc.c
    • [DH] libavcodec/x86/h264chroma_init.c
    • [DH] libavcodec/x86/proresdsp_init.c