
Recherche avancée
Autres articles (52)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
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 -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)
Sur d’autres sites (7784)
-
Evolution #4768 : Sus aux préfixes navigateurs
5 mai 2021, par RastaPopoulos ♥Vous avez peut-être déjà vu car ça ressort dans les premiers, mais celui là intègre bien grid, flex, etc + accepte régulièrement les PR, ya des ajouts là en 2021 :
https://github.com/padaliyajay/php-autoprefixer -
ffmpeg can't access to usb webcam from python subprocess.Popen in windows
29 avril 2021, par TomezIf I run the following ffmpeg command from windows cmd it works


ffmpeg -f dshow -i video="USB Video Device" -s 1280x720 -f rawvideo -pix_fmt rgb24 pipe:



I then tried to execute the same in python

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32

args = [
 'ffmpeg', '-f', 'dshow', '-i', 'video=USB Video Device', '-s', '1280x720',
 '-f', 'rawvideo', '-pix_fmt','rgb24', 'pipe:'
]
ffmpeg_proc = subprocess.Popen(args, stdout=subprocess.PIPE)



but I get this error


D:\Projects\Applications\VideoCapture\Virtualenv\Scripts\python.exe D:/Projects/Applications/VideoCapture/Sources/Application/video_capture.py "USB Video Device" 1280 720
ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, dshow, from 'video=USB Video Device':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
video=USB Video Device: I/O error
Output #0, rawvideo, to 'pipe:':
 Metadata:
 encoder : Lavf58.76.100
 Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1280x720, q=2-31, 663552 kb/s, 30 fps, 30 tbn
 Metadata:
 encoder : Lavc58.134.100 rawvideo
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)



The inportant row is USB Video Device : I/O error

I've tried also to add shell=True to the Popen but with the same result.

Doing some tests I found that using pycharm debug mode or simply lunching the same code inside "Pycharm Python Console" no more I/O error and all seems to work. I think something changes in the environment created for the subrocess but I wasn't able to understand what PyCharm is doing under the hood.


Here the output inside PyCharm Python Console


D:\Projects\Applications\VideoCapture\Virtualenv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\plugins\python-ce\helpers\pydev\pydevconsole.py" --mode=client --port=65058
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['D:\\Projects\\Applications\\VideoCapture', 'D:\\Projects\\Applications\\VideoCapture\\Sources\\Application', 'D:\\Projects\\Applications\\VideoCapture\\Sources\\Compiler', 'D:/Projects/Applications/VideoCapture'])
PyDev console: starting.
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
runfile('D:/Projects/Applications/VideoCapture/Sources/Application/video_capture.py', args=['USB Video Device', '1280', '720'], wdir='D:/Projects/Applications/VideoCapture/Sources/Application')
ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, dshow, from 'video=USB Video Device':
 Duration: N/A, start: 111984.462000, bitrate: N/A
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, rawvideo, to 'pipe:':
 Metadata:
 encoder : Lavf58.76.100
 Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24(pc, progressive), 1280x720, q=2-31, 663552 kb/s, 30 fps, 30 tbn
 Metadata:
 encoder : Lavc58.134.100 rawvideo
av_interleaved_write_frame(): Invalid argument
 Last message repeated 1 times
Error writing trailer of pipe:: Invalid argument
frame= 118 fps= 30 q=-0.0 Lsize= 313200kB time=00:00:03.93 bitrate=652306.1kbits/s dup=53 drop=0 speed= 1x



Does anyone now how to fix this problem or have any knowledge on how PyCharm Python Console works ?


-
How to include audio in an overlay ffmpeg command ?
27 avril 2021, par gilad sUsing ffmpeg I add a video overlay successfully over an origin video (origin has audio, overlay doesn't). However the audio of the origin video doesn't appear in the result video.


ffmpeg -i source.mp4 -i overlay.mp4 -filter_complex "[0:v]setpts=PTS-STARTPTS, scale=1280x720[top]; 
 [1:v]setpts=PTS-STARTPTS, scale=1280x720, format=yuva420p, 
 colorchannelmixer=aa=0.2[bottom]; [top][bottom]overlay=shortest=1" 
 -shortest -acodec copy -vcodec libx264 result1.mp4



Even if I execute the following separate command on the result of the previous command - still no audio appears in the new result video.


ffmpeg -i result1.mp4 -i audio.mp3 -c:v copy -c:a aac result2.mp4



Here is the log :


ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
 built with Apple clang version 11.0.0 (clang-1100.0.33.17)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'course/final_video/3008_01_01_01_audio.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Duration: 00:06:01.48, start: 0.000000, bitrate: 215 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 141 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 70 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'images/overlay.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Duration: 00:24:00.38, start: 0.000000, bitrate: 575 kb/s
 Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 442 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
 Metadata:
 handler_name : ISO Media file produced by Google Inc. Created on: 11/22/2020.
 vendor_id : [0][0][0][0]
 Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
 Metadata:
 handler_name : ISO Media file produced by Google Inc. Created on: 11/22/2020.
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 (h264) -> setpts
 Stream #1:0 (h264) -> setpts
 overlay -> Stream #0:0 (libx264)
 Stream #1:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[swscaler @ 0x10c590000] No accelerated colorspace conversion found from yuva420p to argb.
[libx264 @ 0x7fc532813200] using SAR=1/1
[libx264 @ 0x7fc532813200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fc532813200] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x7fc532813200] 264 - core 161 r3049 55d517b - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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
Output #0, mp4, to 'course/final_video/3008_01_01_01_overlay.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn (default)
 Metadata:
 encoder : Lavc58.134.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, 127 kb/s (default)
 Metadata:
 handler_name : ISO Media file produced by Google Inc. Created on: 11/22/2020.
 vendor_id : [0][0][0][0]

Stream mapping:
 Stream #0:0 (h264) -> setpts
 Stream #1:0 (h264) -> setpts
 overlay -> Stream #0:0 (libx264)
 Stream #1:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[swscaler @ 0x10c590000] No accelerated colorspace conversion found from yuva420p to argb.
[libx264 @ 0x7fc532813200] using SAR=1/1
[libx264 @ 0x7fc532813200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fc532813200] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x7fc532813200] 264 - core 161 r3049 55d517b - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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
Output #0, mp4, to 'course/final_video/3008_01_01_01_overlay.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn (default)
 Metadata:
 encoder : Lavc58.134.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, 127 kb/s (default)
 Metadata:
 handler_name : ISO Media file produced by Google Inc. Created on: 11/22/2020.
 vendor_id : [0][0][0][0]
frame= 9037 fps= 32 q=-1.0 Lsize= 20954kB time=00:06:01.62 bitrate= 474.7kbits/s speed=1.26x 
video:15006kB audio:5651kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.439596%
[libx264 @ 0x7fc532813200] frame I:37 Avg QP:14.51 size:123799
[libx264 @ 0x7fc532813200] frame P:2277 Avg QP:16.97 size: 3221
[libx264 @ 0x7fc532813200] frame B:6723 Avg QP:24.31 size: 513
[libx264 @ 0x7fc532813200] consecutive B-frames: 0.8% 0.0% 0.0% 99.2%
[libx264 @ 0x7fc532813200] mb I I16..4: 8.3% 64.9% 26.9%
[libx264 @ 0x7fc532813200] mb P I16..4: 0.5% 1.1% 0.2% P16..4: 16.1% 3.1% 2.3% 0.0% 0.0% skip:76.7%
[libx264 @ 0x7fc532813200] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 10.5% 0.1% 0.0% direct: 0.2% skip:89.2% L0:45.2% L1:54.7% BI: 0.1%
[libx264 @ 0x7fc532813200] 8x8 transform intra:63.6% inter:83.0%
[libx264 @ 0x7fc532813200] coded y,uvDC,uvAC intra: 56.4% 61.0% 42.7% inter: 1.9% 1.9% 0.0%
[libx264 @ 0x7fc532813200] i16 v,h,dc,p: 29% 18% 18% 35%
[libx264 @ 0x7fc532813200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 19% 31% 4% 4% 4% 4% 5% 5%
[libx264 @ 0x7fc532813200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 22% 15% 4% 5% 6% 5% 5% 5%
[libx264 @ 0x7fc532813200] i8c dc,h,v,p: 51% 29% 14% 6%
[libx264 @ 0x7fc532813200] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fc532813200] ref P L0: 66.0% 6.9% 17.0% 10.1%
[libx264 @ 0x7fc532813200] ref B L0: 77.2% 20.6% 2.2%
[libx264 @ 0x7fc532813200] ref B L1: 90.2% 9.8%
[libx264 @ 0x7fc532813200] kb/s:340.06