
Recherche avancée
Autres articles (41)
-
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 -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (7829)
-
How to put video on top of overlay using FFmpeg ?
23 juillet 2020, par user3058763How to merge a video and an image (or a black overlay) to get the video on top ?


Input video is already prepared for this (its maximum width/height is 1920x1080) and needs to stay at original size.


This is how it should look like :



orange is an overlay/image (1920x1080px),
pink is a video on top of it (and centered)


The best shot so far I've got :


ffplay -vf "pad=1920:1080:(ow-iw)/2:(oh-ih)/2" input.mp4



this most likely works, but I can't save the image to check.


But this does nothing to the video :


ffmpeg -i input.mp4 -vf "pad=1920:1080:(ow-iw)/2:(oh-ih)/2" output.mp4



Bonus points if you know how to put an image instead of black overlay.
Thank you !


Full logs of the command (output video remains the same resolution as input) :


ffmpeg -i input.mp4 -vf "pad=1920:1080:(ow-iw)/2:(oh-ih)/2" output.mp4

ffmpeg version git-2020-07-21-b5f1e05 Copyright (c) 2000-2020 the FFmpeg developers
 built with Apple clang version 11.0.0 (clang-1100.0.33.17)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-b5f1e05_2 --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-demuxer=dash --disable-libjack --disable-indev=jack --enable-opencl --enable-videotoolbox --disable-htmlpages --enable-libbs2b --enable-libcaca --enable-libfdk-aac --enable-libgsm --enable-libmodplug --enable-libopenh264 --enable-libopenjpeg --enable-librav1e --enable-librsvg --enable-librtmp --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtesseract --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libwavpack --enable-libwebp --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-openssl --enable-nonfree --enable-decklink --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/include --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb
 libavutil 56. 55.100 / 56. 55.100
 libavcodec 58. 97.100 / 58. 97.100
 libavformat 58. 49.100 / 58. 49.100
 libavdevice 58. 11.101 / 58. 11.101
 libavfilter 7. 87.100 / 7. 87.100
 libswscale 5. 8.100 / 5. 8.100
 libswresample 3. 8.100 / 3. 8.100
 libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.49.100
 Duration: 00:00:20.70, start: 0.000000, bitrate: 1068 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 9:20 DAR 4:5], 1051 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : Bento4 Video Handler
 Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 handler_name : SoundHandler
File 'output.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7fee16819000] using SAR=9/20
[libx264 @ 0x7fee16819000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fee16819000] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x7fee16819000] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=12 lookahead_threads=2 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 'output.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.49.100
 Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 9:20 DAR 4:5], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
 Metadata:
 handler_name : Bento4 Video Handler
 encoder : Lavc58.97.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 encoder : Lavc58.97.100 aac
frame= 621 fps= 38 q=-1.0 Lsize= 7148kB time=00:00:20.60 bitrate=2842.6kbits/s speed=1.26x 
video:7138kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.139421%
[libx264 @ 0x7fee16819000] frame I:5 Avg QP:20.79 size: 38334
[libx264 @ 0x7fee16819000] frame P:255 Avg QP:23.03 size: 19776
[libx264 @ 0x7fee16819000] frame B:361 Avg QP:25.79 size: 5745
[libx264 @ 0x7fee16819000] consecutive B-frames: 5.3% 48.6% 8.7% 37.4%
[libx264 @ 0x7fee16819000] mb I I16..4: 27.2% 69.6% 3.3%
[libx264 @ 0x7fee16819000] mb P I16..4: 10.6% 19.1% 0.4% P16..4: 36.9% 4.7% 1.3% 0.0% 0.0% skip:26.9%
[libx264 @ 0x7fee16819000] mb B I16..4: 0.9% 1.6% 0.0% B16..8: 22.5% 1.9% 0.2% direct: 0.5% skip:72.4% L0:46.0% L1:51.5% BI: 2.5%
[libx264 @ 0x7fee16819000] 8x8 transform intra:63.7% inter:94.6%
[libx264 @ 0x7fee16819000] coded y,uvDC,uvAC intra: 28.2% 36.6% 1.0% inter: 5.6% 6.3% 0.0%
[libx264 @ 0x7fee16819000] i16 v,h,dc,p: 7% 31% 6% 56%
[libx264 @ 0x7fee16819000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 37% 22% 2% 4% 2% 7% 1% 3%
[libx264 @ 0x7fee16819000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 38% 13% 2% 8% 4% 10% 2% 2%
[libx264 @ 0x7fee16819000] i8c dc,h,v,p: 70% 20% 8% 3%
[libx264 @ 0x7fee16819000] Weighted P-Frames: Y:0.4% UV:0.0%
[libx264 @ 0x7fee16819000] ref P L0: 58.3% 7.7% 26.8% 7.3% 0.0%
[libx264 @ 0x7fee16819000] ref B L0: 85.5% 12.3% 2.1%
[libx264 @ 0x7fee16819000] ref B L1: 97.8% 2.2%
[libx264 @ 0x7fee16819000] kb/s:2824.45
[aac @ 0x7fee1681a800] Qavg: 65536.000



-
ffmpeg : Extract unknown data stream from video container
23 juillet 2020, par PikkostackI have a .MOV container which contains the following tracks :


Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 100619 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
 creation_time : 2020-07-21T22:48:24.000000Z
 handler_name : DJI.AVC
 encoder : AVC encoder
Stream #0:1(eng): Data: none (priv / 0x76697270), 87 kb/s
Metadata:
 creation_time : 2020-07-21T22:48:24.000000Z
 handler_name : DJI.Meta
Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 2 kb/s (default)
Metadata:
 creation_time : 2020-07-21T22:48:24.000000Z
 handler_name : DJI.Subtitle



As you can see, stream #0:1, called DJI.meta, is of an unknown data format. I just want to extract the raw data of this stream to a file. So that is the ffmpeg command I tried :


ffmpeg -i .\DJI_0001.MOV -map 0:1 metadata



But using this command results in the following error :


Unable to find a suitable output format for 'metadata'
metadata: Invalid argument



How can I tell ffmpeg that the data should not be formated, so that only the raw data is extracted ?


-
ffmpeg segmentation filter don't works with strftime filename template
24 juillet 2020, par Ksnadr RenderonI try to run ffmpeg with segment filter and timestamp filename template :


ffmpeg -f v4l2 -framerate 30 -video_size 960x720 -i /dev/video0 -f segment -segment_time 5 -reset_timestamps 1 -segment_format mp4 -strftime 1 out%Y-%m-%d_%H-%M-%S.mp4



and i got error :


Invalid segment filename template 'out%Y-%m-%d_%H-%M-%S.mp4'



I have read a lot of posts and questions in the internet with the same arguments (after input, which is specific) and people says that this works. What wrong with my command ?


UPD : add full ffmpeg log


root@nanopiair:~# ffmpeg -f v4l2 -framerate 30 -video_size 960x720 -i /dev/video0 -f segment -segment_time 5 -reset_timestamps 1 -segment_format mp4 -strftime 1 out%Y-%m-%d_%H-%M-%S.mp4
ffmpeg version git-2015-01-22-f86a076 Copyright (c) 2000-2014 the FFmpeg developers
 built on Jul 22 2020 12:02:39 with gcc 8 (Debian 8.3.0-6)
 configuration: --prefix=/usr --enable-nonfree --enable-gpl --enable-vdpau --enable-libx264 --enable-libv4l2 --enable-libfreetype --enable-libfontconfig --enable-libfribidi
 libavutil 54. 6.100 / 54. 6.100
 libavcodec 56. 0.101 / 56. 0.101
 libavformat 56. 2.100 / 56. 2.100
 libavdevice 56. 0.100 / 56. 0.100
 libavfilter 5. 0.102 / 5. 0.102
 libswscale 3. 0.100 / 3. 0.100
 libswresample 1. 1.100 / 1. 1.100
 libpostproc 53. 0.100 / 53. 0.100
Input #0, video4linux2,v4l2, from '/dev/video0':
 Duration: N/A, start: 2548.007454, bitrate: 248832 kb/s
 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 960x720, 248832 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[libx264 @ 0x201bec0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x201bec0] profile High, level 3.1
[libx264 @ 0x201bec0] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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=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
[mp4 @ 0x2507bd0] Invalid segment filename template 'out%Y-%m-%d_%H-%M-%S.mp4'
Output #0, segment, to 'out%Y-%m-%d_%H-%M-%S.mp4':
 Metadata:
 encoder : Lavf56.2.100
 Stream #0:0: Video: h264 (libx264), yuv420p, 960x720, q=-1--1, 30 fps, 30 tbn, 30 tbc
 Metadata:
 encoder : Lavc56.0.101 libx264
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument