Recherche avancée

Médias (0)

Mot : - Tags -/publication

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

Autres articles (63)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • 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 (8881)

  • Is there a fix for the 'flashing console' bug with FFMPEG ?

    29 août 2022, par NedNoodleHead

    When using a compiled a program that utilizes FFMPEG (Not library, but the path to the exe), and a GUI library ; that has a function that uses FFMPEG, a console window from FFMPEG will quickly open and disappear.

    


    I have a github repo that can be used to reproduce the bug : https://github.com/nednoodlehead/ffmpegthreading

    


    I also have a quick youtube video showing what the bug looks like, and what it should look like : https://www.youtube.com/watch?v=tCZ0z9E5Iyw

    


    A few things to note with this :

    


    1). This will only occur when the app is compiled. Running this in a virtual environment works as expected. I run it from my IDE all the time with no console flashing. (as seen in video)

    


    2). It will only flash while a GUI is present. So using a regular script to call the same command that produces the bug will NOT cause the bug

    


    3). The bug was tested in Tkinter and PyQt5 and produced the same result (flashing console)

    


    4). Threading is NOT needed to reproduce this bug, it just makes the debugging a bit easier

    


    5). Using the ffmpeg module does not work as my entire project is based around an interface for PyDub (Which uses ffmpeg)

    


    6). This solution does not work for me : How to hide console output of FFmpeg in Python ? (Because this uses the module, while I use the exe)

    


    7). I am using auto-py-to-exe to compile (which uses pyinstaller)

    


    8). Running 'ffmpeg -version' (in regular cmd (same result in venv)) gives : ffmpeg version N-106605-gf67403edb3-20220413

    


    I would appreciate any help, this is tying my brain up.

    


  • 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