
Recherche avancée
Médias (2)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (51)
-
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation" -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (6447)
-
Final Rendered Video is Sped Up Compared to Animation Played in Processing
15 janvier 2016, par NightlifeRecently I made an Audio Visualizer in Processing. From there I wanted to render the animation created in Processing into a mp4 file. I am on a windows computer, and am using ffmpeg to convert my TIF files produced in Processing into mp4.
When I do this I am able to render the images into an mp4 file, but when I playback this file the animation is sped up compared to the animation when I play it on Processing. Because of this the animation does not sync with the audio when I combine the mp4 file and audio on a video editing program.
When I set my frame rate to 25 and have the limit on the number of frames to be 250 and render it into a mp4 file it is 10 seconds long like it should be, but it contains more than 10 seconds of the animation when compared to the animation played directly in Processing.
I have no idea why this is so any help will be much appreciated.
My Processing code :
import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioPlayer player;
PImage img;
FFT fft;
void setup() {
size(728, 546);
minim = new Minim(this);
// this loads mysong.wav from the data folder as a stream with a internal buffer of size 1024
player = minim.loadFile("new_years_good.mp3");
fft = new FFT(player.bufferSize(), player.sampleRate());
player.play();
img= loadImage("cat-in-shades-.jpg");
frameRate(25);
}
void draw() {
image(img, 0, 0);
//tint(0, 100, 150);
stroke(255);
strokeWeight(4);
float a = 0;
float angle = (2*PI) / 200;
fft.forward(player.mix);
for(int i=0; i < player.bufferSize() - 1; i++) {
//player.mix.get(i) is a value between [-1,1]
float x = 250 + cos(a) * (20 * player.mix.get(i) + 100);
float x2 = 540 + cos(a) * (20 * player.mix.get(i) + 100);
float y = 230 + sin(a) * (20 * player.mix.get(i) + 100);
float y2 = 240 + sin(a) * (20 * player.mix.get(i) + 100);
float xFinal = 250 + cos(a+angle) * (20 * player.mix.get(i+1) + 100);
float x2Final = 540 + cos(a+angle) * (20 * player.mix.get(i+1) + 100);
float yFinal = 230 + sin(a+angle) * (20 * player.mix.get(i+1) + 100);
float y2Final = 240 + sin(a+angle) * (20 * player.mix.get(i+1) + 100);
line(x,y,xFinal,yFinal);
line(x2,y2,x2Final,y2Final);
a += angle;
}
noStroke();
fill(255, 0, 0, 128);
for(int i = 0; i < 250; i++)
{
float b = fft.getBand(i);
float yAxis = random(-b, b) + 480;
float xAxis = i*3;
ellipse(xAxis, yAxis, b, b);
}
saveFrame("frame-####.tif");
if(frameCount>250)
{
noLoop();
stop();
}
}
void stop() {
player.close();
minim.stop();
super.stop();
}What I input into the command line (as one line) on the cmd :
C:\Users\Robert\Documents\Processing\AudioVisulizer>ffmpeg -i C:\Users\Robert\Do
cuments\Processing\AudioVisulizer\frame-%04d.tif -r 25 -pix_fmt yuv420p smallVid
.mp4What it outputted :
ffmpeg version N-77836-g62dfe1d Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
libavutil 55. 13.100 / 55. 13.100
libavcodec 57. 22.100 / 57. 22.100
libavformat 57. 21.101 / 57. 21.101
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 23.100 / 6. 23.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, image2, from 'C:\Users\Robert\Documents\Processing\AudioVisulizer\fram
e-%04d.tif':
Duration: 00:00:10.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: tiff, rgb24, 728x546, 25 fps, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 00000092cd5e3700] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 00000092cd5e3700] profile High, level 3.0
[libx264 @ 00000092cd5e3700] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_
adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2
5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.6
0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'smallVid.mp4':
Metadata:
encoder : Lavf57.21.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 728x54
6, q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc57.22.100 libx264
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 -> #0:0 (tiff (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 52 fps=0.0 q=28.0 size= 77kB time=00:00:00.00 bitrate=N/A speed=
frame= 74 fps= 65 q=28.0 size= 127kB time=00:00:00.88 bitrate=1178.0kbits/
frame= 93 fps= 57 q=28.0 size= 164kB time=00:00:01.64 bitrate= 820.0kbits/
frame= 113 fps= 52 q=28.0 size= 201kB time=00:00:02.44 bitrate= 676.3kbits/
frame= 136 fps= 51 q=28.0 size= 245kB time=00:00:03.36 bitrate= 596.3kbits/
frame= 157 fps= 49 q=28.0 size= 282kB time=00:00:04.20 bitrate= 550.2kbits/
frame= 178 fps= 48 q=28.0 size= 324kB time=00:00:05.04 bitrate= 527.2kbits/
frame= 199 fps= 47 q=28.0 size= 362kB time=00:00:05.88 bitrate= 504.1kbits/
frame= 219 fps= 46 q=28.0 size= 403kB time=00:00:06.68 bitrate= 494.2kbits/
frame= 242 fps= 46 q=28.0 size= 452kB time=00:00:07.60 bitrate= 486.8kbits/
frame= 251 fps= 38 q=-1.0 Lsize= 623kB time=00:00:09.96 bitrate= 512.3kbits
/s speed=1.52x
video:619kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing o
verhead: 0.607807%
[libx264 @ 00000092cd5e3700] frame I:2 Avg QP:21.74 size: 56596
[libx264 @ 00000092cd5e3700] frame P:66 Avg QP:23.36 size: 2523
[libx264 @ 00000092cd5e3700] frame B:183 Avg QP:31.50 size: 1932
[libx264 @ 00000092cd5e3700] consecutive B-frames: 0.8% 4.0% 6.0% 89.2%
[libx264 @ 00000092cd5e3700] mb I I16..4: 10.9% 72.6% 16.5%
[libx264 @ 00000092cd5e3700] mb P I16..4: 0.0% 0.0% 0.2% P16..4: 4.4% 2.3
% 3.3% 0.0% 0.0% skip:89.7%
[libx264 @ 00000092cd5e3700] mb B I16..4: 0.0% 0.0% 0.5% B16..8: 3.2% 2.0
% 2.3% direct: 1.3% skip:90.7% L0:50.9% L1:42.2% BI: 7.0%
[libx264 @ 00000092cd5e3700] 8x8 transform intra:50.2% inter:10.1%
[libx264 @ 00000092cd5e3700] coded y,uvDC,uvAC intra: 83.4% 32.6% 14.2% inter: 3
.5% 0.2% 0.0%
[libx264 @ 00000092cd5e3700] i16 v,h,dc,p: 22% 8% 8% 62%
[libx264 @ 00000092cd5e3700] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 12% 19% 6% 9%
9% 9% 9% 9%
[libx264 @ 00000092cd5e3700] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 14% 22% 6% 9%
8% 8% 5% 6%
[libx264 @ 00000092cd5e3700] i8c dc,h,v,p: 74% 12% 12% 2%
[libx264 @ 00000092cd5e3700] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000092cd5e3700] ref P L0: 41.8% 3.9% 24.3% 30.0%
[libx264 @ 00000092cd5e3700] ref B L0: 64.5% 25.0% 10.5%
[libx264 @ 00000092cd5e3700] ref B L1: 82.2% 17.8%
[libx264 @ 00000092cd5e3700] kb/s:504.56 -
How to pipe sequence of thumbnails/screenshots from ffmpeg to nodejs for further processing ?
30 décembre 2015, par Dmitry IvanovWhat I want to achieve is to take screenshots continuously and pass them to nodejs application in order to process each one separately and do some other stuff. I need this for Linux environment only. I picked
ffmpeg
withx11grab
as a screenshots provider. The following command works just fine :ffmpeg -t 10 -s 1366x768 -f x11grab -i :0.0+0,0 -vf fps=30 output_%d.png -y
It creates 300 consequent frames of my screen during 10 seconds period. Then I want to redirect the output to my nodejs app rather than just to write files on the hard drive. So I’m calling
ffmpeg
from node :var spawn = require('child_process').spawn,
fps = 30,
duration = 10,
screenSize = {w: 1366, h: 768},
args = [
'-t',
duration,
'-s',
screenSize.w + 'x' + screenSize.h,
'-f',
'x11grab',
'-i',
':0.0',
'-vf',
'fps=' + fps,
'-f',
'mjpeg',
'pipe:1'
],
ff = spawn('ffmpeg', args);
ff.stdout.on('data', function (data) {
console.log('Data size: ' + data.length);
});
ff.stdout.on('end', function (data) {
console.log('Stream end');
});
ff.stderr.on('data', function (data) {
console.log('ff error: ' + data);
});I apologize for a long log, but it’s important :
ff error: ffmpeg version N-77455-g4707497 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
libavutil 55. 11.100 / 55. 11.100
libavcodec 57. 20.100 / 57. 20.100
libavformat 57. 20.100 / 57. 20.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 21.101 / 6. 21.101
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
ff error: Input #0, x11grab, from ':0.0':
Duration: N/A, start: 1451414448.216650, bitrate: N/A
Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x768, 29.97 fps, 29.97 tbr, 1000k tbn,
ff error: 29.97 tbc
ff error: [swscaler @ 0x34238a0] deprecated pixel format used, make sure you did set range correctly
ff error: Output #0, mjpeg, to 'pipe:1':
Metadata:
encoder :
ff error: Lavf57.20.100
Stream #0:0: Video: mjpeg, yuvj444p(pc), 1366x768, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
Metadata:
encoder : Lavc57.20.100 mjpeg
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
ff error: [swscaler @ 0x34238a0] Warning: data is not aligned! This can lead to a speedloss
Data size: 65536
Data size: 65536
Data size: 21413
Data size: 65536
Data size: 65536
Data size: 45581
Data size: 65536
Data size: 65536
Data size: 62377
Data size: 65536
Data size: 65536
Data size: 45581
Data size: 65536
Data size: 65536
Data size: 21413
Data size: 65536
Data size: 60933
Data size: 65536
Data size: 49550
Data size: 65536
Data size: 36709
Data size: 65536
Data size: 27035
Data size: 65536
Data size: 20131
Data size: 65536
Data size: 15887
Data size: 65536
Data size: 15887
Data size: 65536
Data size: 15887
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
ff error: frame= 16 fps=0.0 q=24.8 size= 1819kB time=00:00:00.53 bitrate=27935.6kbits/s speed=1.04x
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15919
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15906
Data size: 65536
Data size: 15906
Data size: 65536
Data size: 15917
Data size: 65536
Data size: 15999
Data size: 65536
Data size: 15949
Data size: 65536
Data size: 15997
Data size: 65536
Data size: 15965
ff error: frame= 32 fps= 30 q=24.8 size= 3092kB time=00:00:01.06 bitrate=23743.7kbits/s speed=1.01x
Data size: 65536
Data size: 16025
Data size: 65536
Data size: 15978
Data size: 65536
Data size: 15963
Data size: 65536
Data size: 16028
Data size: 65536
Data size: 15976
Data size: 65536
Data size: 15958
Data size: 65536
Data size: 15940
Data size: 65536
Data size: 15992
Data size: 65536
Data size: 15962
Data size: 65536
Data size: 16010
Data size: 65536
Data size: 15941
Data size: 65536
Data size: 15941
Data size: 65536
Data size: 15973
Data size: 65536
Data size: 15943
Data size: 65536
Data size: 15947
Data size: 65536
Data size: 15947
ff error: frame= 48 fps= 30 q=24.8 size= 4365kB time=00:00:01.60 bitrate=22349.6kbits/s speed=1.01x
Data size: 65536
Data size: 15982
Data size: 65536
Data size: 15982
Data size: 65536
Data size: 15956
Data size: 65536
Data size: 15956
Data size: 65536
Data size: 15956
Data size: 65536
Data size: 16001
Data size: 65536
Data size: 15930
Data size: 65536
Data size: 15922
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15911
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15985
Data size: 65536
Data size: 15985
ff error: frame= 64 fps= 30 q=24.8 size= 5638kB time=00:00:02.13 bitrate=21651.3kbits/s speed=1.01x
Data size: 65536
Data size: 15985
Data size: 65536
Data size: 15924
Data size: 65536
Data size: 15976
Data size: 65536
Data size: 15976
Data size: 65536
Data size: 15958
Data size: 65536
Data size: 16319
Data size: 65536
Data size: 16558
Data size: 65536
Data size: 16576
Data size: 65536
Data size: 16564
Data size: 65536
Data size: 16582
Data size: 65536
Data size: 16589
Data size: 65536
Data size: 16587
Data size: 65536
Data size: 16446
Data size: 65536
Data size: 16450
Data size: 65536
Data size: 16450
Data size: 65536
Data size: 16450
ff error: frame= 80 fps= 30 q=24.8 size= 6918kB time=00:00:02.66 bitrate=21251.0kbits/s speed=1.01x
Data size: 65536
Data size: 16568
Data size: 65536
Data size: 16575
Data size: 65536
Data size: 16585
Data size: 65536
Data size: 18182
Data size: 65536
Data size: 17203
Data size: 65536
Data size: 16769
Data size: 65536
Data size: 16734
Data size: 65536
Data size: 16823
Data size: 65536
Data size: 16338
Data size: 65536
Data size: 16455
Data size: 65536
Data size: 16406
Data size: 65536
Data size: 16645
Data size: 65536
Data size: 16800
Data size: 65536
Data size: 16800
Data size: 65536
Data size: 16800
Data size: 65536
Data size: 16806
ff error: frame= 96 fps= 30 q=24.8 size= 8204kB time=00:00:03.20 bitrate=21001.8kbits/s speed= 1x
Data size: 65536
Data size: 16795
Data size: 65536
Data size: 16804
Data size: 65536
Data size: 16770
Data size: 65536
Data size: 16760
Data size: 65536
Data size: 16813
Data size: 65536
Data size: 16445
Data size: 65536
Data size: 16259
Data size: 65536
Data size: 16260
Data size: 65536
Data size: 16265
Data size: 65536
Data size: 16284
Data size: 65536
Data size: 16233
Data size: 65536
Data size: 16233
Data size: 65536
Data size: 16182
Data size: 65536
Data size: 16058
Data size: 60561
ff error: frame= 111 fps= 30 q=24.8 size= 9384kB time=00:00:03.70 bitrate=20776.1kbits/s speed= 1x
Data size: 61813
Data size: 61813
Data size: 61813
Data size: 61813
Data size: 61813
Data size: 61781
Data size: 61784
Data size: 61796
Data size: 61842
Data size: 61839
Data size: 61793
Data size: 61810
Data size: 61844
Data size: 61844
Data size: 61850
Data size: 61841
ff error: frame= 127 fps= 30 q=24.8 size= 10350kB time=00:00:04.23 bitrate=20027.8kbits/s speed= 1x
Data size: 61858
Data size: 61853
Data size: 61833
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
ff error: frame= 142 fps= 30 q=24.8 size= 11256kB time=00:00:04.73 bitrate=19480.5kbits/s speed= 1x
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
ff error: frame= 158 fps= 30 q=24.8 size= 12223kB time=00:00:05.26 bitrate=19011.4kbits/s speed= 1x
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61867
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 173 fps= 30 q=24.8 size= 13129kB time=00:00:05.76 bitrate=18650.3kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 188 fps= 30 q=24.8 size= 14035kB time=00:00:06.26 bitrate=18346.6kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 203 fps= 30 q=24.8 size= 14941kB time=00:00:06.76 bitrate=18087.8kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 219 fps= 30 q=24.8 size= 15907kB time=00:00:07.30 bitrate=17850.8kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 234 fps= 30 q=24.8 size= 16813kB time=00:00:07.80 bitrate=17658.1kbits/s speed= 1x
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
Data size: 61850
ff error: frame= 250 fps= 30 q=24.8 size= 17780kB time=00:00:08.33 bitrate=17478.0kbits/s speed= 1x
Data size: 61850
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 61712
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 265 fps= 30 q=24.8 size= 18675kB time=00:00:08.83 bitrate=17319.4kbits/s speed= 1x
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 280 fps= 30 q=24.8 size= 19563kB time=00:00:09.33 bitrate=17171.2kbits/s speed= 1x
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 295 fps= 30 q=24.8 size= 20452kB time=00:00:09.83 bitrate=17038.0kbits/s speed= 1x
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
Data size: 60638
ff error: frame= 300 fps= 30 q=24.8 Lsize= 20748kB time=00:00:10.00 bitrate=16996.6kbits/s speed=0.998x
video:20748kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Stream endThe error messages are weird too, but not the biggest problem for now, so let’s omit them.
Looking at all the data coming from
ffmpeg
I assume that the images are coming as a single stream without any separation. I don’t think that looking into binary data and seeking for certain flag bytes is a good idea to solve the problem and separate the images. The command line I mentioned in the top of the post does separate writes to hard drive that means it produces separate writable streams per each screenshot. And it doesn’t do so for a spawned process from nodejs.What am I missing ?
-
optimizing ffmpeg in windows platform for processing with web-cam
22 août 2013, par user2320537I have to develop a tool in java that will capture frames from webcam, Now what I have done for that is, I have used Runtime class to run ffmpeg and other commands, when it starts capturing frames from my web-cam,
I am using following method for that.public class FFMPEGClass {
private String ffmpegExeLocation, line;
private final String FRAME_DIGITS = "010";
public FFMPEGClass(String capturingDName, String outputImagesLocation, int framesPerSecond) {
ffmpegExeLocation = System.getProperty("user.dir") + "\\bin\\";
System.out.println(ffmpegExeLocation);
try {
System.out.println(ffmpegExeLocation + "ffmpeg -t 100000 "
+ "-f vfwcap -s 640x480 -i 0 -r 1/" + framesPerSecond + " -f image2 " + outputImagesLocation + "\\camera%"+FRAME_DIGITS+"d.jpg");
Process pp = Runtime.getRuntime().exec(ffmpegExeLocation + "ffmpeg -t 100000 "
+ "-f vfwcap -s 640x480 -i 0 -r 1/" + framesPerSecond + " -f image2 " + outputImagesLocation + "\\camera%"+FRAME_DIGITS+"d.jpg");
BufferedReader br = new BufferedReader(new InputStreamReader(pp.getErrorStream()));
while((line = br.readLine()) != null){
System.out.println(line);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}In my case capturingDName is USB2.0 UVC VGA WebCam
outputImagesLocation is e :\myfolder\frames and
framesPerSecond is 10This code works well but it is unable to capture frames efficiently, In other words I want to say that its processing is very slow, can anyone please tell that how can I optimize it so that it can capture frames very fastly.
I have Intel Core i3 processor with 6 GB of RAM
I have already checked many answers from google and stackoverflow but these are not working in my case