
Recherche avancée
Autres articles (55)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
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 (6911)
-
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 -
Prevent output in error log when ffmpeg job is initiated via PHP's shell_exec()
19 janvier 2016, par JakeI’m getting the entire output of the ffmpeg command printed to my server’s error.log — but as far as I can tell, the jobs complete successfully with no error.
Is there any way to suppress the output ? I have seen people append stuff like
>/dev/null 2>/dev/null &
to their command, however that forces the command to return immediately and the job runs in the background. Unfortunately, I need the job to run in the foreground, because I need to do stuff with the output once the job is done.Here’s the command I am running...
shell_exec('ffmpeg -i input.mp4 -f mp4 -c:v libx264 -preset slow -crf 24 -s 1280x720 -c:a libfdk_aac -profile:a aac_he -ar 22050 -b:a 64k -movflags +faststart output-1280x720.mp4');
Here’s the output I am seeing...
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] ffmpeg version N-77432-gc0f67e1 Copyright (c) 2000-2015 the FFmpeg developers
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] built with gcc 4.4.5 (Debian 4.4.5-8)
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] configuration: --prefix=/usr --enable-nonfree --enable-libfreetype --enable-gpl --enable-libx264 --enable-x11grab --enable-zlib --enable-libvpx --enable-libtheora --enable-libvorbis --enable-libfdk-aac --enable-libmp3lame --enable-libopus
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libavutil 55. 11.100 / 55. 11.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libavcodec 57. 19.100 / 57. 19.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libavformat 57. 20.100 / 57. 20.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libavdevice 57. 0.100 / 57. 0.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libavfilter 6. 21.100 / 6. 21.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libswscale 4. 0.100 / 4. 0.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libswresample 2. 0.101 / 2. 0.101
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] libpostproc 54. 0.100 / 54. 0.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test-video.mp4':
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Metadata:
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] major_brand : mp42
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] minor_version : 0
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] compatible_brands: mp42mp41
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] creation_time : 2015-07-14 22:13:20
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Duration: 00:00:10.51, start: 0.000000, bitrate: 17178 kb/s
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 17170 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Metadata:
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] creation_time : 2015-07-14 22:13:20
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] handler_name : Alias Data Handler
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] encoder : AVC Coding
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (test-video-480p.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Codec AVOption profile () specified for output file #0 (test-video-480p.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] [libx264 @ 0x4518ea0] using SAR=1280/1281
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] [libx264 @ 0x4518ea0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] [libx264 @ 0x4518ea0] profile High, level 3.0
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] [libx264 @ 0x4518ea0] 264 - core 120 r2151 a3f4407 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 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_pskip=1 chroma_qp_offset=-2 threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=24.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Output #0, mp4, to 'test-video-480p.mp4':
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Metadata:
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] major_brand : mp42
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] minor_version : 0
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] compatible_brands: mp42mp41
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] encoder : Lavf57.20.100
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc (default)
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Metadata:
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] creation_time : 2015-07-14 22:13:20
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] handler_name : Alias Data Handler
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] encoder : Lavc57.19.100 libx264
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Side data:
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] unknown side data type 10 (24 bytes)
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Stream mapping:
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
[Tue Jan 19 17:10:59 2016] [error] [client XXX.XXX.XXX.XXX] Press [q] to stop, [?] for help
[Tue Jan 19 17:11:00 2016] [error] [client XXX.XXX.XXX.XXX] frame= 24 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x \r
[Tue Jan 19 17:11:00 2016] [error] [client XXX.XXX.XXX.XXX] frame= 53 fps= 51 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x \r
[Tue Jan 19 17:11:02 2016] [error] [client XXX.XXX.XXX.XXX] frame= 62 fps= 25 q=29.0 size= 75kB time=00:00:00.00 bitrate=N/A speed= 0x \r
[Tue Jan 19 17:11:02 2016] [error] [client XXX.XXX.XXX.XXX] frame= 68 fps= 20 q=29.0 size= 90kB time=00:00:00.25 bitrate=2946.8kbits/s speed=0.0745x \r
[Tue Jan 19 17:11:03 2016] [error] [client XXX.XXX.XXX.XXX] frame= 74 fps= 18 q=29.0 size= 103kB time=00:00:00.50 bitrate=1689.9kbits/s speed=0.12x \r
[Tue Jan 19 17:11:04 2016] [error] [client XXX.XXX.XXX.XXX] frame= 80 fps= 16 q=29.0 size= 115kB time=00:00:00.75 bitrate=1258.5kbits/s speed=0.148x \r
[Tue Jan 19 17:11:05 2016] [error] [client XXX.XXX.XXX.XXX] frame= 86 fps= 15 q=29.0 size= 128kB time=00:00:01.00 bitrate=1049.4kbits/s speed=0.175x \r
[Tue Jan 19 17:11:05 2016] [error] [client XXX.XXX.XXX.XXX] frame= 92 fps= 15 q=29.0 size= 140kB time=00:00:01.25 bitrate= 917.2kbits/s speed=0.201x \r
[Tue Jan 19 17:11:06 2016] [error] [client XXX.XXX.XXX.XXX] frame= 94 fps= 14 q=29.0 size= 146kB time=00:00:01.33 bitrate= 895.4kbits/s speed=0.196x \r
[Tue Jan 19 17:11:07 2016] [error] [client XXX.XXX.XXX.XXX] frame= 100 fps= 13 q=29.0 size= 158kB time=00:00:01.58 bitrate= 816.6kbits/s speed=0.211x \r -
FFMPEG crop video output is black screen, sound is good [on hold]
11 janvier 2016, par Oum AlaaI cropped a video using ffmpeg command line, the output is black screen, the sound is clear and good :
ffmpeg -i Original.mp4 -t 00:00:29 -vf "crop=634:300:0:60" Done.mp4
ffmpeg version :
ffmpeg version 0.8.17-4:0.8.17-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
built on Mar 16 2015 13:26:50 with gcc 4.6.3
video information :
mediainfo '--Inform=Video;%Width%x%Height%' Original.mp4
634x360Thanks in advance