
Recherche avancée
Médias (3)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (49)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (8874)
-
Create 1 video using image with length of audio
19 septembre 2017, par VishnuI am trying to create video with the length of an audio file , and 1 single image as the background for whole video.
I use following code
'ffmpeg -y -loop 1 -f image2 -r 24 -i subtitle.jpg -i audio.mp3 -c:v libx264 -c:a copy -shortest video.flv';
But problem is processing time is too slow , and sometime video length is not same as audio length.Can some one suggest me alternative ideas.
p.s : audio length is just 3 to 8 seconds.
Below is my output
ffmpeg version N-83443-gc03029a Copyright (c) 2000-2017 the FFmpeg
developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
configuration : —enable-gpl —enable-version3 —enable-libfdk_aac
—enable-libmp3lame —enable-libtheora —enable-libvorbis —enable-libvpx —enable-libx264 —enable-nonfree —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libgsm —enable-libxvid —disable-static —enable-shared libavutil 55. 46.100 / 55. 46.100 libavcodec 57. 75.100 / 57. 75.100 libavformat 57. 66.101
/ 57. 66.101 libavdevice 57. 2.100 / 57. 2.100 libavfilter 6. 73.100 /
6. 73.100 libswscale 4. 3.101 / 4. 3.101 libswresample 2. 4.100 / 2. 4.100 libpostproc 54. 2.100 / 54. 2.100 Input #0, image2, from ’subtitle/1.jpg’ : Duration : 00:00:00.04, start : 0.000000, bitrate : N/A
Stream #0:0 : Video : mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
1280x720 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 24 tbn, 24 tbc [mp3 @
0x1013ee0] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from ’audio/1.mp3’ : Metadata : encoder : Lavf57.71.100
Duration : 00:00:05.98, start : 0.000000, bitrate : 32 kb/s Stream #1:0 :
Audio : mp3, 22050 Hz, mono, s16p, 32 kb/s No pixel format specified,
yuvj420p for H.264 encoding chosen. Use -pix_fmt yuv420p for
compatibility with outdated media players. [libx264 @ 0x1020600] using
SAR=1/1 [libx264 @ 0x1020600] using cpu capabilities : MMX2 SSE2Fast
SSSE3 SSE4.2 AVX [libx264 @ 0x1020600] profile High, level 3.1
[libx264 @ 0x1020600] 264 - core 148 r2762 90a61ec - H.264/MPEG-4 AVC
codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html -
options : cabac=1 ref=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_pskip=1 chroma_qp_offset=-2
threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=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=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00 Output #0, flv, to ’video/1.flv’ : Metadata : encoder :
Lavf57.66.101 Stream #0:0 : Video : h264 (libx264) ([7][0][0][0] /
0x0007), yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], q=-1—1, 24 fps,
1k tbn, 24 tbc Metadata : encoder : Lavc57.75.100 libx264 Side data :
cpb : bitrate max/min/avg : 0/0/0 buffer size : 0 vbv_delay : -1 Stream0:1 : Audio : mp3 ([2][0][0][0] / 0x0002), 22050 Hz, mono, s16p, 32 kb/s Stream mapping : Stream #0:0 -> #0:0 (mjpeg (native) -> h264
(libx264)) Stream #1:0 -> #0:1 (copy) Press [q] to stop, [?] for help
[image2 @ 0x1011680] Thread message queue blocking ; consider raising
the thread_queue_size option (current value : 8) frame= 32 fps=0.0
q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x frame= 53 fps=
51 q=28.0 size= 210kB time=00:00:00.13 bitrate=13157.8kbits/s
speed=0.126x frame= 73 fps= 47 q=28.0 size= 216kB time=00:00:00.96
bitrate=1828.9kbits/s speed=0.622x frame= 93 fps= 45 q=28.0 size=
221kB time=00:00:01.79 bitrate=1009.9kbits/s speed=0.859x frame= 109
fps= 42 q=28.0 size= 225kB time=00:00:02.45 bitrate= 750.6kbits/s
speed=0.95x frame= 126 fps= 40 q=28.0 size= 230kB time=00:00:03.16
bitrate= 594.3kbits/s speed=1.02x frame= 145 fps= 40 q=28.0 size=
235kB time=00:00:03.95 bitrate= 485.7kbits/s speed=1.09x frame= 162
fps= 39 q=28.0 size= 239kB time=00:00:04.67 bitrate= 419.3kbits/s
speed=1.12x frame= 181 fps= 39 q=28.0 size= 244kB time=00:00:05.46
bitrate= 366.5kbits/s speed=1.17x frame= 193 fps= 33 q=28.0 Lsize=
248kB time=00:00:05.95 bitrate= 340.4kbits/s speed=1.03x video:217kB
audio:23kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead : 2.834417% [libx264 @ 0x1020600] frame I:1 Avg QP:17.19
size:212155 [libx264 @ 0x1020600] frame P:48 Avg QP:18.02 size : 140
[libx264 @ 0x1020600] frame B:144 Avg QP:27.33 size : 43 [libx264 @
0x1020600] consecutive B-frames : 0.5% 0.0% 0.0% 99.5% [libx264 @
0x1020600] mb I I16..4 : 3.1% 86.8% 10.2% [libx264 @ 0x1020600] mb P
I16..4 : 0.0% 0.0% 0.0% P16..4 : 1.0% 0.0% 0.0% 0.0% 0.0% skip:99.0%
[libx264 @ 0x1020600] mb B I16..4 : 0.0% 0.0% 0.0% B16..8 : 0.1% 0.0%
0.0% direct : 0.0% skip:99.8% L0 : 9.1% L1:90.9% BI : 0.0% [libx264 @ 0x1020600] 8x8 transform intra:82.0% inter:55.7% [libx264 @ 0x1020600]
coded y,uvDC,uvAC intra : 87.6% 80.7% 62.5% inter : 0.0% 0.2% 0.0%
[libx264 @ 0x1020600] i16 v,h,dc,p : 76% 22% 2% 1% [libx264 @
0x1020600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu : 11% 15% 24% 7% 9% 7% 10% 6%
10% [libx264 @ 0x1020600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu : 23% 27% 9% 7%
8% 6% 8% 5% 8% [libx264 @ 0x1020600] i8c dc,h,v,p : 55% 23% 14% 8%
[libx264 @ 0x1020600] Weighted P-Frames : Y:0.0% UV:0.0% [libx264 @
0x1020600] ref P L0 : 95.1% 0.1% 3.2% 1.6% [libx264 @ 0x1020600] ref B
L0 : 91.7% 3.3% 5.0% [libx264 @ 0x1020600] ref B L1 : 86.1% 13.9%
[libx264 @ 0x1020600] kb/s:223.84 0 -
Blank video as the result of converting from bmp ffmpeg [duplicate]
1er juin 2021, par Артур Клочко

Update


I'm sorry, as I wrote I tried to play video via different variants and got nothing, but now I send it to myself via Telegram app, and it displays there correctly. It plays via Chrome also. Seems it is not the ffmpeg problem.


I uploaded it to my site, if you are not aware, please check it via stupid uwp app or Windows Media player if you are using Windows, and if you have the same problem, please feedback and I will report it as a bug





Recently I have been using ffmpeg to convert
jpg
file set tomp4
, and it was successfully. I used the next.bat
file to do it :

ffmpeg -framerate 60 -i out\%%d.jpg render.mp4



Now, I am trying to do the same, but with
bmp
files, generated as screenshots using WinApi. Images as themselves are absolutely correct - I can open them via photos app, or anything else. Images resolution is constant and equals 2002x773.

So now I am using the same
.bat
to make video :

ffmpeg -framerate 60 -i out\%%d.bmp render.mp4



It generates a tiny-size video (17 kb, for 10 bmp images, 5 mb each), that is opening by UWP video app or Windows Media program, but nothing is happening - no errors, yet no video length. If there are more images, the result video size also increases, but the video still doesn't play.


Full output from ffmpeg :


ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 9.2.1 (GCC) 20200122
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, image2, from 'rnd\%d.bmp':
 Duration: 00:00:00.17, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: bmp, bgra, 2002x773, 60 tbr, 60 tbn, 60 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (bmp (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 052fed40] using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2
[libx264 @ 052fed40] profile High 4:4:4 Predictive, level 4.2, 4:4:4, 8-bit
[libx264 @ 052fed40] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=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_pskip=1 chroma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=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=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'caev.mp4':
 Metadata:
 encoder : Lavf58.29.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p, 2002x773, q=-1--1, 60 fps, 15360 tbn, 60 tbc
 Metadata:
 encoder : Lavc58.54.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 10 fps=0.0 q=-1.0 Lsize= 16kB time=00:00:00.11 bitrate=1142.4kbits/s speed=0.151x
video:15kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.097639%
[libx264 @ 052fed40] frame I:1 Avg QP:18.80 size: 6840
[libx264 @ 052fed40] frame P:4 Avg QP:25.73 size: 1517
[libx264 @ 052fed40] frame B:5 Avg QP:35.54 size: 426
[libx264 @ 052fed40] consecutive B-frames: 20.0% 40.0% 0.0% 40.0%
[libx264 @ 052fed40] mb I I16..4: 21.1% 76.3% 2.6%
[libx264 @ 052fed40] mb P I16..4: 0.6% 0.3% 0.3% P16..4: 0.9% 0.6% 0.1% 0.0% 0.0% skip:97.0%
[libx264 @ 052fed40] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 4.0% 0.2% 0.0% direct: 0.0% skip:95.6% L0:34.5% L1:64.6% BI: 0.9%
[libx264 @ 052fed40] 8x8 transform intra:73.8% inter:10.2%
[libx264 @ 052fed40] coded y,u,v intra: 1.8% 1.5% 1.5% inter: 0.1% 0.1% 0.1%
[libx264 @ 052fed40] i16 v,h,dc,p: 52% 47% 1% 0%
[libx264 @ 052fed40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 47% 45% 8% 0% 0% 0% 0% 0% 0%
[libx264 @ 052fed40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 31% 32% 3% 0% 1% 2% 5% 2%
[libx264 @ 052fed40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 052fed40] ref P L0: 75.8% 4.1% 15.8% 4.3%
[libx264 @ 052fed40] ref B L0: 63.5% 34.8% 1.7%
[libx264 @ 052fed40] ref B L1: 97.6% 2.4%
[libx264 @ 052fed40] kb/s:721.78



-
How to resize an animated webp?
23 mai 2023, par shsfI want to be able to change the size of a dynamic webp.
Sample picture address : https://postimg.cc/2qpx5bQm
I found this website to do just that : https://ezgif.com/resize


So how can I implement something similar in my own program ?
I tried using ImageMagick7 or ffmpeg5, but failed.


environment :


[developer@Dev_Payment_229 ~]$ cat /etc/redhat-release


CentOS Linux release 7.8.2003 (Core)


1. tried ffmpeg :


[developer@Dev_Payment_229 ~]$ /opt/ffmpeg-5/ffmpeg -i b.webp -vf "scale=320:-1" b_320.webp
ffmpeg version 5.1.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 8 (Debian 8.3.0-6)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
[webp @ 0x7686f40] skipping unsupported chunk: ANIM
[webp @ 0x7686f40] skipping unsupported chunk: ANMF
 Last message repeated 10 times
[webp @ 0x7686f40] image data not found
[webp_pipe @ 0x7685700] Could not find codec parameters for stream 0 (Video: webp, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, webp_pipe, from 'b.webp':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: webp, none, 25 fps, 25 tbr, 25 tbn
Stream mapping:
 Stream #0:0 -> #0:0 (webp (native) -> webp (libwebp_anim))
Press [q] to stop, [?] for help
[webp @ 0x7697600] skipping unsupported chunk: ANIM
[webp @ 0x7697600] skipping unsupported chunk: ANMF
 Last message repeated 10 times
[webp @ 0x7697600] image data not found
Error while decoding stream #0:0: Invalid data found when processing input
Cannot determine format of input stream 0:0 after EOF
Error marking filters as finished
Conversion failed!



It seems that ffmpeg cannot recognize this dynamic webp image.


2. tried ImageMagick7


install :


yum -y install libwebp-devel libwebp-tools
[root@Dev_FTP_241 developer]# yum list installed | grep webp
libwebp.x86_64 0.3.0-11.el7 @updates
libwebp-devel.x86_64 0.3.0-11.el7 @updates
libwebp-tools.x86_64 0.3.0-11.el7 @updates




source code: https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-0.tar.gz
tar -xvf ImageMagick-7.1.1-0.tar.gz
./configure --with-webp --prefix=/usr/local/imagemagick
make
make install



single webp can be resized :


[root@Dev_FTP_241 developer]# /usr/local/imagemagick/bin/convert -resize 480 simple.webp simple_480.webp
Decoded /tmp/magick-LNPdXgk2zDpiuU6Qv9CpDups3560EATh. Dimensions: 2160 x 608. Now saving...
Saved file /tmp/magick-Q8JHRZZOXdp1r1x187eftzsFlw8AqAuo



but animated webp failed :


[root@Dev_FTP_241 developer]# /usr/local/imagemagick/bin/convert -resize 480 b.webp b_480.webp
Error! Decoding of an animated WebP file is not supported.
 Use webpmux to extract the individual frames or
 vwebp to view this image.
Decoding of /tmp/magick-jMiy7ytmAnBzpS8UpafCQ5B44BjDTUSD failed.
Status: 4 (UNSUPPORTED_FEATURE)
convert: delegate failed `'dwebp' -pam '%i' -o '%o'' @ error/delegate.c/InvokeDelegate/1924.
convert: unable to open file '/tmp/magick-D-NMEGWU_a0IypZWwTpYiWIE61nteoig': No such file or directory @ error/constitute.c/ReadImage/786.
convert: no images defined `b_480.webp' @ error/convert.c/ConvertImageCommand/3342.