Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (41)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (6863)

  • Anomalie #4830 : extraire_date extravagant

    6 juillet 2021

    Pourquoi pas. Je te propose (ou quelqu’un) de faire une PR pour ça.
    Il faudrait ajouter en même temps des tests unitaires parce que bon.
    Ci dessous un code valide qui fait la demande.

    Ce qui me gène tout de même c’est le [^0-9]* dans la regex (déjà présente dans l’ancienne fonction) qui du coup peut chercher une date coupée dans un grand texte…
    Tel que : "En 2012 à l’orée du bois se trouvait 10 chevaux et 4 biches.", qui sort la date "2012-10-04" (ou 2012-10-01 avant cette proposition).
    Donc l’usage est possiblement assez limité de cette fonction si laissée telle quelle.

    1. <span class="CodeRay">
    2. <span class="comment">/**
    3.  * Extrait une date d'un texte et renvoie le résultat au format de date SQL
    4.  *
    5.  * L'année et le mois doivent être numériques.
    6.  * Le séparateur entre l'année et le mois peut être un `-`, un `:` ou un texte
    7.  * quelconque ne contenant pas de chiffres.
    8.  *
    9.  * Si un numéro de jour valide n'est pas indiqué, le résultat est alors le 1er du mois.
    10.  *
    11.  * @link https://www.spip.net/5516
    12.  * @param string $texte
    13.  *    Texte contenant une date tel que `2008-04`
    14.  * @return string
    15.  *    Date au format SQL tel que `2008-04-01`
    16.  **/</span>
    17. <span class="keyword">function</span> <span class="function">extraire_date</span>(<span class="local-variable">$texte</span>) {
    18.     <span class="comment">// format = 2001-08-12 ou 2001-08</span>
    19.     <span class="local-variable">$has_date</span> = <span class="predefined">preg_match</span>(
    20.         <span class="string"><span class="delimiter">"</span><span class="content">,
    21.        # une annee
    22.        (?P<annee>[1-2][0-9]</annee></span><span class="content">{</span><span class="content">3})
    23.        # des caracteres sans numeros
    24.        [^0-9]*
    25.        # un mois
    26.        (?P<mois>1[0-2]|0?[1-9])
    27.        (?:
    28.            # des caracteres sans numeros
    29.            [^0-9]*
    30.            # un jour
    31.            (?P<jour>3[0-1]|[1-2][0-9]|0?[1-9])
    32.        )?
    33.        ,x</jour></mois></span><span class="delimiter">"</span></span>,
    34.         <span class="local-variable">$texte</span>,
    35.         <span class="local-variable">$regs</span>
    36.     );
    37.     <span class="keyword">if</span> (<span class="local-variable">$has_date</span>) {
    38.         <span class="local-variable">$date</span> = [
    39.             <span class="local-variable">$regs</span>[<span class="string"><span class="delimiter">"</span><span class="content">annee</span><span class="delimiter">"</span></span>],
    40.             <span class="predefined">sprintf</span>(<span class="string"><span class="delimiter">"</span><span class="content">%02d</span><span class="delimiter">"</span></span>, <span class="local-variable">$regs</span>[<span class="string"><span class="delimiter">"</span><span class="content">mois</span><span class="delimiter">"</span></span>]),
    41.             <span class="predefined">sprintf</span>(<span class="string"><span class="delimiter">"</span><span class="content">%02d</span><span class="delimiter">"</span></span>, <span class="local-variable">$regs</span>[<span class="string"><span class="delimiter">"</span><span class="content">jour</span><span class="delimiter">"</span></span>] ?? <span class="string"><span class="delimiter">"</span><span class="content">01</span><span class="delimiter">"</span></span>)
    42.         ];
    43.         <span class="keyword">return</span> <span class="predefined">implode</span>(<span class="string"><span class="delimiter">"</span><span class="content">-</span><span class="delimiter">"</span></span>, <span class="local-variable">$date</span>);
    44.     }
    45. }
    46. </span>

    Télécharger


    #SQUELETTE

    #SET{liste,#LISTE{
       "Une date 2020 01",
       "Une date 2020 12 autre",
       "Une date 2020 autre 12 autre",
       "Une date 2021 12 01",
       "Une date 2021 12 00",
       "Une date 2021 12 31",
       "Une date 2021 12 32",
       "Une date 2021 autre 12 date 21",
       "En 2012 à l’orée du bois se trouvait 10 chevaux et 4 biches."
    }}

    <dl>

    <dt>#VALEUR</dt>
    <dd>[(#VALEUR|extraire_date)]</dd>

    </dl>

    Sortie :

    1. Une date 2020 01
    2.     2020-01-01
    3. Une date 2020 12 autre
    4.     2020-12-01
    5. Une date 2020 autre 12 autre
    6.     2020-12-01
    7. Une date 2021 12 01
    8.     2021-12-01
    9. Une date 2021 12 00
    10.     2021-12-01
    11. Une date 2021 12 31
    12.     2021-12-31
    13. Une date 2021 12 32
    14.     2021-12-03
    15. Une date 2021 autre 12 date 21
    16.     2021-12-21
    17. En 2012 à l’orée du bois se trouvait 10 chevaux et 4 biches.
    18.     2012-10-04

    Télécharger

  • Algorithm when recording SegmentTimeline of MPEG-DASH MPD in shaka packager

    25 mars 2021, par jgkim0518

    I packaged a media stream by mpeg-dash transcoded video at twice the speed and audio at normal speed.&#xA;Here is the command :

    &#xA;

    ffmpeg -re -stream_loop -1 -i timing_logic.mp4 -c:v hevc_nvenc -filter:v "setpts=2*PTS" -c:a libfdk_aac -map 0:v -map 0:a -f mpegts udp://xxx.xxx.xxx.xxx:xxxx?pkt_size=1316&#xA;

    &#xA;

    The source information used here is as follows :

    &#xA;

    Input #0, mpegts, from &#x27;/home/test/timing_logic/timing_logic.mp4&#x27;:&#xA;Duration: 00:00:30.22, start: 1.400000, bitrate: 16171 kb/s&#xA;Program 1&#xA;Metadata:&#xA;service_name : Service01&#xA;service_provider: FFmpeg&#xA;Stream #0:0[0x100]: Video: hevc (Main 10) (HEVC / 0x43564548), yuv420p10le(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc&#xA;Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s Stream mapping:&#xA;Stream #0:0 -> #0:0 (hevc (native) -> hevc (hevc_nvenc))&#xA;Stream #0:1 -> #0:1 (mp2 (native) -> aac (libfdk_aac))&#xA;Press [q] to stop, [?] for help&#xA;frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A&#xA;frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A&#xA;Output #0, mpegts, to &#x27;udp://xxx.xxx.xxx.xxx:xxxx?pkt_size=1316&#x27;:&#xA;Metadata:&#xA;encoder : Lavf58.45.100&#xA;Stream #0:0: Video: hevc (hevc_nvenc) (Main 10), p010le, 3840x2160 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 50 fps, 90k tbn, 50 tbc&#xA;Metadata:&#xA;encoder : Lavc58.91.100 hevc_nvenc&#xA;Side data:&#xA;cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A&#xA;Stream #0:1(eng): Audio: aac (libfdk_aac), 48000 Hz, stereo, s16, 139 kb/s&#xA;Metadata:&#xA;encoder : Lavc58.91.100 libfdk_aac&#xA;

    &#xA;

    My shaka packager command is :

    &#xA;

    packager \ &#x27;in=udp://xxx.xxx.xxx.xxx:xxxx,stream=video,init_segment=/home/test/timing_logic/package/video/0/video.mp4,segment_template=/home/test/timing_logic/package/video/0/$Time$.m4s&#x27; \&#xA;&#x27;in=udp://xxx.xxx.xxx.xxx:xxxx,stream=audio,init_segment=/home/test/timing_logic/package/audio/0/audio.mp4,segment_template=/home/test/timing_logic/package/audio/0/$Time$.m4a&#x27; \&#xA;--segment_duration 5 --fragment_duration 5 --minimum_update_period 5 --min_buffer_time 5 \&#xA;--preserved_segments_outside_live_window 24 --time_shift_buffer_depth 40 \&#xA;--allow_codec_switching --allow_approximate_segment_timeline --log_file_generation_deletion \&#xA;--mpd_output $OUTPUT/$output_mpd.mpd &amp;&#xA;

    &#xA;

    Looking at the mpd generated as a result of packaging, the duration of the audio is twice that of the video, and the number of segments is half.&#xA;The following is the content of mpd :

    &#xA;

    &lt;?xml version="1.0" encoding="UTF-8"?>&#xA;&#xA;<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" minbuffertime="PT5S" type="dynamic" publishtime="2021-03-23T10:01:57Z" availabilitystarttime="2021-03-23T09:59:55Z" minimumupdateperiod="PT5S" timeshiftbufferdepth="PT40S">&#xA;<period start="PT0S">&#xA;<adaptationset contenttype="audio" segmentalignment="true">&#xA;<representation bandwidth="140020" codecs="mp4a.40.2" mimetype="audio/mp4" audiosamplingrate="48000">&#xA;<audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>&#xA;<segmenttemplate timescale="90000" initialization="/home/test/timing_logic/package/audio/0/audio.mp4" media="/home/test/timing_logic/package/audio/0/$Time$.m4a" startnumber="16">&#xA;<segmenttimeline>&#xA;<s t="6751436" d="449280"></s>&#xA;<s t="7200716" d="451200"></s>&#xA;<s t="7651916" d="449280"></s>&#xA;<s t="8101196" d="374400"></s>&#xA;<s t="8551196" d="449280"></s>&#xA;<s t="9000476" d="451200"></s>&#xA;<s t="9451674" d="449280"></s>&#xA;<s t="9900956" d="449280"></s>&#xA;<s t="10350236" d="451200"></s>&#xA;<s t="10801434" d="374400"></s>&#xA;</segmenttimeline>&#xA;</segmenttemplate>&#xA;</representation>&#xA;</adaptationset>&#xA;<adaptationset contenttype="video" width="3840" height="2160" framerate="90000/3600" segmentalignment="true" par="16:9">&#xA;<representation bandwidth="1520392" codecs="hvc1.2.4.L153" mimetype="video/mp4" sar="1:1">&#xA;<segmenttemplate timescale="90000" initialization="/home/test/timing_logic/package/video/0/video.mp4" media="/home/test/timing_logic/package/video/0/$Time$.m4s" startnumber="19">&#xA;<segmenttimeline>&#xA;<s t="16954440" d="900000" r="4"></s>&#xA;</segmenttimeline>&#xA;</segmenttemplate>&#xA;</representation>&#xA;</adaptationset>&#xA;</period>&#xA;</mpd>&#xA;

    &#xA;

    When looking at the MPD, it seems that the shaka packager checks the PTS or DTS of the TS when creating a segment and recording the contents of the SegmentTimeline.&#xA;But I couldn't understand even by looking at the MPEG standard documentation and the DASH-IF documentation.

    &#xA;

    My question is whether the packager refers to PTS or DTS when creating a segment.&#xA;How are SegmentTimeline's S@t and S@d recorded ?&#xA;What algorithm is the SegmentTimeline recorded with ? Please help me. Thank you.

    &#xA;

  • ffmpeg creates empty mpd-file

    1er avril 2021, par Macster

    I'm trying to live stream a webm file using ffmpeg and Dash.js as a Player. Creating chunks with ffmpeg seems to work fine, but when want to create the manifest it says Could not find codec parameters for stream 0 (Video: vp9, none, 640x480): unspecified pixel format Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options and at the end Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used).

    &#xA;

    Commands I use

    &#xA;

    ffmpeg -re -r 25 -i Dash/strm.webm&#xA; -map 0:v:0&#xA; -pix_fmt yuv420p&#xA; -c:v libvpx-vp9&#xA; -s 640x480 -keyint_min 25 -g 25 &#xA; -speed 6 -threads 8 -static-thresh 0 -max-intra-rate 300 &#xA; -deadline realtime -lag-in-frames 0 -error-resilient 1&#xA; -f webm_chunk &#xA; -header "Dash/glass_360.hdr"&#xA; -chunk_start_index 1&#xA; Dash\glass_360_%d.chk&#xA;

    &#xA;

    Manifest

    &#xA;

    ffmpeg ^&#xA; -f webm_dash_manifest -live 1&#xA; -r 25&#xA; -i Dash/glass_360.hdr&#xA; -c copy&#xA; -map 0&#xA; -r 25&#xA; -framerate 25&#xA; -f webm_dash_manifest -live 1&#xA; -adaptation_sets "id=0,streams=0"&#xA; -chunk_start_index 1&#xA; -chunk_duration_ms 1000&#xA; -time_shift_buffer_depth 7200&#xA; -minimum_update_period 7200&#xA; Dash/glass_live_manifest.mpd&#xA;

    &#xA;

    Manifest Output

    &#xA;

     libavutil      56. 49.100 / 56. 49.100&#xA;  libavcodec     58. 87.101 / 58. 87.101&#xA;  libavformat    58. 43.100 / 58. 43.100&#xA;  libavdevice    58.  9.103 / 58.  9.103&#xA;  libavfilter     7. 83.100 /  7. 83.100&#xA;  libswscale      5.  6.101 /  5.  6.101&#xA;  libswresample   3.  6.100 /  3.  6.100&#xA;  libpostproc    55.  6.100 / 55.  6.100&#xA;[webm_dash_manifest @ 0000015f19f2ea40] Could not find codec parameters for stream 0 (Video: vp9, none, 640x480): unspecified pixel format&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;Input #0, webm_dash_manifest, from &#x27;Dash/glass_360.hdr&#x27;:&#xA;  Metadata:&#xA;    ENCODER         : Lavf58.43.100&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #0:0(eng): Video: vp9, none, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)&#xA;    Metadata:&#xA;      ALPHA_MODE      : 1&#xA;      ENCODER         : Lavc58.87.101 libvpx-vp9&#xA;      webm_dash_manifest_file_name: glass_360.hdr&#xA;      webm_dash_manifest_track_number: 1&#xA;Output #0, webm_dash_manifest, to &#x27;stream_manifest.mpd&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf58.43.100&#xA;    Stream #0:0(eng): Video: vp9, none, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 1k tbr, 1k tbn, 1k tbc (default)&#xA;    Metadata:&#xA;      ALPHA_MODE      : 1&#xA;      ENCODER         : Lavc58.87.101 libvpx-vp9&#xA;      webm_dash_manifest_file_name: glass_360.hdr&#xA;      webm_dash_manifest_track_number: 1&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;Press [q] to stop, [?] for help&#xA;frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x&#xA;video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)&#xA;

    &#xA;

    glass_live_manifest.mpd

    &#xA;

    &lt;?xml version="1.0" encoding="UTF-8"?>&#xA;&#xA;<period start="PT0S">&#xA;<adaptationset mimetype="video/webm" codecs="vp9" lang="eng" bitstreamswitching="true" subsegmentalignment="true" subsegmentstartswithsap="1">&#xA;<contentcomponent type="video"></contentcomponent>&#xA;<segmenttemplate timescale="1000" duration="1000" media="glass_$RepresentationID$_$Number$.chk" startnumber="1" initialization="glass_$RepresentationID$.hdr"></segmenttemplate>&#xA;<representation bandwidth="1000000" width="640" height="480" codecs="vp9" mimetype="video/webm" startswithsap="1"></representation>&#xA;</adaptationset>&#xA;</period>&#xA;&#xA;

    &#xA;

    UPDATE

    &#xA;

    I fixed the "warnings" by changing the comands like this :

    &#xA;

    ffmpeg -re -r 25 -i Dash/strm.webm&#xA;-map 0:v:0&#xA;-pix_fmt yuv420p&#xA;-c:v libvpx&#xA;-s 640x480 -keyint_min 60 -g 60 -speed 6 -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 -max-intra-rate 300 -deadline realtime -lag-in-frames 0 -error-resilient 1&#xA;-b:v 3000k&#xA;-f webm_chunk&#xA;-header "Dash/glass_360.hdr"&#xA;-chunk_start_index 1 Dash/glass_360_%d.chk&#xA;-map 0:a:0&#xA;-c:a libvorbis&#xA;-b:a 128k -ar 44100&#xA;-f webm_chunk&#xA;-audio_chunk_duration 2000&#xA;-header Dash/glass_171.hdr&#xA;-chunk_start_index 1 Dash/glass_171_%d.chk&#xA;&#xA;ffmpeg&#xA;-f webm_dash_manifest -live 1&#xA;-i Dash/glass_360.hdr&#xA;-f webm_dash_manifest -live 1&#xA;-i Dash/glass_171.hdr&#xA;-c copy&#xA;-map 0 -map 1&#xA;-f webm_dash_manifest -live 1&#xA;-adaptation_sets "id=0,streams=0 id=1,streams=1"&#xA;-chunk_start_index 1&#xA;-chunk_duration_ms 2000&#xA;-time_shift_buffer_depth 7200&#xA;-minimum_update_period 7200 Dash/glass_video_manifest.mpd&#xA;

    &#xA;

    However, it's still not working.

    &#xA;