
Recherche avancée
Autres articles (25)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Emballe Médias : Mettre en ligne simplement des documents
29 octobre 2010, parLe plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (4981)
-
capture my webcam and encode to mp4 with ffmpeg, but the x264 works bad
17 septembre 2015, par zhangxm1991here is my version :
ffmpeg version : 2.3.3
libx264 version:142.xI wat to capture my video and use ffmpeg and x264 to a mp4 file. the solution is 320x240.
But i found that the video file is so big. Then i found that the P frame and B frame is very big, even nearly equal to the I frame.I do not know why.here is my code :
c->codec_id = codec_id;
c->bit_rate = 400000;
c->width = 320;
c->height = 240;
c->time_base.den = 10;
c->time_base.num = 1;
c->pix_fmt = AV_PIX_FMT_YUV420P;Here is my program output :
[libx264 @ 0xb6200fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0xb6200fc0] profile High, level 1.3
[libx264 @ 0xb6200fc0] 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=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/home/2014_09_12/0002b6429579/5/2014_09_12_18_39_12_600.mp4':
Stream #0:0: Video: h264 (libx264), yuv420p, 320x240, q=-1--1, 400 kb/s, 10 tbc
Stream #0:1: Audio: aac, 8000 Hz, mono, fltp, 32 kb/s
[mp4 @ 0xb62005e0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
[mp4 @ 0xb62005e0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
[mp4 @ 0xb62005e0] Encoder did not produce proper pts, making some up.
[libx264 @ 0xb6200fc0] frame I:3 Avg QP: 2.79 size: 72996
[libx264 @ 0xb6200fc0] frame P:383 Avg QP: 0.14 size: 54075
[libx264 @ 0xb6200fc0] frame B:216 Avg QP: 1.95 size: 64784
[libx264 @ 0xb6200fc0] consecutive B-frames: 30.1% 63.2% 6.0% 0.7%
[libx264 @ 0xb6200fc0] mb I I16..4: 16.1% 12.7% 71.2%
[libx264 @ 0xb6200fc0] mb P I16..4: 3.5% 5.1% 15.9% P16..4: 20.3% 22.8% 14.0% 0.0% 0.0% skip:18.3%
[libx264 @ 0xb6200fc0] mb B I16..4: 0.4% 2.5% 8.2% B16..8: 32.6% 19.8% 13.5%
direct:22.2% skip: 0.8% L0:25.5% L1:12.8% BI:61.6%
[libx264 @ 0xb6200fc0] final ratefactor: -32.89
[libx264 @ 0xb6200fc0] 8x8 transform intra:21.0% inter:29.6%
[libx264 @ 0xb6200fc0] coded y,uvDC,uvAC intra: 100.0% 100.0% 100.0% inter: 83.3% 80.9% 80.9%
[libx264 @ 0xb6200fc0] i16 v,h,dc,p: 5% 7% 42% 46%
[libx264 @ 0xb6200fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 12% 23% 8% 6% 6% 8% 9% 14%
[libx264 @ 0xb6200fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 11% 19% 10% 8% 8% 10% 10% 12%
[libx264 @ 0xb6200fc0] i8c dc,h,v,p: 78% 3% 4% 15%
[libx264 @ 0xb6200fc0] Weighted P-Frames: Y:0.5% UV:0.3%
[libx264 @ 0xb6200fc0] ref P L0: 43.4% 14.6% 19.0% 22.9% 0.1%
[libx264 @ 0xb6200fc0] ref B L0: 63.3% 35.7% 1.1%
[libx264 @ 0xb6200fc0] ref B L1: 97.0% 3.0%
[libx264 @ 0xb6200fc0] kb/s:4.53
[aac @ 0xb6201ba0] 2 frames left in the queue on closing -
Capture Video with opencv, save to ffmpeg pipe and live stream
9 mars 2018, par ChrisThe goal is to stream an analysed live video over RTSP to some media server. To make the edits/analysis I use opencv, save the edited frames as JPEG in an FFMPEG image pipe and use the same FFMPEG to create a RTSP stream. Sorry if the terminology is not that accurate, I find it still quite confusing.
I have the following code after quite some struggle :
import cv2
from subprocess import Popen, PIPE
from PIL import Image
# open pipe
p = Popen('ffmpeg -y -f image2pipe -vcodec mjpeg -r 24 -i - -vcodec h264 -f rtsp -rtsp_transport tcp rtsp://localhost:8081/test.sdp', stdin=PIPE)
video = cv2.VideoCapture(0)
i = 0
while video.isOpened():
i=i+1
ret, frame = video.read()
if ret:
#[...do some analysis stuff]
im = Image.fromarray(frame)
im.save(p.stdin, 'JPEG')
"""
alternatively
img_str = cv2.imencode('.jpg', frame)[1].tostring()
p.stdin.write(img_str)
"""
else:
break
print (i)
if(i==1000):
break
p.stdin.close()
p.wait()
video.release()
cv2.destroyAllWindows()
print("done streaming video")This runs for 124 frames (i=124) then the loop hangs and I get some message from ffmpeg where I am not sure what it is about, however it does not look like an error :
push frame
122
push frame
123
push frame
124
Input #0, image2pipe, from 'pipe:':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 640x480 [SAR 1:1 DAR 4:3], 24 fps, 24 tbr, 24 tbn, 24 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
[libx264 @ 000002076650d980] using SAR=1/1
[libx264 @ 000002076650d980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 000002076650d980] profile High, level 3.0
[libx264 @ 000002076650d980] 264 - core 155 r2893 b00bcaf - 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=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=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
push frameThe webcam seems to continue running but no more frames are pushed into the pipe. It looks like some buffer is filled or something. If I write directly to a video file instead of rtsp, it works. If I open the rtsp stream simultaneously with ffplay, it also works (although with a 5 seconds lag).
Anyone an idea where this is coming from and how to solve it ? -
FFmpeg DTS out of order
23 septembre 2016, par Tim'sI’m having this problem when I want to concat and record two mp4 vids with ffmpeg. The output I get is :
[concat @ 0x2566e80] DTS 4079 < 8156 out of order0:02:43.12 bitrate= 291.3kbits/s
Complete output :
/opt/ffmpeg/ffmpeg -f concat -i liste.txt -strict -2 -c:v libx264 -c:a aac output.mp4
ffmpeg version N-66233-g16de4d9 Copyright (c) 2000-2014 the FFmpeg developers
built on Sep 11 2014 18:19:48 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --enable-gpl --enable-libx264
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, concat, from 'liste.txt':
Duration: N/A, start: 0.000000, bitrate: 681 kb/s
Stream #0:0: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 636x360, 585 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc
Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s
[libx264 @ 0x278f760] using cpu capabilities: MMX2 SSE2Fast SSSE3
[libx264 @ 0x278f760] profile High, level 3.0
[libx264 @ 0x278f760] 264 - core 142 r2431 ac76440 - 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 trel lis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 in terlaced=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:
encoder : Lavf56.4.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 636x360, q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc56.1.100 libx264
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc56.1.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[concat @ 0x2690e00] DTS 4079 < 8156 out of order0:02:43.12 bitrate= 676.2kbits/s
frame= 5060 fps= 10 q=28.0 Lsize= 20857kB time=00:06:44.60 bitrate= 422.3kbits/s dup=0 drop=5055
video:14484kB audio:6193kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.864065%
[libx264 @ 0x278f760] frame I:27 Avg QP:19.39 size: 27262
[libx264 @ 0x278f760] frame P:2986 Avg QP:24.08 size: 3879
[libx264 @ 0x278f760] frame B:2047 Avg QP:26.48 size: 1228
[libx264 @ 0x278f760] consecutive B-frames: 34.9% 30.6% 8.8% 25.7%
[libx264 @ 0x278f760] mb I I16..4: 10.8% 45.8% 43.4%
[libx264 @ 0x278f760] mb P I16..4: 4.0% 7.1% 3.5% P16..4: 25.5% 11.1% 4.2% 0.0% 0.0% skip:44.6%
[libx264 @ 0x278f760] mb B I16..4: 0.4% 0.6% 0.8% B16..8: 23.8% 5.9% 1.2% direct: 1.0% skip:66.4% L0:51.2% L1:42.6% BI: 6.2%
[libx264 @ 0x278f760] 8x8 transform intra:47.3% inter:58.5%
[libx264 @ 0x278f760] coded y,uvDC,uvAC intra: 51.2% 63.2% 24.8% inter: 10.5% 13.1% 1.1%
[libx264 @ 0x278f760] i16 v,h,dc,p: 18% 46% 10% 26%
[libx264 @ 0x278f760] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 29% 20% 4% 4% 4% 5% 5% 6%
[libx264 @ 0x278f760] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 23% 13% 5% 7% 7% 7% 6% 6%
[libx264 @ 0x278f760] i8c dc,h,v,p: 48% 26% 19% 8%
[libx264 @ 0x278f760] Weighted P-Frames: Y:2.2% UV:1.6%
[libx264 @ 0x278f760] ref P L0: 78.9% 11.3% 7.2% 2.6% 0.0%
[libx264 @ 0x278f760] ref B L0: 94.7% 4.9% 0.4%
[libx264 @ 0x278f760] ref B L1: 97.8% 2.2%
[libx264 @ 0x278f760] kb/s:586.22I have also tried others ffmepg options like :
-preset -vcodec libx264 -crf 25 -s 360x288 -vpre veryslow -c aac -ar 44100 -ab 56k
with no success. Can someone help me ?