
Recherche avancée
Autres articles (15)
-
Installation en mode ferme
4 février 2011, parLe 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 (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (4525)
-
Download a video from blob:https url from eventive
26 août 2020, par jjcasmarI want to download a video from eventive but the tag contains a blob url (blob :https://watch.eventive.org/**************).


I have been reading some answers to similar questions but they all assume that the video has a mp3u8 file extension, which in my case doesn't.


I have also tried to directly download that url (removing the blob :) with curl, but I obtained a html code which I cant really understand, which contains a lot of references to javascript files.


Any tip would be really helpful.


Edit :


I have been doing some more tests and I have been able to found a url to a manifest file which points apparently to the video data. I have tried to open that url using VLC and it loads some info about the video, and it even plays it, but the screen is completely black.


I have also tried to download it using ffmpeg but it gives a bunch of errors.


ffmpeg -i https://eventiveprod-usea.streaming.media.azure.net/02968382-069a-4f02-ab3b-67c0b5a8d5b7/5f427f2d65a569006ebd326c.ism/manifest\(format\=mpd-time-csf\) output.mp4



ffmpeg output


ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 10.1.0 (GCC)
 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
[h264 @ 0x556c1e280bc0] top block unavailable for requested intra mode
[h264 @ 0x556c1e280bc0] error while decoding MB 34 0, bytestream 41478 
[h264 @ 0x556c1e280bc0] concealing 8160 DC, 8160 AC, 8160 MV errors in I frame
[h264 @ 0x556c1e2ce440] top block unavailable for requested intra mode -1
[h264 @ 0x556c1e2ce440] error while decoding MB 34 0, bytestream 22093 
[h264 @ 0x556c1e2ce440] concealing 3600 DC, 3600 AC, 3600 MV errors in I frame
[h264 @ 0x556c1e2f9f40] top block unavailable for requested intra mode -1
[h264 @ 0x556c1e2f9f40] error while decoding MB 24 0, bytestream 15117 
[h264 @ 0x556c1e2f9f40] concealing 2040 DC, 2040 AC, 2040 MV errors in I frame
[h264 @ 0x556c1e333bc0] top block unavailable for requested intra mode -1
[h264 @ 0x556c1e333bc0] error while decoding MB 17 0, bytestream 8716 
[h264 @ 0x556c1e333bc0] concealing 920 DC, 920 AC, 920 MV errors in I frame
[aac @ 0x556c1e3745c0] channel element 2.8 is not allocated
Input #0, dash, from 'https://eventiveprod-usea.streaming.media.azure.net/02968382-069a-4f02-ab3b-67c0b5a8d5b7/5f427f2d65a569006ebd326c.ism/manifest(format=mpd-time-csf)':
 Duration: 00:21:18.00, start: 0.066000, bitrate: 0 kb/s
 Program 0 
 Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1317 kb/s, 29.97 fps, 29.97 tbr, 10000k tbn, 59.94 tbc
 Metadata:
 variant_bitrate : 1770930
 id : 1_V_video_1
 Stream #0:1: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 686 kb/s, 29.97 fps, 29.97 tbr, 10000k tbn, 59.94 tbc
 Metadata:
 variant_bitrate : 904295
 id : 1_V_video_2
 Stream #0:2: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 495 kb/s, 29.97 fps, 29.97 tbr, 10000k tbn, 59.94 tbc
 Metadata:
 variant_bitrate : 572685
 id : 1_V_video_3
 Stream #0:3: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 308 kb/s, 29.97 fps, 29.97 tbr, 10000k tbn, 59.94 tbc
 Metadata:
 variant_bitrate : 301036
 id : 1_V_video_4
 Stream #0:4(en): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
 Metadata:
 variant_bitrate : 127999
 id : 5_A_aac_eng_2_127999
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:4 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0x556c1e392dc0] channel element 2.8 is not allocated
Error while decoding stream #0:4: Invalid data found when processing input 
[h264 @ 0x556c1e3da900] top block unavailable for requested intra mode 
[h264 @ 0x556c1e3da900] error while decoding MB 34 0, bytestream 41478 
[aac @ 0x556c1e392dc0] Reserved bit set. 
[aac @ 0x556c1e392dc0] Number of bands (13) exceeds limit (11). 
[h264 @ 0x556c1e3da900] concealing 8160 DC, 8160 AC, 8160 MV errors in I frame
Error while decoding stream #0:4: Invalid data found when processing input
[aac @ 0x556c1e392dc0] channel element 2.4 is not allocated 
Error while decoding stream #0:4: Invalid data found when processing input 
[aac @ 0x556c1e392dc0] Multiple frames in a packet.
...
[libx264 @ 0x5588338c2d00] frame I:1 Avg QP: 4.13 size: 421
[libx264 @ 0x5588338c2d00] frame P:32 Avg QP:14.06 size: 1216
[libx264 @ 0x5588338c2d00] frame B:96 Avg QP:20.52 size: 306
[libx264 @ 0x5588338c2d00] consecutive B-frames: 0.8% 0.0% 0.0% 99.2%
[libx264 @ 0x5588338c2d00] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x5588338c2d00] mb P I16..4: 0.6% 0.6% 0.0% P16..4: 9.4% 0.3% 0.3% 0.0% 0.0% skip:88.9%
[libx264 @ 0x5588338c2d00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 3.7% 0.0% 0.0% direct: 0.0% skip:96.2% L0:53.5% L1:46.3% BI: 0.2%
[libx264 @ 0x5588338c2d00] 8x8 transform intra:13.0% inter:86.8%
[libx264 @ 0x5588338c2d00] coded y,uvDC,uvAC intra: 1.3% 0.8% 0.2% inter: 0.2% 0.2% 0.0%
[libx264 @ 0x5588338c2d00] i16 v,h,dc,p: 98% 0% 2% 0%
[libx264 @ 0x5588338c2d00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 2% 64% 0% 0% 0% 0% 0% 0%
[libx264 @ 0x5588338c2d00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 18% 42% 3% 1% 1% 2% 2% 1%
[libx264 @ 0x5588338c2d00] i8c dc,h,v,p: 99% 0% 0% 0%
[libx264 @ 0x5588338c2d00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x5588338c2d00] ref P L0: 86.7% 1.2% 8.8% 3.3%
[libx264 @ 0x5588338c2d00] ref B L0: 62.7% 35.4% 1.9%
[libx264 @ 0x5588338c2d00] ref B L1: 96.1% 3.9%
[libx264 @ 0x5588338c2d00] kb/s:127.70
Conversion failed!



-
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



-
Blog series part 1 : How to use Matomo to increase customer acquisitions for your business
2 septembre 2020, par Joselyn Khor — Analytics Tips, Marketing