
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (45)
-
Participer à sa documentation
10 avril 2011La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
Pour ce faire, vous pouvez vous inscrire sur (...) -
Encodage et transformation en formats lisibles sur Internet
10 avril 2011MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...) -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)
Sur d’autres sites (5857)
-
webm local udp streaming using FFMPEG
1er octobre 2013, par sinivI was just started to use ffmpeg recently and stumbled on this streaming problem.
Scenario : i want to live stream a webcam in local network. Both server and client will be using windows platform.Current feasible solution : using ffmpeg simple command line
to test it quickly i tried to locally stream it (the input doesn't really matter btw in this question).
On server -> ffmpeg -f dshow -i video="cam1":audio="mic1" -r 30 -g 0 -vcodec h264 -acodec libmp3lame -tune zerolatency -preset ultrafast -f mpegts udp://localhost:6789
On client(the same computer) -> ffplay udp://localhost:6789The above works just fine, except for the latency, which i'm getting at about 1-2 second delay.
Now i want to try to change the encoder to use libvpx (vp8) for video and vorbis for audio (i changed the input to a pre-recorded h264 video, but it really doesn't matter)
On server
>ffmpeg -i "suits.mp4" -r 30 -g 0 -vcodec libvpx -acodec vorbis -strict -2 -f webm -f mpegts udp://localhost:6789
On client(the same computer) -> ffplay udp://localhost:6789
However this doesn't work... And below are console outputs:
> onserver ->
> ffmpeg version N-56165-gae12d65 Copyright (c) 2000-2013 the FFmpeg
> developers built on Sep 10 2013 19:42:46 with gcc 4.7.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 43.100 / 52. 43.100 libavcodec 55. 31.101 / 55. 31.101 libavformat 55. 16.102 / 55. 16.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 84.100 / 3. 84.100 libswscale 2. 5.100 /
> 2. 5.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Suits.mp4': Metadata:
> major_brand : isom
> minor_version : 1
> compatible_brands: isom
> creation_time : 2011-09-08 11:43:25 Duration: 00:42:14.87, start: 0.000000, bitrate: 882 kb/s
> Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x402 [SAR 1:1 DAR 120:67], 750 kb/s, 23.98 fps,
> 23.98 tbr, 24k tbn, 47.95 tbc (default)
> Metadata:
> creation_time : 2011-09-08 11:43:25
> Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)
> Metadata:
> creation_time : 2011-09-08 11:43:25 [libvpx @ 05392a80] v1.2.0 Output #0, mpegts, to 'udp://localhost:6789': Metadata:
> major_brand : isom
> minor_version : 1
> compatible_brands: isom
> encoder : Lavf55.16.102
> Stream #0:0(und): Video: vp8 (libvpx), yuv420p, 720x402 [SAR 1:1 DAR 120:67], q=-1--1, 200 kb/s, 90k tbn, 30 tbc (default)
> Metadata:
> creation_time : 2011-09-08 11:43:25
> Stream #0:1(und): Audio: vorbis, 48000 Hz, stereo, fltp (default)
> Metadata:
> creation_time : 2011-09-08 11:43:25 Stream mapping: Stream #0:0 -> #0:0 (h264 -> libvpx) Stream #0:1 -> #0:1 (aac -> vorbis) Press [q] to stop, [?] for help frame=42535 fps= 51 q=0.0 Lsize=
> 143539kB time=00:23:38.28 bitrate= 829.1kbits/s dup=8541 drop=0
> video:99155kB audio:28125kB subtitle:0 global headers:3kB muxing
> overhead 12.772155% Received signal 2: terminating.
> on client
> ffplay version N-56165-gae12d65 Copyright (c) 2003-2013 the FFmpeg
> developers built on Sep 10 2013 19:42:46 with gcc 4.7.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 43.100 / 52. 43.100 libavcodec 55. 31.101 / 55. 31.101 libavformat 55. 16.102 / 55. 16.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 84.100 / 3. 84.100 libswscale 2. 5.100 /
> 2. 5.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100
> nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 [mpegts @ 02eb8620] probed stream 0 failed
> nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 [mp3 @ 02ed75a0] Header missing
> Last message repeated 1 times [mp3 @ 02ed75a0] Header missing
> La Last message repeated 13 times
> nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 [mp3 @ 02ed75a0] Header missing Last message repeated 13 times
> nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 [mp3 @ 02ed75a0] Header missing Last message repeated 9 times
> nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 [mp3 @ 02ed75a0] Header missing [mpegts @ 02eb8620] decoding for
> stream 1 failed [mpegts @ 02eb8620] Could not find codec parameters
> for stream 0 (Unknown: none ([6][0][0][0] / 0x0006)): unknown codec
> Consider increasing the value for the 'analyzeduration' and
> 'probesize' options [mpegts @ 02eb8620] Could not find codec
> parameters for stream 1 (Audio: mp3 ([6][0][0][0] / 0x0006), 0
> channels, s16p): unspecified frame size Consider increasing the value
> for the 'analyzeduration' and 'probesize' options
> udp://localhost:6789: could not find codec parametersSo does the point to point streaming for ffmpeg just doesn't work for vp8 or am i missing something ? Btw, the end goal is to create a similar video chat based framework and i'll appreciate any suggestion. I'm reading up on webRTC now.
-
ffmpeg options for playing in iPad WebView with tag
19 septembre 2013, par Waynn LueI'm trying to convert a video to be played in a tag in a WebView in iOS. I've tried the options at this link but it still doesn't seem to play. I've found videos that do successfully play, though, so I'm sure it's possible, I just can't seem to get any working. Here's the ffmpeg -i output for something that works.
Here's what I tried from the wiki :
ffmpeg -i {filename} -acodec aac -ac 2 -strict experimental -ab 160k -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 {filename}.ipad.mp4
But the file doesn't play in the WebView.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.m4v' : Metadata : major_brand : M4V minor_version : 1 compatible_brands : M4V M4A mp42isom creation_time : 2005-12-20 20:20:15 Duration : 00:01:25.50, start : 0.000000, bitrate : 209 kb/s Stream #0:0(eng) : Audio : aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 115 kb/s Metadata : creation_time : 2005-12-20 20:20:15 handler_name : Apple Sound Media Handler Stream #0:1(eng) : Video : h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x240, 90 kb/s, 10 fps, 10 tbr, 1k tbn, 2k tbc Metadata : creation_time : 2005-12-20 20:20:15 handler_name : Apple Video Media Handler
And here's the output for my input file :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cheerfulness.mov' : Metadata : major_brand : qt minor_version : 537199360 compatible_brands : qt creation_time : 2013-07-31 00:47:22 Duration : 00:00:06.00, start : 0.000000, bitrate : 120849 kb/s Stream #0:0(eng) : Video : h264 (Main) (avc1 / 0x31637661), yuv420p, 1200x1920, 120823 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc Metadata : creation_time : 2013-07-31 00:48:33 handler_name : Apple Alias Data Handler
edit : Here's the full output of the command :
wlue :$ ffmpeg -i cheerfulness.mov -acodec aac -ac 2 -strict experimental -ab 160k -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 output.ipad.mp4 ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers built on Sep 18 2013 18:44:15 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration : —prefix=/usr/local/Cellar/ffmpeg/1.2.1 —enable-shared —enable-pthreads —enable-gpl —enable-version3 —enable-nonfree —enable-hardcoded-tables —enable-avresample —enable-vda —cc=cc —host-cflags= —host-ldflags= —enable-libx264 —enable-libfaac —enable-libmp3lame —enable-libxvid libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cheerfulness.mov' : Metadata : major_brand : qt minor_version : 537199360 compatible_brands : qt creation_time : 2013-07-31 00:47:22 Duration : 00:00:06.01, start : 0.000000, bitrate : 120849 kb/s Stream #0:0(eng) : Video : h264 (Main) (avc1 / 0x31637661), yuv420p, 1200x1920, 120823 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc Metadata : creation_time : 2013-07-31 00:48:33 handler_name : Apple Alias Data Handler Please use -b:a or -b:v, -b is ambiguous [libx264 @ 0x7fa67401fa00] frame MB size (75x120) > level limit (1620) [libx264 @ 0x7fa67401fa00] DPB size (5 frames, 17280000 bytes) > level limit (0 frames, 3110400 bytes) [libx264 @ 0x7fa67401fa00] MB rate (269730) > level limit (40500) [libx264 @ 0x7fa67401fa00] using cpu capabilities : MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX [libx264 @ 0x7fa67401fa00] profile Constrained Baseline, level 3.0 [libx264 @ 0x7fa67401fa00] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options : cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 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=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=1200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=10000 vbv_bufsize=10000 nal_hrd=none ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'output.ipad.mp4' : Metadata : major_brand : qt minor_version : 537199360 compatible_brands : qt encoder : Lavf54.63.104 Stream #0:0(eng) : Video : h264 ([33][0][0][0] / 0x0021), yuv420p, 1200x1920, q=-1—1, 1200 kb/s, 30k tbn, 29.97 tbc Metadata : creation_time : 2013-07-31 00:48:33 handler_name : Apple Alias Data Handler Stream mapping : Stream #0:0 -> #0:0 (h264 -> libx264) Press [q] to stop, [?] for help frame= 180 fps= 16 q=-1.0 Lsize= 828kB time=00:00:06.00 bitrate=1129.2kbits/s video:826kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.177851% [libx264 @ 0x7fa67401fa00] frame I:2 Avg QP:32.23 size : 20942 [libx264 @ 0x7fa67401fa00] frame P:178 Avg QP:41.03 size : 4515 [libx264 @ 0x7fa67401fa00] mb I I16..4 : 90.1% 0.0% 9.9% [libx264 @ 0x7fa67401fa00] mb P I16..4 : 6.8% 0.0% 0.0% P16..4 : 16.8% 0.6% 0.2% 0.0% 0.0% skip:75.5% [libx264 @ 0x7fa67401fa00] final ratefactor : 37.56 [libx264 @ 0x7fa67401fa00] coded y,uvDC,uvAC intra : 1.2% 16.4% 2.1% inter : 0.1% 3.4% 0.1% [libx264 @ 0x7fa67401fa00] i16 v,h,dc,p : 49% 23% 4% 24% [libx264 @ 0x7fa67401fa00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu : 13% 8% 36% 8% 12% 9% 8% 4% 2% [libx264 @ 0x7fa67401fa00] i8c dc,h,v,p : 88% 6% 5% 1% [libx264 @ 0x7fa67401fa00] ref P L0 : 47.7% 22.0% 16.7% 5.7% 7.9% [libx264 @ 0x7fa67401fa00] kb/s:1126.21
-
KLV data in RTP stream
18 septembre 2013, par ArdoramorI have implemented RFC6597 to stream KLV is RTP SMPTE336M packets. Currently, my SDP looks like this :
v=2
o=- 0 0 IN IP4 127.0.0.1
s=Unnamed
i=N/A
c=IN IP4 192.168.1.6
t=0 0
a=recvonly
m=video 8202 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=428028;sprop-parameter-sets=Z0KAKJWgKA9E,aM48gA==;
a=control:trackID=0
m=application 8206 RTP/AVP 97
a=rtpmap:97 smpte336m/1000
a=control:trackID=1I try to remux the RTP stream with FFmpeg like so :
ffmpeg.exe -i test.sdp -map 0:0 -map 0:1 -c:v copy -c:d copy test.m2ts
I get the following output with FFmpeg :
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 28 2013 00:34:08 with gcc 4.8.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[aac @ 0000000002137900] Sample rate index in program config element does not match the sample rate index configured by the container.
Last message repeated 1 times
[aac @ 0000000002137900] decode_pce: Input buffer exhausted before END element found
[h264 @ 00000000002ce540] Missing reference picture, default is 0
[h264 @ 00000000002ce540] decode_slice_header error
[sdp @ 00000000002cfa80] Estimating duration from bitrate, this may be inaccurate
Input #0, sdp, from 'C:\Users\dragan\Documents\Workspace\Android\uvlens\tests\test.sdp':
Metadata:
title : Unnamed
comment : N/A
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: aac, 32000 Hz, 58 channels, fltp
Stream #0:1: Video: h264 (Baseline), yuv420p, 640x480, 14.83 tbr, 90k tbn, 180k tbc
Stream #0:2: Data: none
File 'C:\Users\dragan\Documents\Workspace\Android\uvlens\tests\test.m2ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'C:\Users\dragan\Documents\Workspace\Android\uvlens\tests\test.m2ts':
Metadata:
title : Unnamed
comment : N/A
encoder : Lavf54.63.104
Stream #0:0: Video: h264, yuv420p, 640x480, q=2-31, 90k tbn, 90k tbc
Stream #0:1: Data: none
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0000000002159940] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 8583659665 >= 8583656110
av_interleaved_write_frame(): Invalid argumentThe problem is that KLV stream packets do not contain have a DTS field. According to the RFC6597 STMPE336M, RTP packet structure is the same as a standard structure :
4.1. RTP Header Usage
This payload format uses the RTP packet header fields as described in
the table below:
+-----------+-------------------------------------------------------+
| Field | Usage |
+-----------+-------------------------------------------------------+
| Timestamp | The RTP Timestamp encodes the instant along a |
| | presentation timeline that the entire KLVunit encoded |
| | in the packet payload is to be presented. When one |
| | KLVunit is placed in multiple RTP packets, the RTP |
| | timestamp of all packets comprising that KLVunit MUST |
| | be the same. The timestamp clock frequency is |
| | defined as a parameter to the payload format |
| | (Section 6). |
| | |
| M-bit | The RTP header marker bit (M) is used to demarcate |
| | KLVunits. Senders MUST set the marker bit to '1' for |
| | any RTP packet that contains the final byte of a |
| | KLVunit. For all other packets, senders MUST set the |
| | RTP header marker bit to '0'. This allows receivers |
| | to pass a KLVunit for parsing/decoding immediately |
| | upon receipt of the last RTP packet comprising the |
| | KLVunit. Without this, a receiver would need to wait |
| | for the next RTP packet with a different timestamp to |
| | arrive, thus signaling the end of one KLVunit and the |
| | start of another. |
+-----------+-------------------------------------------------------+
The remaining RTP header fields are used as specified in [RFC3550].Header from RFC3550 :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| contributing source (CSRC) identifiers |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+RFC's note about placement of KLV data into RTP packet :
KLVunits small enough to fit into a single RTP
packet (RTP packet size is up to the implementation but should
consider underlying transport/network factors such as MTU
limitations) are placed directly into the payload of the RTP packet,
with the first byte of the KLVunit (which is the first byte of a KLV
Universal Label Key) being the first byte of the RTP packet payload.My question is where does FFmpeg keep looking for the DTS ?
Does it interpret the Timestamp field of the RTP packet header as DTS ? If so, I've verified that the timestamps increase (although at different rates) but are not equal to what FFmpeg prints out :
8583659665 >= 8583656110