
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (69)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (5654)
-
php - convert avi to mp4, webm and flv using ffmpeg command
5 juin 2015, par AishaMy problem is I am trying to convert and upload videos into three formats at upload button. I am stuck at the very first step when i am trying to convert avi to mp4, webm and flv. I have tried various commands to convert in to mp4 and webm but nothing worked. its converting to flv smoothly. i searched a lot on internet but none of the commands worked. i have set execution_time to 0 and set_time_limit(0) as well for unlimited execution time. here are the commands i tried to convert in to mp4 and webm
**For mp4:**
exec("ffmpeg -i input.avi -c:v libx264 -crf 19 output.mp4");
exec("ffmpeg -i input.avi -c:v libx264 -pix_fmt yuv420p output.mp4");
exec("ffmpeg -i input.avi -c:v libx264 -c:a libfaac \ -movflags +faststart output.mp4");
**For webm**
passthru("ffmpeg -i input.avi output.webm");
passthru("ffmpeg -i input.avi -b 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 output.webm");Note :
For avi to mp4 files that are less than 1mb are converting successfully but more than 1mb files are showing its converting but its size is 0bytes.Similarly, i am facing a problem in converting mp4 to flv. Some files are converting and some are not. Some of the large files are converting but some small files are not converting. It was strange. there was no problem of permission or php configuration settings all was fine. I tried renaming a file which was not converting and it got uploaded. I am confused why this happened.
Any help for both the issues is highly appreciated.
Thanks in advance.
Edited
/bin$ ffmpeg -v
ffmpeg version 0.10.15 Copyright (c) 2000-2014 the FFmpeg developers
built on Aug 30 2014 15:49:19 with gcc 4.4.7 20120313 (Red Hat 4.4.7-3)
configuration : —prefix=/usr —bindir=/usr/bin —datadir=/usr/share/ffmpeg —incdir=/usr/include/ffmpeg —libdir=/usr/lib64 —mandir=/usr/share/man —arch=x86_64 —extra-cflags=’-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector —param=ssp-buffer-size=4 -m64 -mtune=generic’ —enable-bzlib —disable-crystalhd —enable-gnutls —enable-libass —enable-libcdio —enable-libcelt —enable-libdc1394 —disable-indev=jack —enable-libfreetype —enable-libgsm —enable-libmp3lame —enable-openal —enable-libopenjpeg —enable-libpulse —enable-librtmp —enable-libschroedinger —enable-libspeex —enable-libtheora —enable-libvorbis —enable-libv4l2 —enable-libx264 —enable-libxvid —enable-x11grab —enable-avfilter —enable-postproc —enable-pthreads —disable-static —enable-shared —enable-gpl —disable-debug —disable-stripping —shlibdir=/usr/lib64 —enable-runtime-cpudetect
libavutil 51. 35.100 / 51. 35.100
libavcodec 53. 61.100 / 53. 61.100
libavformat 53. 32.100 / 53. 32.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 61.100 / 2. 61.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
Missing argument for option ’v’ -
How can I create a write stream for res for a child_process.spawn method as it says cp.spawn().pipe(res) is not a method
11 juin 2022, par niishaaantconst express = require('express');
const router = express.Router();
const ytdl = require('ytdl-core');
const cp = require('child_process');
const ffmpeg = require('ffmpeg-static');

router.get('/', async (req, res) => {
 const { v, f, q } = req.query;
 if (!ytdl.validateID(v) && !ytdl.validateURL(v)) {
 return res
 .status(400)
 .json({ success: false, error: 'No valid YouTube Id!' });
 }
 try {
 let info = await ytdl.getInfo(v);

 //set format and title
 // const title = info.videoDetails.title;
 // res.setHeader('Content-disposition', contentDisposition(`${title}${f}`));

 //define audio and video stream seperately and download them
 const audio = ytdl(v, { quality: 'highestaudio' }).on(
 'progress',
 (_, downloaded, total) => {
 console.log({ downloaded, total });
 }
 );
 let format = ytdl.chooseFormat(info.formats, { quality: q });
 const video = ytdl(v, { format }).on('progress', (_, downloaded, total) => {
 console.log({ downloaded, total });
 });

 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
 `out.${f}`,
 ],
 {
 windowsHide: true,
 stdio: [
 /* Standard: stdin, stdout, stderr */
 'inherit',
 'inherit',
 'inherit',
 /* Custom: pipe:3, pipe:4, pipe:5 */
 'pipe',
 'pipe',
 'pipe',
 ],
 }
 )
 .on('close', () => {
 console.log('done');
 });

 // Link streams
 // FFmpeg creates the transformer streams and we just have to insert / read data
 ffmpegProcess.stdio[3].on('data', (chunk) => {
 // Parse the param=value list returned by ffmpeg
 const lines = chunk.toString().trim().split('\n');
 const args = {};
 for (const l of lines) {
 const [key, value] = l.split('=');
 args[key.trim()] = value.trim();
 }
 });
 audio.pipe(ffmpegProcess.stdio[4]);
 video.pipe(ffmpegProcess.stdio[5]);
 } catch (error) {
 res.status(400);
 console.log('error ', error);
 }
});

module.exports = router;





I am trying to create a youtube downloader app and this is the code for downloading a video using the ytdl and ffmpeg packages in an express route but i don't know how i can download the result (out.mp4) for the client. when I try to pipe it to res error occurs saying cp.spawn().pipe() is not a method.




-
FFMPEG HLS multiple Tracks not in sync
2 juin 2020, par LordFenixNCThis script works but the video doesnt sync with the sub or audio tracks. Could someone help fix this or Help me with a NEW script. I have been trying to figure this out with 0 luck and have had friends look at it. I even went to FFMPEG discord and FB asking for help from others who have posted scripts in the past. Seems no one has a interest in this. Please will someone help me.



All I am trying to do is BULK encode MKVs to HLS with multiple resoutions in 10 sec segments and include all the Audio and SUb tracks that were originally in the MKV



$files = Get-ChildItem ${Get-Location}
$loco = Get-Location
$p1 = Join-Path -Path $loco -ChildPath "/out"
New-Item -ItemType Directory -Force -Path $p1



function lnCodeTransform {
 param( $String )
 echo $String
 switch ($String)
 {
 "jpn" {"jp"}
 "eng" {"en"}
 "esp" {"es"}
 "fra" {"fr"}
 "deu" {"de"}
 default {$String}
 }
}


function lnNameTransform {
 param( $String )
 switch ($String)
 {
 "jpn" {"Japanese"}
 "eng" {"English"}
 "esp" {"Spanish"}
 "fra" {"French"}
 "deu" {"German"}
 default {$String}
 }
}


foreach ($f in $files){ 
 if ($f.Name -eq "out"){
 continue;
 }
 $p2 = Join-Path -Path $loco -ChildPath "/out/" | Join-Path -ChildPath $f
 New-Item -ItemType Directory -Force -Path $p2/audio
 New-Item -ItemType Directory -Force -Path $p2/video
 New-Item -ItemType Directory -Force -Path $p2/subtitle
 $sb = [System.Text.StringBuilder]::new();
 [void]$sb.AppendLine( '#EXTM3U' )
 [void]$sb.AppendLine( '#EXT-X-VERSION:3' )
 #[void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360' )
 #[void]$sb.AppendLine( '360p.m3u8' )


 New-Item -ItemType Directory -Force -Path $p2
 $resStr = ffprobe -v error -select_streams v:0 -show_entries stream=height -of csv=s=x:p=0 $f.FullName;
 $res = [convert]::ToInt32($resStr)
 $audioTracks = ffprobe $f.FullName -show_entries stream=index:stream_tags=language -select_streams a -of compact=p=0:nk=1 
 $audioTracks = $audioTracks.split("\n")
 foreach($audio in $audioTracks) {
 $ID = $audio.split("|")[0];
 $audioName = $audio.split("|")[1];
 ffmpeg -i $f.FullName -threads 0 -muxdelay 0 -y -map 0:$ID -async 1 -codec aac -f segment -segment_time 10 -segment_list_size 0 -segment_list out/$f/audio/audio_"$ID.m3u8" -segment_format mpegts out/$f/audio/"audio_$ID""_%d.ts"
 $name = lnNameTransform($audioName)
 $code = lnCodeTransform($audioName)
 [void]$sb.AppendLine( "#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=`"aac`",LANGUAGE=`"$code`",NAME=`"$name`",DEFAULT=NO,AUTOSELECT=NO,URI=`"audio/audio_$ID.m3u8`"" )
 }
 $subTracks = ffprobe $f.FullName -show_entries stream=index:stream_tags=language -select_streams s -of compact=p=0:nk=1 
 $subTracks = $subTracks.split("")
 foreach($subtitle in $subTracks) {
 $ID = $subtitle.split("|")[0];
 $subName = $subtitle.split("|")[1];
 ffmpeg -i $f.FullName -map 0:$ID -f segment -segment_time 10 -segment_list_size 0 -segment_list out/$f/subtitle/sub_"$subName.m3u8" -segment_format webvtt -scodec webvtt out/$f/subtitle/"sub_$subName%d.vtt"
 $name = lnNameTransform($subName)
 $code = lnCodeTransform($subName)
 [void]$sb.AppendLine( "#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID=`"subs`",LANGUAGE=`"$code`",NAME=`"$name`",FORCED=NO,AUTOSELECT=NO,URI=`"subtitle/sub_$subName.m3u8`"" )
 }

 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=1400000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=842x480,AUDIO="aac",SUBTITLES="subs"' )
 [void]$sb.AppendLine( 'video/480p.m3u8' )
 #ffmpeg -i $f.FullName -c:a copy -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 -vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename out/$f/480p_%03d.ts out/$f/480p.m3u8 -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename out/$f/720p_%03d.ts out/$f/720p.m3u8 -vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 5000k -maxrate 5350k -bufsize 7500k -b:a 192k -hls_segment_filename out/$f/1080p_%03d.ts out/$f/1080p.m3u8
 #ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264 -profile:v main -c:a aac -filter:v scale=360:640 -ar 48000 -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 23 -sc_threshold 0 -g 48 -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -keyint_min 4 -start_number 0 -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -f hls -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 
 #ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264 -profile:v main -c:a aac -filter:v scale=360:640 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 
 ffmpeg -i $f.FullName -c:v h264 -async 1 -profile:v main -y -filter:v scale="trunc(oh*a/2)*2:480" -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/480p_%03d.ts out/$f/video/480p.m3u8
 If($res -ge 720) {
 ffmpeg -i $f.FullName -c:v h264 -profile:v main -filter:v scale="trunc(oh*a/2)*2:720" -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/720p_%03d.ts out/$f/video/720p.m3u8
 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=2800000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=1280x720,AUDIO="aac",SUBTITLES="subs"' )
 [void]$sb.AppendLine( 'video/720p.m3u8' )
 } 
 If($res -ge 1080) {
 ffmpeg -i $f.FullName -c:v h264 -profile:v main -filter:v scale="trunc(oh*a/2)*2:1080" -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/1080p_%03d.ts out/$f/video/1080p.m3u8
 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=5000000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=1920x1080,AUDIO="aac",SUBTITLES="subs"' )
 [void]$sb.AppendLine( 'video/1080p.m3u8' )
 }

 $p3 = Join-Path -Path $p2 -ChildPath "/index.m3u8"
 #echo $index | Out-File -Encoding UTF8 -LiteralPath $p3
 echo $sb.ToString()
 [System.IO.File]::WriteAllLines($p3, $sb.ToString().Trim().replace("`r`n", "`n"))
}
$sw.Stop()
echo $sw.Elapsed ```