
Recherche avancée
Autres articles (112)
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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 (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (9999)
-
Ffmpeg send duration of video to client (using node-fluent-ffmpeg)
26 mai 2013, par VprnlI'm really new to the world of ffmpeg so please excuses me if this is a stupid queston.
I'm using the module Node-fluent-ffmpeg to stream a movie and convert it from avi to webm with FFMPEG.
So far so good (it plays the video), but I'm having trouble parsing the duration to the player. It also gives me an error even though I plays the video.
my code is as followed :
var stat = fs.statSync(movie);
var start = 0;
var end = 0;
var range = req.header('Range');
if (range != null) {
start = parseInt(range.slice(range.indexOf('bytes=')+6,
range.indexOf('-')));
end = parseInt(range.slice(range.indexOf('-')+1,
range.length));
}
if (isNaN(end) || end == 0) end = stat.size-1;
if (start > end) return;
var duration = (end / 1024) * 8 / 1024;
res.writeHead(206, { // NOTE: a partial http response
'Connection':'close',
'Content-Type':'video/webm',
'Content-Length':end - start,
'Content-Range':'bytes '+start+'-'+end+'/'+stat.size,
'Transfer-Encoding':'chunked'
});
var proc = new ffmpeg({ source: movie, nolog: true, priority: 1, timeout:15000})
.toFormat('webm')
.addOptions(['-probesize 900000', '-analyzeduration 0', '-minrate 1024k', '-maxrate 1024k', '-bufsize 1835k', '-t '+duration+' -ss'])
.writeToStream(res, function(retcode, error){
if (!error){
console.log('file has been converted succesfully',retcode);
}else{
console.log('file conversion error',error);
}
});I set the header with a start and a end based on this article : http://delog.wordpress.com/2011/04/25/stream-webm-file-to-chrome-using-node-js/
I calculate the length in seconds in the variable duration.
The error FFmpeg is giving me is :
file conversion error ffmpeg version N-52458-gaa96439 Copyright (c) 2000-2013 the FFmpeg developers
built on Apr 24 2013 22:19:32 with gcc 4.8.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --e
nable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable
-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --ena
ble-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwola
me --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enabl
e-libxvid --enable-zlib
libavutil 52. 27.101 / 52. 27.101
libavcodec 55. 6.100 / 55. 6.100
libavformat 55. 3.100 / 55. 3.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 60.101 / 3. 60.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, avi, from 'C:/temp/test.avi':
Metadata:
encoder : Nandub v1.0rc2
Duration: 00:01:09.78, start: 0.000000, bitrate: 1517 kb/s
Stream #0:0: Video: msmpeg4v3 (DIV3 / 0x33564944), yuv420p, 640x352, 23.98 tbr, 23.98 tbn, 23.98 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 222 kb/s
[libvpx @ 0036db20] v1.2.0
Output #0, webm, to 'pipe:1':
Metadata:
encoder : Lavf55.3.100
Stream #0:0: Video: vp8, yuv420p, 640x352, q=-1--1, 200 kb/s, 1k tbn, 23.98 tbc
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
Stream mapping:
Stream #0:0 -> #0:0 (msmpeg4 -> libvpx)
Stream #0:1 -> #0:1 (mp3 -> libvorbis)The client side player (which is VideoJs) says the file is infinite/NaN in length.
I feel like I'm pretty close to a solution but my inexperience with the subject matter prohibits me from getting it to work. If I'm unclear in any way please let me know. (I have a tendency of explaining things fuzzy.)
Thanks in advance !
[EDIT]
I removed the duration bit because it has nothing to do with the issue. I checked the response header of the client and saw :
Accept-Ranges:bytes
Connection:keep-alive
Content-Length:13232127
Content-Range:bytes 0-13232127/13232128
Content-Type:video/webmWhy can't the client figure out the duration even though it receives it in the header ?
-
FFPMEG : stream local file to UDP address, make client aware about video length and current frame time offset (make stream seekable ?)
10 décembre 2014, par klimJust started to use FFMPEG. This is a really great library which is capable of video life transcoding and streaming.
I use following commands to transcode and stream local video file to UDP address :
ffmpeg -y -re -i inputvideo.mpeg2 -vsync 1 -vcodec mpeg4 -b 1600k -r 15 -crf 20 -acodec aac -ar 44100 -strict -2 -f mpegts udp ://192.168.1.30:1234It works smooth. I can open this udp address in VLC player and play life stream.
Does anybody know how to make client aware about video duration and current time stamp ?
Ideally would be nice to make stream seekable, as far as I understand it is not possible, but at least I would like to tell VLC client the total duration of the video and current frame time stamp, so it could show the progress.
Thanks.
-
How to transfer FFmpeg's AVPacket to CUVID's CUVIDSOURCEDATAPACKET ? or how to use FFmpeg's CUVID,any demo ?
17 mars 2017, par SanAs the title said,I was trapped to How to transfer FFmpeg’s AVPacket to CUVID’s CUVIDSOURCEDATAPACKET,and my main code about this question is below :`
AVPacket* avpkt;
avpkt = (AVPacket*)av_malloc(sizeof(AVPacket));
CUVIDSOURCEDATAPACKET cupkt;
int iPkt = 0;
while (av_read_frame(pFormatCtx, avpkt) >= 0) {
if (avpkt->stream_index == videoindex) {
cuCtxPushCurrent(g_oContext);
if (avpkt && avpkt->size) {
cupkt.payload_size = (unsigned long)avpkt->size;
cupkt.payload = (const unsigned char*)avpkt->data;
if (avpkt->pts != AV_NOPTS_VALUE) {
cupkt.flags = CUVID_PKT_TIMESTAMP;
if (pCodecCtx->pkt_timebase.num && pCodecCtx->pkt_timebase.den) {
AVRational tb;
tb.num = 1;
tb.den = AV_TIME_BASE;
cupkt.timestamp = av_rescale_q(avpkt->pts, pCodecCtx->pkt_timebase, tb);
}
else
cupkt.timestamp = avpkt->pts;
}
}
else {
cupkt.flags = CUVID_PKT_ENDOFSTREAM;
}
oResult = cuvidParseVideoData(hParser_, &cupkt);
if ((cupkt.flags & CUVID_PKT_ENDOFSTREAM) || (oResult != CUDA_SUCCESS)) {
break;
}
iPkt++;
printf("Succeed to read avpkt %d !\n", iPkt);
checkCudaErrors(cuCtxPopCurrent(NULL));
}
av_free_packet(avpkt);
}and as you see,the code
cupkt.payload_size = (unsigned long)avpkt->size;
cupkt.payload = (const unsigned char*)avpkt->data;needs to be corrected。
I’m poor at english,I hope I have expressed my self clearly。