
Recherche avancée
Autres articles (2)
-
D’autres logiciels intéressants
12 avril 2011, parOn ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
Videopress
Site Internet : (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (2177)
-
Node js async/await promise problem with ytdl and ffmpeg
31 août 2020, par WorkoutBuddyI 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



-
FFmpeg youtube stream get corrupted until restart
19 février 2023, par unpwnI 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 :




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.


-
Is there a fix for the 'flashing console' bug with FFMPEG ?
29 août 2022, par NedNoodleHeadWhen 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.