
Recherche avancée
Autres articles (78)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, 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 (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (11836)
-
FFMPEG result video freezes in the middle of playback
10 mai 2013, par RevoluziferI'm trying stitch four source videos together into one grid. For testing purposes I'm working with a single source flv using this command :
ffmpeg -i woohoo.flv -i woohoo.flv -i woohoo.flv -i woohoo.flv \
-filter_complex "[0:0]pad=iw:ih[a];[1:0]scale=w=iw/2:h=ih/2[b];
[2:0]scale=w=iw/2:h=ih/2[c];[3:0]scale=w=iw/2:h=ih/2[d];
[0:0]scale=w=iw/2:h=ih/2[e];[a][b]overlay=w[x];[x][c]overlay=0:h[y];
[y][d]overlay=w:h[z];[z][e]overlay=0:0" -qscale 1 stitched.aviThe stitching itself is working great, but somehow the resulting video does not show as expected.
After running for a few frames, it gets stuck at a single frame for most of the video, skipping the frames which should be there.While encoding ffmpeg throws a freaking lot of messages like :
[Parsed_overlay_8 @ 000000000459e080] Buffer queue overflow, dropping.
Any hints on how to solve my problem ?
My source flv is h.264 encoded, coming from Red5 media server.Edit : Output is :
root@s15757871:/opt/red5/webapps/woohoo/streams# ffmpeg -i out_3.mp4 -i 3.mp4 -filter_complex "[0:0]pad=iw:ih[a];[1:0]scale=w=iw/2:h=ih/2[b];[a][b]overlay=w:h" -vcodec libx264 -r 30 -acodec copy out_final.mp4
ffmpeg version N-52943-g500220a Copyright (c) 2000-2013 the FFmpeg developers
built on May 10 2013 09:46:03 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
configuration: --enable-gpl --enable-libx264 --enable-libmp3lame --enable-nonfree --enable-libaacplus
libavutil 52. 30.100 / 52. 30.100
libavcodec 55. 7.100 / 55. 7.100
libavformat 55. 4.101 / 55. 4.101
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 63.101 / 3. 63.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out_3.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.4.101
Duration: 00:00:26.53, start: 0.000000, bitrate: 513 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 447 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, mono, s16p, 62 kb/s
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '3.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.4.101
Duration: 00:00:26.60, start: 0.000000, bitrate: 639 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 574 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, mono, s16p, 62 kb/s
Metadata:
handler_name : SoundHandler
File 'out_final.mp4' already exists. Overwrite ? [y/N] y
[libx264 @ 0x19baee0] using SAR=1/1
[libx264 @ 0x19baee0] using cpu capabilities: MMX2 SSE2Fast SSEMisalign LZCNT
[libx264 @ 0x19baee0] profile High, level 3.0
[libx264 @ 0x19baee0] 264 - core 132 r2310 76a5c3a - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - 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 'out_final.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.4.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 15360 tbn, 30 tbc
Stream #0:1(und): Audio: mp3 (i[0][0][0] / 0x0069), 44100 Hz, mono, 62 kb/s
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 (h264) -> pad
Stream #1:0 (h264) -> scale
overlay -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Buffer queue overflow, dropping. 583kB time=00:00:08.00 bitrate= 597.3kbits/s
[Parsed_overlay_2 @ 0x19be420] Buffer queue overflow, dropping.
Last message repeated 202 times
frame= 795 fps= 96 q=-2.0 Lsize= 1700kB time=00:00:27.04 bitrate= 514.9kbits/s dup=203 drop=0
video:1487kB audio:196kB subtitle:0 global headers:0kB muxing overhead 1.025454%
[libx264 @ 0x19baee0] frame I:4 Avg QP:19.83 size: 34019
[libx264 @ 0x19baee0] frame P:322 Avg QP:22.85 size: 3858
[libx264 @ 0x19baee0] frame B:469 Avg QP:24.57 size: 305
[libx264 @ 0x19baee0] consecutive B-frames: 13.8% 15.8% 20.0% 50.3%
[libx264 @ 0x19baee0] mb I I16..4: 10.5% 47.8% 41.7%
[libx264 @ 0x19baee0] mb P I16..4: 1.4% 3.0% 0.8% P16..4: 27.1% 14.4% 9.2% 0.0% 0.0% skip:44.1%
[libx264 @ 0x19baee0] mb B I16..4: 0.0% 0.1% 0.0% B16..8: 15.3% 1.5% 0.2% direct: 0.3% skip:82.6% L0:39.7% L1:53.8% BI: 6.5%
[libx264 @ 0x19baee0] 8x8 transform intra:56.6% inter:64.9%
[libx264 @ 0x19baee0] coded y,uvDC,uvAC intra: 58.4% 72.9% 39.0% inter: 8.3% 11.9% 1.0%
[libx264 @ 0x19baee0] i16 v,h,dc,p: 63% 18% 10% 10%
[libx264 @ 0x19baee0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 17% 20% 4% 7% 9% 6% 6% 8%
[libx264 @ 0x19baee0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 21% 13% 5% 7% 8% 6% 6% 7%
[libx264 @ 0x19baee0] i8c dc,h,v,p: 52% 18% 22% 9%
[libx264 @ 0x19baee0] Weighted P-Frames: Y:7.5% UV:4.0%
[libx264 @ 0x19baee0] ref P L0: 70.8% 16.9% 9.3% 2.8% 0.2%
[libx264 @ 0x19baee0] ref B L0: 90.6% 8.1% 1.3%
[libx264 @ 0x19baee0] ref B L1: 96.4% 3.6%
[libx264 @ 0x19baee0] kb/s:459.39The source mp4 files used here have successfully been converted from flv by ffmpeg before.
-
Create Panorama from Non-Sequential Video Frames
6 mai 2021, par M.InnatThere is a similar question (not that detailed and no exact solution).



I want to create a single panorama image from video frames. And for that, I need to get minimum non-sequential video frames at first. A demo video file is uploaded here.


What I Need


A mechanism that can produce not-only non-sequential video frames but also in such a way that can be used to create a panorama image. A sample is given below. As we can see to create a panorama image, all the input samples must contain minimum overlap regions to each other otherwise it can not be done.




So, if I have the following video frame's order


A, A, A, B, B, B, B, C, C, A, A, C, C, C, B, B, B ...



To create a panorama image, I need to get something as follows - reduced sequential frames (or adjacent frames) but with minimum overlapping.


[overlap] [overlap] [overlap] [overlap] [overlap]
 A, A,B, B,C, C,A, A,C, C,B, ...



What I've Tried and Stuck


A demo video clip is given above. To get non-sequential video frames, I primarily rely on
ffmpeg
software.

Trial 1 Ref.


ffmpeg -i check.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB -map 0:v out.mp4



After that, on the
out.mp4
, I applied slice the video frames usingopencv


import cv2, os 
from pathlib import Path

vframe_dir = Path("vid_frames/")
vframe_dir.mkdir(parents=True, exist_ok=True)

vidcap = cv2.VideoCapture('out.mp4')
success,image = vidcap.read()
count = 0

while success:
 cv2.imwrite(f"{vframe_dir}/frame%d.jpg" % count, image) 
 success,image = vidcap.read()
 count += 1



Next, I rotated these saved images horizontally (as my video is a vertical view).


vframe_dir = Path("out/")
vframe_dir.mkdir(parents=True, exist_ok=True)

vframe_dir_rot = Path("vframe_dir_rot/")
vframe_dir_rot.mkdir(parents=True, exist_ok=True)

for i, each_img in tqdm(enumerate(os.listdir(vframe_dir))):
 image = cv2.imread(f"{vframe_dir}/{each_img}")[:, :, ::-1] # Read (with BGRtoRGB)
 
 image = cv2.rotate(image,cv2.cv2.ROTATE_180)
 image = cv2.rotate(image,cv2.ROTATE_90_CLOCKWISE)

 cv2.imwrite(f"{vframe_dir_rot}/{each_img}", image[:, :, ::-1]) # Save (with RGBtoBGR)



The output is ok for this method (with
ffmpeg
) but inappropriate for creating the panorama image. Because it didn't give some overlapping frames sequentially in the results. Thus panorama can't be generated.



Trail 2 - Ref


ffmpeg -i check.mp4 -vf decimate=cycle=2,setpts=N/FRAME_RATE/TB -map 0:v out.mp4



didn't work at all.


Trail 3


ffmpeg -i check.mp4 -ss 0 -qscale 0 -f image2 -r 1 out/images%5d.png



No luck either. However, I've found this last
ffmpeg
command was close by far but wasn't enough. Comparatively to others, this gave me a small amount of non-duplicate frames (good) but the bad thing is stilldo not need
frames, and I kinda manually pick some desired frames, and then theopecv
stitching algorithm works. So, after picking some frames and rotating (as mentioned before) :

stitcher = cv2.Stitcher.create()
status, pano = stitcher.stitch(images) # images: manually picked video frames -_- 





Update


After some trials, I am kinda adopting the non-programming solution. But would love to see an efficient programmatic approach.


On the given demo video, I used
Adobe
products (premiere pro
andphotoshop
) to do this task, video instruction. But the issue was, I kind of took all video frames at first (without dropping to any frames and that will computationally cost further) viapremier
and usephotoshop
to stitching them (according to the youtube video instruction). It was too heavy for these editor tools and didn't look better way but the output was better than anything until now. Though I took few (400+ frames) video frames only out of 1200+.




Here are some big challenges. The original video clips have some conditions though, and it's too serious. Unlike the given demo video clips :


- 

- It's not straight forward, i.e. camera shaking
- Lighting condition, i.e. causes different visual look at the same spot
- Cameral flickering or banding








This scenario is not included in the given demo video. And this brings additional and heavy challenges to create panorama images from such videos. Even with the non-programming way (using
adobe
tools) I couldn't make it any good.


However, for now, all I'm interest to get a panorama image from the given demo video which is without the above condition. But I would love to know any comment or suggestion on that.


-
Set input frame rate in pygame.Camera
14 mai 2018, par Thomas HubregtsenI am trying to get an input stream from a webcam on OS X
self.capture = pygame.camera('/dev/video{}'.format(camera),
(640, 480), 'RGB')I get an error (see below), but there are 2 pieces of information that I can not really stitch together. On first sight, it looks like I do not have the correct camera (not video4linux). However, when running
ffmpeg -f avfoundation -list_devices true -i ""
I get it listed
[AVFoundation input device @ 0x7fbb45700340] [1] FULL HD 1080P Webcam
The next part of the error talks about frame rate. It appears that the frame-rate is slightly off, and that I just next to select a different frame rate. Would this be possible with pygcam ? Would this solve my problem ?
Error :
Traceback (most recent call last):
File "webcam2.py", line 129, in <module>
VideoStreaming("52.191.118.156", 5558, 1)()
File "webcam2.py", line 22, in __call__
with self.get_camera_context(self.camera_id) as frames:
File "webcam2.py", line 89, in __enter__
size=(640, 480))
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/core/functions.py", line 129, in get_reader
return format.get_reader(request)
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/core/format.py", line 169, in get_reader
return self.Reader(self, request)
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/core/format.py", line 218, in __init__
self._open(**self.request.kwargs.copy())
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 327, in _open
self._load_infos()
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 476, in _load_infos
(self.request._video, ffmpeg_err))
IndexError: No video4linux camera at <video1>.
FFMPEG STDERR OUTPUT:
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/Users/q433100/temp/brew-master/Cellar/ffmpeg/3.4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[avfoundation @ 0x7fbb9e000a00] Selected framerate (29.970030) is not supported by the device
[avfoundation @ 0x7fbb9e000a00] Supported modes:
[avfoundation @ 0x7fbb9e000a00] 160x120@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 176x144@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 320x240@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 352x288@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x360@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x480@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 800x600@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1024x576@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 960x720@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1280x720@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1392x768@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1280x960@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1600x896@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1920x1080@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 160x120@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 176x144@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 320x240@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 352x288@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x360@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x480@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 800x600@[20.000000 20.000000]fps
[avfoundation @ 0x7fbb9e000a00] 1024x576@[8.000000 8.000000]fps
[avfoundation @ 0x7fbb9e000a00] 960x720@[15.000015 15.000015]fps
1: Input/output error
</video1></module>Update :
If I try to force one of the mentioned supported frame rates with ffmped, I get a new error$ffmpeg -f avfoundation -r 30.000030 -i "1" out.mpg
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/Users/q433100/temp/brew-master/Cellar/ffmpeg/3.4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[avfoundation @ 0x7fb3c8802600] An error occurred: The activeVideoMinFrameDuration passed is not supported by the device. Use -activeFormat.videoSupportedFrameRateRanges to discover valid ranges.1: Input/output errorUpdate 2 :
Setting the input frame rate to 15 directly in ffmpeg works. Now I just need to figure out how to do this in python with pygame.camera$ ffmpeg -f avfoundation -r 15.000015 -i "1" out.avi