Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (25)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (4881)

  • 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

  • ffmpeg show wrong with/height of video

    6 mai 2020, par boygiandi

    I have this video : https://media.gostream.co/uploads/gostream/9wkBeGM7lOfxT902V86hzI22Baj2/23-4-2020/videos/263a34c5a2fe61b33fe17e090893c04e-1587640618504_fs.mp4

    &#xA;&#xA;

    When I play it on Google Chrome, it's vertical video. But when I check with ffmpeg

    &#xA;&#xA;

    ffmpeg -i "https://media.gostream.co/uploads/gostream/9wkBeGM7lOfxT902V86hzI22Baj2/23-4-2020/videos/263a34c5a2fe61b33fe17e090893c04e-1587640618504_fs.mp4"&#xA;

    &#xA;&#xA;

    It show video dimensions are 1080x1080

    &#xA;&#xA;

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;a.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.35.101&#xA;  Duration: 00:00:39.51, start: 0.000000, bitrate: 1577 kb/s&#xA;    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x1080 [SAR 9:16 DAR 9:16], 1464 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : SoundHandler&#xA;At least one output file must be specified&#xA;

    &#xA;&#xA;

    And when I livestream this video to Facebook, it scaled vertical video into square form : https://imgur.com/a/A8dQ7j7

    &#xA;&#xA;

    How can I correct video size when livestream ?

    &#xA;

  • Writing an MP4 file on the Mac with OpenCV ffmpeg

    31 décembre 2020, par Sameer Parekh

    I am using OpenCV with ffmpeg on a mac to write video. I've been able to successfully write .avi files using the codec/fourcc code, FMP4. I would like to write .mp4 files, however. When I try to write an .mp4 file using fourcc FMP4 I get this error :

    &#xA;&#xA;

    [mp4 @ 0x100b4ec00] Tag FMP4/0x34504d46 incompatible with output codec id &#x27;13&#x27; ( [0][0][0])&#xA;

    &#xA;&#xA;

    When I use AVC1 I get the following error :

    &#xA;&#xA;

    [libx264 @ 0x104003000] broken ffmpeg default settings detected&#xA;[libx264 @ 0x104003000] use an encoding preset (e.g. -vpre medium)&#xA;[libx264 @ 0x104003000] preset usage: -vpre <speed> -vpre <profile>&#xA;[libx264 @ 0x104003000] speed presets are listed in x264 --help&#xA;[libx264 @ 0x104003000] profile is optional; x264 defaults to high&#xA;Could not open codec &#x27;libx264&#x27;: Unspecified error&#xA;</profile></speed>

    &#xA;&#xA;

    Does anyone here know the right codec to use with OpenCV and ffmpeg to write to an MP4 container on the Mac ?

    &#xA;&#xA;

    If AVC1 is the right codec, how do I install ffmpeg + OpenCV correctly ? I did

    &#xA;&#xA;

    brew install gpac&#xA;brew install ffmpeg&#xA;brew install opencv&#xA;

    &#xA;&#xA;

    The call I am using to open the videowriter :

    &#xA;&#xA;

    fourcc = cv2.cv.CV_FOURCC(&#x27;A&#x27;, &#x27;V&#x27;, &#x27;C&#x27;, &#x27;1&#x27;)   &#xA;video_out = cv2.VideoWriter(&#xA;    filename=output_filename,&#xA;    fourcc=fourcc,&#xA;    fps=video_fps,&#xA;    frameSize=(video_width,video_height),&#xA;    isColor=1)&#xA;

    &#xA;&#xA;

    When I run x264 --help I get

    &#xA;&#xA;

    % x264 --help&#xA;x264 core:125&#xA;Syntax: x264 [options] -o outfile infile&#xA;&#xA;Infile can be raw (in which case resolution is required),&#xA;  or YUV4MPEG (*.y4m),&#xA;  or Avisynth if compiled with support (no).&#xA;  or libav* formats if compiled with lavf support (no) or ffms support (no).&#xA;Outfile type is selected by filename:&#xA; .264 -> Raw bytestream&#xA; .mkv -> Matroska&#xA; .flv -> Flash Video&#xA; .mp4 -> MP4 if compiled with GPAC support (no)&#xA;Output bit depth: 8 (configured at compile time)&#xA;&#xA;Options:&#xA;&#xA;  -h, --help                  List basic options&#xA;      --longhelp              List more options&#xA;      --fullhelp              List all options&#xA;&#xA;Example usage:&#xA;&#xA;      Constant quality mode:&#xA;            x264 --crf 24 -o <output> <input />&#xA;&#xA;      Two-pass with a bitrate of 1000kbps:&#xA;            x264 --pass 1 --bitrate 1000 -o <output> <input />&#xA;            x264 --pass 2 --bitrate 1000 -o <output> <input />&#xA;&#xA;      Lossless:&#xA;            x264 --qp 0 -o <output> <input />&#xA;&#xA;      Maximum PSNR at the cost of speed and visual quality:&#xA;            x264 --preset placebo --tune psnr -o <output> <input />&#xA;&#xA;      Constant bitrate at 1000kbps with a 2 second-buffer:&#xA;            x264 --vbv-bufsize 2000 --bitrate 1000 -o <output> <input />&#xA;&#xA;Presets:&#xA;&#xA;      --profile <string>      Force the limits of an H.264 profile&#xA;                                  Overrides all settings.&#xA;                                  - baseline,main,high,high10,high422,high444&#xA;      --preset <string>       Use a preset to select encoding settings [medium]&#xA;                                  Overridden by user settings.&#xA;                                  - ultrafast,superfast,veryfast,faster,fast&#xA;                                  - medium,slow,slower,veryslow,placebo&#xA;      --tune <string>         Tune the settings for a particular type of source&#xA;                              or situation&#xA;                                  Overridden by user settings.&#xA;                                  Multiple tunings are separated by commas.&#xA;                                  Only one psy tuning can be used at a time.&#xA;                                  - psy tunings: film,animation,grain,&#xA;                                                 stillimage,psnr,ssim&#xA;                                  - other tunings: fastdecode,zerolatency&#xA;&#xA;Frame-type options:&#xA;&#xA;  -I, --keyint <integer or="or"> Maximum GOP size [250]&#xA;      --tff                   Enable interlaced mode (top field first)&#xA;      --bff                   Enable interlaced mode (bottom field first)&#xA;      --pulldown <string>     Use soft pulldown to change frame rate&#xA;                                  - none, 22, 32, 64, double, triple, euro (requires cfr input)&#xA;&#xA;Ratecontrol:&#xA;&#xA;  -B, --bitrate <integer>     Set bitrate (kbit/s)&#xA;      --crf <float>           Quality-based VBR (0-51) [23.0]&#xA;      --vbv-maxrate <integer> Max local bitrate (kbit/s) [0]&#xA;      --vbv-bufsize <integer> Set size of the VBV buffer (kbit) [0]&#xA;  -p, --pass <integer>        Enable multipass ratecontrol&#xA;                                  - 1: First pass, creates stats file&#xA;                                  - 2: Last pass, does not overwrite stats file&#xA;&#xA;Input/Output:&#xA;&#xA;  -o, --output <string>       Specify output file&#xA;      --sar width:height      Specify Sample Aspect Ratio&#xA;      --fps   Specify framerate&#xA;      --seek <integer>        First frame to encode&#xA;      --frames <integer>      Maximum number of frames to encode&#xA;      --level <string>        Specify level (as defined by Annex A)&#xA;      --quiet                 Quiet Mode&#xA;&#xA;Filtering:&#xA;&#xA;      --vf, --video-filter <filter0>/<filter1>/... Apply video filtering to the input file&#xA;&#xA;      Filter options may be specified in <filter>:<option>=<value> format.&#xA;&#xA;      Available filters:&#xA;      crop:left,top,right,bottom&#xA;      select_every:step,offset1[,...]&#xA;</value></option></filter></filter1></filter0></string></integer></integer></string></integer></integer></integer></float></integer></string></integer></string></string></string></output></output></output></output></output></output>

    &#xA;&#xA;

    Thanks,&#xA;-s

    &#xA;