
Recherche avancée
Médias (1)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
Autres articles (42)
-
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. -
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...) -
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 (6569)
-
How to parallelize this for loop for rapidly converting YUV422 to RGB888 ?
16 avril 2015, par vineetI am using v4l2 api to grab images from a Microsoft Lifecam and then transferring these images over TCP to a remote computer. I am also encoding the video frames into a MPEG2VIDEO using ffmpeg API. These recorded videos play too fast which is probably because not enough frames have been captured and due to incorrect FPS settings.
The following is the code which converts a YUV422 source to a RGB888 image. This code fragment is the bottleneck in my code as it takes nearly 100 - 150 ms to execute which means I can’t log more than 6 - 10 FPS at 1280 x 720 resolution. The CPU usage is 100% as well.
for (int line = 0; line < image_height; line++) {
for (int column = 0; column < image_width; column++) {
*dst++ = CLAMP((double)*py + 1.402*((double)*pv - 128.0)); // R - first byte
*dst++ = CLAMP((double)*py - 0.344*((double)*pu - 128.0) - 0.714*((double)*pv - 128.0)); // G - next byte
*dst++ = CLAMP((double)*py + 1.772*((double)*pu - 128.0)); // B - next byte
vid_frame->data[0][line * frame->linesize[0] + column] = *py;
// increment py, pu, pv here
}’dst’ is then compressed as jpeg and sent over TCP and ’vid_frame’ is saved to the disk.
How can I make this code fragment faster so that I can get atleast 30 FPS at 1280x720 resolution as compared to the present 5-6 FPS ?
I’ve tried parallelizing the for loop across three threads using p_thread, processing one third of the rows in each thread.
for (int line = 0; line < image_height/3; line++) // thread 1
for (int line = image_height/3; line < 2*image_height/3; line++) // thread 2
for (int line = 2*image_height/3; line < image_height; line++) // thread 3This gave me only a minor improvement of 20-30 milliseconds per frame.
What would be the best way to parallelize such loops ? Can I use GPU computing or something like OpenMP ? Say spwaning some 100 threads to do the calculations ?I also noticed higher frame rates with my laptop webcam as compared to the Microsoft USB Lifecam.
Here are other details :
- Ubuntu 12.04, ffmpeg 2.6
- AMG-A8 quad core processor with 6GB RAM
- Encoder settings :
- codec : AV_CODEC_ID_MPEG2VIDEO
- bitrate : 4000000
- time_base : (AVRational)1, 20
- pix_fmt : AV_PIX_FMT_YUV420P
- gop : 10
- max_b_frames : 1
-
ffmpeg rtmp live stream to Azure Media Services
18 mars 2015, par PilskalnsSomehow I got publishing Azure Media Services to work, except there is huge frame drop (almost every frame) with those settings :
ffmpeg -i "http://stream01/hls/live/playlist-mid.m3u8" -strict -2 -c:a aac -b:a 192k
-ar 44100 -r 25 -g 60 -keyint_min 60 -b:v 2000k -c:v libx264 -bufsize 2000k
-maxrate 2000k -f flv "rtmp://publishurl.working.is/mystream1"+ I can’t play URL from Azure.
When I publish to local nginx-rtmp server, frame drop stays and despite it I can play it. So, I believe that frame drop is ffmpeg related not Azure. Processor is not overloaded, available bandwidth is excellent.
When I try
original
settings from this URL (at very bottom), I this get additionaly this ffmpeg errorPast duration 0.719994 too large
Here’s more from output :
c:\ffmpeg\bin>ffmpeg -i "http://stream01/hls/live/playlist-mid.m3u8" -strict -2 -c:a aac -b:a 192k -ar 44100 -r 25 -g 60 -keyint_min 60 -b:v 2000k -c:
v libx264 -bufsize 1000k -maxrate 2000k -f flv "rtmp://********.channel.mediaservices.windows.net:1935/live/9590f0be/mystream1"
ffmpeg version N-69972-g6c91afe Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-l
ibrtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --ena
ble-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 19.100 / 54. 19.100
libavcodec 56. 25.100 / 56. 25.100
libavformat 56. 23.100 / 56. 23.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.100 / 5. 11.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, hls,applehttp, from 'http://stream01/hls/live/playlist-mid.m3u8':
Duration: N/A, start: 3314.605633, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 1500000
Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv), 854x480 [SAR 1:1 DAR 427:240], 50 fps, 50 tbr, 90k tbn, 100 tbc
Metadata:
variant_bitrate : 1500000
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 216 kb/s
Metadata:
variant_bitrate : 1500000
[libx264 @ 0000000000306280] using SAR=1/1
[libx264 @ 0000000000306280] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0000000000306280] profile High, level 3.0
[libx264 @ 0000000000306280] 264 - core 144 r2525 40bb568 - 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 dead
zone=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_in
tra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=60 keyint_min=31 scenecut=40 intra_refresh=0 rc_lookahea
d=40 rc=cbr mbtree=1 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2000 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.
40 aq=1:1.00
Output #0, flv, to 'rtmp://*******.channel.mediaservices.windows.net:1935/live/37b4e25/mystream1':
Metadata:
encoder : Lavf56.23.100
Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=-1--1, 2000 kb/s, 25 fps, 1k tbn, 25 tbc
Metadata:
variant_bitrate : 1500000
encoder : Lavc56.25.100 libx264
Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 192 kb/s
Metadata:
variant_bitrate : 1500000
encoder : Lavc56.25.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
[flv @ 0000000000305820] Failed to update header with correct duration.1.4kbits/s dup=0 drop=10697
[flv @ 0000000000305820] Failed to update header with correct filesize.
frame=10714 fps= 24 q=-1.0 Lsize= 100583kB time=00:07:11.08 bitrate=1911.4kbits/s dup=0 drop=10701
video:90024kB audio:10042kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.516478%
[libx264 @ 0000000000306280] frame I:190 Avg QP:10.58 size: 72438
[libx264 @ 0000000000306280] frame P:3406 Avg QP:14.32 size: 19296
[libx264 @ 0000000000306280] frame B:7118 Avg QP:19.55 size: 1784
[libx264 @ 0000000000306280] consecutive B-frames: 8.8% 4.4% 10.5% 76.3%
[libx264 @ 0000000000306280] mb I I16..4: 23.0% 20.2% 56.8%
[libx264 @ 0000000000306280] mb P I16..4: 2.7% 4.5% 5.2% P16..4: 41.9% 11.6% 8.7% 0.0% 0.0% skip:25.4%
[libx264 @ 0000000000306280] mb B I16..4: 0.1% 0.1% 0.2% B16..8: 26.5% 2.2% 0.5% direct: 3.2% skip:67.1% L0:51.0% L1:38.2% BI:10.8%
[libx264 @ 0000000000306280] 8x8 transform intra:31.3% inter:36.6%
[libx264 @ 0000000000306280] coded y,uvDC,uvAC intra: 80.5% 73.5% 51.1% inter: 16.1% 18.8% 5.8%
[libx264 @ 0000000000306280] i16 v,h,dc,p: 21% 29% 27% 23%
[libx264 @ 0000000000306280] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 32% 19% 4% 4% 4% 5% 4% 7%
[libx264 @ 0000000000306280] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 30% 15% 4% 5% 5% 5% 4% 5%
[libx264 @ 0000000000306280] i8c dc,h,v,p: 38% 30% 24% 8%
[libx264 @ 0000000000306280] Weighted P-Frames: Y:1.8% UV:0.4%
[libx264 @ 0000000000306280] ref P L0: 78.0% 8.5% 10.1% 3.3% 0.0%
[libx264 @ 0000000000306280] ref B L0: 91.3% 7.9% 0.8%
[libx264 @ 0000000000306280] ref B L1: 95.4% 4.6%
[libx264 @ 0000000000306280] kb/s:1716.97
Received signal 2: terminating. -
Can't obtain information with ffmpeg from Smooth Streaming Manifest file
5 mars 2015, par AlbertoI’m trying to get details for a stream of protocol Microsoft Smooth Streaming, with ffmpeg tools (ffprobe and ffplay) but when I run the next command :
ffprobe -i http://b31282.cdn.telefonica.com/31282/Manifest
I obtain this :
http://b31282.cdn.telefonica.com/31282/Manifest: Invalid data found when processing input
I assume that this Manifest file is correct and complies with standards of Smooth Streaming . This is a brief extract of Manifest file :
<smoothstreamingmedia majorversion="2" minorversion="0" duration="0" timescale="10000000" islive="TRUE" lookaheadfragmentcount="2" dvrwindowlength="6000000000" canseek="TRUE" canpause="TRUE">
<protection>
<protectionheader systemid="9a04f079-9840-4286-ab92-e65be0885f95">oioAAAIAAQCUAjwAV...</protectionheader>
</protection>
<streamindex type="audio" language="esp" subtype="" chunks="0" timescale="10000000" url="QualityLevels({bitrate})/Fragments(audio_esp={start time})"></streamindex>
<streamindex type="video" language="" subtype="" chunks="0" timescale="10000000" url="QualityLevels({bitrate})/Fragments(video={start time})"></streamindex>
</smoothstreamingmedia>Is a Fedora 21 and ffmpeg version and configuration is :
ffmpeg version git-2015-02-27-d490b26
configuration: --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
libavutil 54. 19.100
libavcodec 56. 26.100
libavformat 56. 23.105
libavdevice 56. 4.100
libavfilter 5. 11.102
libswscale 3. 1.101
libswresample 1. 1.100
libpostproc 53. 3.100PD : I prefer use only ffmpeg tool
PD2 : Same thing with a Microsoft Smooth Streaming Manifest file :
ffmpeg -i http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest
Invalid data found when processing inputThanks for all