Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (26)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

Sur d’autres sites (4450)

  • Evolution #2173 : Date de création / publication

    3 juillet 2017, par tcharlss (*´_ゝ`)

    Je reporte ici le ticket #3966 qui fait doublon : l’idée pourrait être étendue à tout type de contenu.


    Il n’y a pas longtemps j’ai eu besoin de faire des statistiques éditoriales : on voulait connaître l’évolution du nombre d’articles publiés chaque année.
    Mais les données ne sont pas fiables : les utilisateurs avaient pour habitude de faire des « remises en avant » en changeant la date de publication de vieux articles pour les refaire apparaître en page d’accueil. Donc un article écrit en 2014 mais remis en avant en 2017 se retrouve compté comme ayant été publié en 2017.

    Et c’est valable pour tout les objets éditoriaux en fait : on ne conserve pas leur date de création / 1ère publication.
    Certains objets ont une date de publication, mais elle peut être changée. Et d’autres objets n’ont tout simplement pas de date (hormis maj).

    Donc je me demandais s’il ne serait pas pertinent d’avoir cette information de façon générique pour tous les objets éditoriaux, un champ date_creation par exemple qui serait rempli soit à la création, soit à la 1ère publication, et qui ne bougerait pas ensuite.

    Ci-dessous, un tableau récapitulatif de ce qu’on a actuellement pour les principaux objets.

    Objet Champ de date Date pérènne ?
    Articles date Non : peut être modifiée manuellement
    Brèves date_heure Non : peut être modifiée manuellement
    Rubriques date Oui
    Auteurs X X
    Mot-clé X X
    Groupe de mots-clés X X
    Document date Oui
    Forum date_heure oui
    Pétition X X
  • How to properly escape shell arguments on Windows ?

    20 novembre 2016, par PeeHaa

    I am trying to properly escape user supplied data for a command line script. Normally I would use escapeshellarg, however this will simply not work because it’s breaks the eventual command line in glorious ways.

    The use case is trying to add meta data to videos using ffmpeg. A simplified and isolated problem case is the following command :

    ffmpeg -i in.mp4 -metadata author="My Name" out.mp4

    The author value is user supplied (My Name). I tried escaping only the user supplied part which resulted in :

    ffmpeg -i in.mp4 -metadata author=""My Name"" out.mp4

    Which results in the following ffmpeg error :

    Name : Invalid argument

    Next I tried escaping the entire flag (-metadata author="My Name") which results in :

    ffmpeg -i in.mp4 "-metadata author= My Name " out.mp4

    "Unrecognized option ’metadata author= My Name ’.

    Test cases :

    $flag = '-metadata author="%s"';

    var_dump(sprintf($flag, escapeshellarg('My Name')));
    var_dump(escapeshellarg(sprintf($flag, 'My Name')));

    Is there anything that will properly escape the user supplied data so that users cannot pass arbitrary flags to my command and that will make ffmpeg happy without having to do it manually with the risk of forgetting something and screwing it up ?

    Update

    I also tried escaping the entire flag value which works unless there is a double quote inside the user supplied part :

    $flag = 'author="%s"';

    var_dump('-metadata ' . escapeshellarg(sprintf($flag, 'My Name')));
    var_dump('-metadata ' . escapeshellarg(sprintf($flag, 'My "Name"')));

    Which results in :

    -metadata "author= My Name "
    -metadata "author= My  Name  " // it eats my quotes
  • Error Opening RTMP Stream through FFmpeg command when executed through exec package [closed]

    3 octobre 2024, par Akhil

    I have been trying to transcode the live stream from RTMP server running on rtmp://localhost:1936/live/test with FFmpeg in a Go application using os/exec package, But seems to not work and gives the input/output error (I have attached below). The same exact ffmpeg command when I execute on terminal, works as its supposed to. Not Sure why that is, here is my code for reproducing and analyzing the mistakes.

    


    ffmpegCmd := fmt.Sprintf("ffmpeg -nostdin -i rtmp://localhost:1936/live/%s -c:v libx264 -s %s -f %s %s/stream.mpd",
        streamKey, resolution, sp.OutputFormat, outputPath)
    log.Printf("Executing FFmpeg command: %s", ffmpegCmd)

    // Prepare the command execution with a timeout context
    ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) // Set a 60-second timeout
    defer cancel()

    cmd := exec.CommandContext(ctx, "bash", "-c", ffmpegCmd)


    


    the ffmpeg command looks like this :
    
ffmpeg -nostdin -i rtmp://localhost:1936/live/test -c:v libx264 -s 1920x1080 -f dash output/test/1080p/stream.mpd

    


    I get the following error :

    


    Error opening input: Input/output error

Error opening input file rtmp://localhost:1936/live/test.

Error opening input files: Input/output error

Exiting normally, received signal 2.

signal: interrupt


    


    I have already tried to break the command, and then execute it. Something like :

    


    cmd := exec.CommandContext(ctx,
        "ffmpeg",
        "-nostdin",
        "-i", "rtmp://localhost:1936/live/"+streamKey,
        "-c:v", "libx264",
        "-s", resolution,
        "-f", sp.OutputFormat,
        outputPath+"/stream.mpd")


    


    After running the ffmpeg command with -loglevel debug and -report :

    


    Here is the logs and errors I get :

    


    When I run it within the go application :

    


    ffmpeg started on 2024-10-02 at 12:00:06
Report written to "ffmpeg-20241002-120006.log"
Log level: 48
Command line:
ffmpeg -loglevel debug -report -i rtmp://localhost:1936/live/test -c:v libx264 -s 1920x1080 -f dash ./output/test/1080p/stream.mpd
ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.3.9.4)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0.2_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtmp://localhost:1936/live/test'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'libx264'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '1920x1080'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'dash'.
Reading option './output/test/1080p/stream.mpd' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url rtmp://localhost:1936/live/test.
Successfully parsed a group of options.
Opening an input file: rtmp://localhost:1936/live/test.
[AVFormatContext @ 0x13f721f90] Opening 'rtmp://localhost:1936/live/test' for reading
[rtmp @ 0x13f6040e0] No default whitelist set
[tcp @ 0x13f7223d0] No default whitelist set
[tcp @ 0x13f7223d0] Original list of addresses:
[tcp @ 0x13f7223d0] Address ::1 port 1936
[tcp @ 0x13f7223d0] Address 127.0.0.1 port 1936
[tcp @ 0x13f7223d0] Interleaved list of addresses:
[tcp @ 0x13f7223d0] Address ::1 port 1936
[tcp @ 0x13f7223d0] Address 127.0.0.1 port 1936
[tcp @ 0x13f7223d0] Starting connection attempt to ::1 port 1936
[tcp @ 0x13f7223d0] Connection attempt to ::1 port 1936 failed: Connection refused
[tcp @ 0x13f7223d0] Starting connection attempt to 127.0.0.1 port 1936
[tcp @ 0x13f7223d0] Successfully connected to 127.0.0.1 port 1936
[rtmp @ 0x13f6040e0] Handshaking...
[rtmp @ 0x13f6040e0] Type answer 3
[rtmp @ 0x13f6040e0] Server version 13.14.10.13
[rtmp @ 0x13f6040e0] Proto = rtmp, path = /live/test, app = live, fname = test
[rtmp @ 0x13f6040e0] Window acknowledgement size = 5000000
[rtmp @ 0x13f6040e0] Max sent, unacked = 5000000
[rtmp @ 0x13f6040e0] New incoming chunk size = 4096
[rtmp @ 0x13f6040e0] Creating stream...
[rtmp @ 0x13f6040e0] Sending play command for 'test'
[rtmp @ 0x13f6040e0] Deleting stream...
[in#0 @ 0x13f721d40] Error opening input: Input/output error
Error opening input file rtmp://localhost:1936/live/test.
Error opening input files: Input/output error
Exiting normally, received signal 2.


    


    This is what i get when i run the same command on terminal :

    


    <same as="as" but="but" please="please" scroll="scroll" further="further">&#xA;&#xA;[rtmp @ 0x1437144c0] No default whitelist set&#xA;[tcp @ 0x143604f20] No default whitelist set&#xA;[tcp @ 0x143604f20] Original list of addresses:&#xA;[tcp @ 0x143604f20] Address ::1 port 1936&#xA;[tcp @ 0x143604f20] Address 127.0.0.1 port 1936&#xA;[tcp @ 0x143604f20] Interleaved list of addresses:&#xA;[tcp @ 0x143604f20] Address ::1 port 1936&#xA;[tcp @ 0x143604f20] Address 127.0.0.1 port 1936&#xA;[tcp @ 0x143604f20] Starting connection attempt to ::1 port 1936&#xA;[tcp @ 0x143604f20] Connection attempt to ::1 port 1936 failed: Connection refused&#xA;[tcp @ 0x143604f20] Starting connection attempt to 127.0.0.1 port 1936&#xA;[tcp @ 0x143604f20] Successfully connected to 127.0.0.1 port 1936&#xA;[rtmp @ 0x1437144c0] Handshaking...&#xA;[rtmp @ 0x1437144c0] Type answer 3&#xA;[rtmp @ 0x1437144c0] Server version 13.14.10.13&#xA;[rtmp @ 0x1437144c0] Proto = rtmp, path = /live/test, app = live, fname = test&#xA;[rtmp @ 0x1437144c0] Window acknowledgement size = 5000000&#xA;[rtmp @ 0x1437144c0] Max sent, unacked = 5000000&#xA;[rtmp @ 0x1437144c0] New incoming chunk size = 4096&#xA;[rtmp @ 0x1437144c0] Creating stream...&#xA;[rtmp @ 0x1437144c0] Sending play command for &#x27;test&#x27;&#xA;[flv @ 0x143604b30] Format flv probed with size=2048 and score=100&#xA;[flv @ 0x143604b30] Before avformat_find_stream_info() pos: 13 bytes read:2263 seeks:0 nb_streams:0&#xA;Transform tree:&#xA;    mdct_inv_float_c - type: mdct_float, len: 64, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_inv_float_c - type: mdct_float, len: 64, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 120, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft4_fwd_float_neon - type: fft_float, len: 4, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_inv_float_c - type: mdct_float, len: 128, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft_sr_ns_float_neon - type: fft_float, len: 64, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 480, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft16_ns_float_neon - type: fft_float, len: 16, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_inv_float_c - type: mdct_float, len: 512, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft_sr_ns_float_neon - type: fft_float, len: 256, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 960, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_inv_float_c - type: mdct_float, len: 1024, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]&#xA;        fft_sr_ns_float_neon - type: fft_float, len: 512, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;Transform tree:&#xA;    mdct_fwd_float_c - type: mdct_float, len: 1024, factors[2]: [2, any], flags: [unaligned, out_of_place, fwd_only]&#xA;        fft_sr_ns_float_neon - type: fft_float, len: 512, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]&#xA;[NULL @ 0x144124920] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[NULL @ 0x144124920] Decoding VUI&#xA;[NULL @ 0x144124920] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[NULL @ 0x144124920] Decoding VUI&#xA;[h264 @ 0x144124920] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x144124920] Decoding VUI&#xA;[h264 @ 0x144124920] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[h264 @ 0x144124920] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x144124920] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[h264 @ 0x144124920] nal_unit_type: 5(IDR), nal_ref_idc: 3&#xA;[h264 @ 0x144124920] Decoding VUI&#xA;[h264 @ 0x144124920] Format yuv420p chosen by get_format().&#xA;[h264 @ 0x144124920] Reinit context to 1280x720, pix_fmt: yuv420p&#xA;[h264 @ 0x144124920] no picture &#xA;[flv @ 0x143604b30] All info found&#xA;[flv @ 0x143604b30] rfps: 29.666667 0.016552&#xA;[flv @ 0x143604b30] rfps: 29.750000 0.009347&#xA;[flv @ 0x143604b30] rfps: 29.750000 0.009347&#xA;[flv @ 0x143604b30] rfps: 29.833333 0.004197&#xA;[flv @ 0x143604b30] rfps: 29.916667 0.001104&#xA;[flv @ 0x143604b30] rfps: 29.916667 0.001104&#xA;[flv @ 0x143604b30] rfps: 30.000000 0.000067&#xA;[flv @ 0x143604b30] rfps: 30.000000 0.000067&#xA;[flv @ 0x143604b30] rfps: 60.000000 0.000270&#xA;[flv @ 0x143604b30] rfps: 60.000000 0.000270&#xA;[flv @ 0x143604b30] rfps: 120.000000 0.001079&#xA;[flv @ 0x143604b30] rfps: 120.000000 0.001079&#xA;[flv @ 0x143604b30] rfps: 240.000000 0.004316&#xA;[flv @ 0x143604b30] rfps: 240.000000 0.004316&#xA;[flv @ 0x143604b30] rfps: 29.970030 0.000204&#xA;[flv @ 0x143604b30] rfps: 29.970030 0.000204&#xA;[flv @ 0x143604b30] rfps: 59.940060 0.000814&#xA;[flv @ 0x143604b30] rfps: 59.940060 0.000814&#xA;[flv @ 0x143604b30] After avformat_find_stream_info() pos: 496783 bytes read:496783 seeks:0 frames:179&#xA;Input #0, flv, from &#x27;rtmp://localhost:1936/live/test&#x27;:&#xA;  Metadata:&#xA;    |RtmpSampleAccess: true&#xA;    Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)&#xA;    displayWidth    : 1280&#xA;    displayHeight   : 720&#xA;    fps             : 30&#xA;    profile         : &#xA;    level           : &#xA;  Duration: 00:00:00.00, start: 6.742000, bitrate: N/A&#xA;  Stream #0:0, 138, 1/1000: Audio: aac (LC), 48000 Hz, stereo, fltp, 163 kb/s&#xA;  Stream #0:1, 41, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709, progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 0/1, 2560 kb/s, 30 fps, 30 tbr, 1k tbn&#xA;Successfully opened the file.&#xA;Parsing a group of options: output url ./output/test/1080p/stream.mpd.&#xA;Applying option c:v (select encoder/decoder (&#x27;copy&#x27; to copy stream without reencoding)) with argument libx264.&#xA;Applying option s (set frame size (WxH or abbreviation)) with argument 1920x1080.&#xA;Applying option f (force container format (auto-detected otherwise)) with argument dash.&#xA;Successfully parsed a group of options.&#xA;Opening an output file: ./output/test/1080p/stream.mpd.&#xA;[out#0/dash @ 0x123707480] No explicit maps, mapping streams automatically...&#xA;[vost#0:0/libx264 @ 0x123707d60] Created video stream from input stream 0:1&#xA;detected 10 logical cores&#xA;[h264 @ 0x123607b70] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x123607b70] Decoding VUI&#xA;[h264 @ 0x123607b70] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[aost#0:1/aac @ 0x144028080] Created audio stream from input stream 0:0&#xA;Transform tree:&#xA;    mdct_inv_float_c - type: md&#xA;&#xA;<it simply="simply" starts="starts" working="working">&#xA;</it></same>

    &#xA;

    I am not sure if there is something to do with Permissions.

    &#xA;