
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (106)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Formulaire personnalisable
21 juin 2013, parCette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire. (...) -
Qu’est ce qu’un masque de formulaire
13 juin 2013, parUn masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
Chaque formulaire de publication d’objet peut donc être personnalisé.
Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)
Sur d’autres sites (5972)
-
yt-dlp how to download a specific video using timestamps, and limiting the download resolution ?
30 septembre 2023, par ignacMI am running a python program to download a video, this is the command I use :


command = ['powershell.exe ffmpeg',
 '-ss', str(start),
 '-i', '$(yt-dlp',
 '-f', 'bestvideo[ext=webm]',

 '-g', '"%s")' % (url_base + video_identifier),
 '-t', str(end - start),
 '-c:v', 'libx264', '-c:a', 'copy', '%s' % output_filename]

command = ' '.join(command)
output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)



This prints something like
powershell.exe ffmpeg -ss 10 -i $(yt-dlp -f bestvideo[ext=webm] -g "https://www.youtube.com/watch?v=Z15erfLqNKo") -t 10 -c:v libx264 -c:a copy C :\Users...\video.mp4


This works perfectly fine. However, I tried to download a video that had very high resolution (4K) and I want to limit the resolution when downloading. I have found that placing [height<=1080] as so should work :


powershell.exe ffmpeg -ss 10 -i $(yt-dlp -f bestvideo[ext=webm][height<=1080] -g "https://www.youtube.com/watch?v=Z15erfLqNKo") -t 10 -c:v libx264 -c:a copy C :\Users...\video.mp4


However this does not work for me and gives me the error :
Error command "" returned non-zero exit status 1.
Output : b'The system cannot find the file specified.\r\n'


I also have noticed that only limiting the resolution does not work for me either :


powershell.exe ffmpeg -ss 10 -i $(yt-dlp -f bestvideo[height<=1080] -g "https://www.youtube.com/watch?v=Z15erfLqNKo") -t 10 -c:v libx264 -c:a copy C :\Users...\video.mp4


Actually, placing [height<=1080] after bestvideo never works, no matter what I do.


What could be the problem ? Or what command can I run to achieve both tasks (limit resolution and download specific timeframe (not whole video and cutting it)) ?


-
How to download audio and video as separate files and specify the output format and filename for each ?
14 novembre 2023, par TaakoI'd like to download a video as separate files for both audio and video and have them named
[video_id]-audio.wav
and[video_id]-video.mp4


How do i get yt-dlp to download the video and audio separately, then convert each to the specified output format and rename them as such ?


Right now I can get them each downloaded separately but the naming isnt working out.


I could also use ffmpeg separately to convert the video and audio formats after they are downloaded, so all i really need is to have the audio and video files downloaded and named


Right now my args are


YT_OPTIONS = {
 'format': 'bestvideo[height<=720]+bestaudio/best[height<=720]',
 'extractaudio': True,
 'keepvideo': True,
 'outtmpl': '%(id)s-%(format)s.%(ext)s',
 'restrictfilenames': True,
 'noplaylist': True
}



but the
format
is just coming out as247_-_1280x720_720p_+251_-_audio_only_medium
and whats worse is it is the same for both the audio only and video only files just one has251
and the other has247
.

-
Download youtube video as stream Readable object
26 décembre 2023, par Abraam Emadin this function it download youtube video as a file out.mp4 on hard disk i need to download it as a Readable Object to upload it


private async downloadVideo(videoId: string) {
// Buildin with nodejs
const cp = require('child_process');
const readline = require('readline');
// External modules
const ytdl = require('ytdl-core');
const ffmpeg = require('ffmpeg-static');
// Global constants
const ref = `https://www.youtube.com/watch?v=${videoId}`;
const tracker = {
 start: Date.now(),
 audio: { downloaded: 0, total: Infinity },
 video: { downloaded: 0, total: Infinity },
 merged: { frame: 0, speed: '0x', fps: 0 },
};

// Get audio and video streams
const audio = ytdl(ref, { quality: 'highestaudio' })
 .on('progress', (_, downloaded, total) => {
 tracker.audio = { downloaded, total };
 });
const video = ytdl(ref, { quality: 'highestvideo' })
 .on('progress', (_, downloaded, total) => {
 tracker.video = { downloaded, total };
 });

// Prepare the progress bar
let progressbarHandle = null;
const progressbarInterval = 1000;
const showProgress = () => {
 readline.cursorTo(process.stdout, 0);
 const toMB = i => (i / 1024 / 1024).toFixed(2);

 process.stdout.write(`Audio | ${(tracker.audio.downloaded / tracker.audio.total * 100).toFixed(2)}% processed `);
 process.stdout.write(`(${toMB(tracker.audio.downloaded)}MB of ${toMB(tracker.audio.total)}MB).${' '.repeat(10)}\n`);

 process.stdout.write(`Video | ${(tracker.video.downloaded / tracker.video.total * 100).toFixed(2)}% processed `);
 process.stdout.write(`(${toMB(tracker.video.downloaded)}MB of ${toMB(tracker.video.total)}MB).${' '.repeat(10)}\n`);

 process.stdout.write(`Merged | processing frame ${tracker.merged.frame} `);
 process.stdout.write(`(at ${tracker.merged.fps} fps => ${tracker.merged.speed}).${' '.repeat(10)}\n`);

 process.stdout.write(`running for: ${((Date.now() - tracker.start) / 1000 / 60).toFixed(2)} Minutes.`);
 readline.moveCursor(process.stdout, 0, -3);
};

// Start the ffmpeg child process
const ffmpegProcess = cp.spawn(ffmpeg, [
 // Remove ffmpeg's console spamming
 '-loglevel', '8', '-hide_banner',
 // Redirect/Enable progress messages
 '-progress', 'pipe:3',
 // Set inputs
 '-i', 'pipe:4',
 '-i', 'pipe:5',
 // Map audio & video from streams
 '-map', '0:a',
 '-map', '1:v',
 // Keep encoding
 '-c:v', 'copy',
 // Define output file
 '-f', 'mpegts', // Use MPEG-TS format for streaming
 'out.mp4'
], {
 windowsHide: true,
 stdio: [
 /* Standard: stdin, stdout, stderr */
 'inherit', 'inherit', 'inherit',
 /* Custom: pipe:3, pipe:4, pipe:5 */
 'pipe', 'pipe', 'pipe',
 ],
});
ffmpegProcess.on('close', () => {
 console.log('done');
 // Cleanup
 process.stdout.write('\n\n\n\n');
 clearInterval(progressbarHandle);
});
// Link streams
// FFmpeg creates the transformer streams and we just have to insert / read data
ffmpegProcess.stdio[3].on('data', chunk => {
 // Start the progress bar
 if (!progressbarHandle) progressbarHandle = setInterval(showProgress, progressbarInterval);
 // Parse the param=value list returned by ffmpeg
 const lines = chunk.toString().trim().split('\n');
 const args: any = {};
 for (const l of lines) {
 const [key, value] = l.split('=');
 args[key.trim()] = value.trim();
 }
 tracker.merged = args;
});
audio.pipe(ffmpegProcess.stdio[4]);
video.pipe(ffmpegProcess.stdio[5]);



}`