Recherche avancée

Médias (91)

Autres articles (106)

  • Soumettre bugs et patchs

    10 avril 2011

    Un logiciel n’est malheureusement jamais parfait...
    Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
    Si vous pensez avoir résolu vous même le bug (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (9404)

  • ffmpeg command and args execute successfully with child_process.exec() but not child_process.spawn()

    15 octobre 2013, par Zugwalt

    I am trying to use ffmpeg to add text to a video via the drawtext filter from within node.js in a windows environment.

    I have a command and arguments that work in the command line and when executed using the child_process module's exec function, but it encounters an error when the same arguments are used with the spawn function.

    The below code illustrates the problem :

    var child_process = require('child_process');

    var cmd = 'ffmpeg';

    var args = [ '-i',
                'c:\\path\\to\\my\\inputfile.mp4',
                '-vf',
                'drawtext="fontfile=/Windows/Fonts/arial.ttf:text=\'Hello World\':fontcolor=white@0.6:fontsize=70:x=0:y=40"',
                '-y',
                'c:\\path\\to\\my\\outputfile.mp4' ];

    // Above creates the command line equivalent of:
    // ffmpeg -i c:\path\to\my\inputfile.mp4 -vf drawtext="fontfile=/Windows/Fonts/arial.ttf:text='Hello fluent text':fontcolor=white@0.7:fontsize=70:x=0:y=40" -y c:\path\to\my\outputfile.mp4
    // this works when run from the command line

    var execCmd = cmd+' '+args.join(' ');

    child_process.exec(execCmd, function (error, stdout, stderr) {
           /* ffmpeg runs fine, adding the text to the video */

           var spawn = child_process.spawn(cmd,args);

           spawn.on('close', function (code) {
               /* ffmpeg fails, with standard error (obtained via spawn.stderr) reading:
                  Could not load font ""fontfile=/Windows/Fonts/arial.ttf": impossible to find a matching font
                  Error initializing filter 'drawtext' with args '"fontfile=/Windows/Fonts/arial.ttf:text=Hello fluent text:fontcolor=white@0.6:fontsize=70:x=0:y=40"'
               */
           });
       });

    Based on the error message :

    Could not load font ""fontfile=/Windows/Fonts/arial.ttf" : impossible
    to find a matching font

    And comparing it to giving ffmpeg a bogus font on the command line :

    Could not load font "/Windows/Fonts/bogus.ttf" : impossible to find a
    matching font

    It seems the problem is that when executed from spawn the drawtext argument is incorrectly parsed and "fontfile= is incorrectly making its way into the font's path. This does not happen when the same argument is executed with exec or from the command line. Is there any additional escaping that needs to be done when executing using spawn ?

  • What is the proper syntax to use ffmpeg to stream H.264 using RTSP over an HTTP tunnel ?

    1er décembre 2017, par NewtownGuy

    I’m trying to send an H.264 video stream at 10 fps over rtsp over an http tunnel so the video can be accessed remotely through a firewall and ideally, using only a single port for all communications. I can’t just use rtsp because it needs one open port on which the stream is requested, which is fine, but it opens two server ports that it chooses randomly for the video stream and they can’t be mapped through the router to the world — a common problem.

    I tried VLC but it won’t let me control the server ports that it opens. ffmpeg seems to have more capability selecting ports, but I can’t get the syntax right. Here’s the command I’m using, where my H.264 stream at 10 fps comes from a pipe, /home/vout1, and I tried limiting the server ports in case it won’t let me just use one port for everything :

    root@Z-1:~# ffmpeg -r 10 -i /home/vout1 -f rtsp -rtsp_transport http -min_port 25000 -max_port 25009 rtsp://localhost:8554

    Here’s the result, where I’ve placed the errors messages in bold :

    ffmpeg version 3.2.4-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.1 (Debian 5.4.1-5) 20170205 configuration : —enable-gpl
    — enable-version3 —enable-static —disable-debug —disable-ffplay —disable-indev=sndio —disable-outdev=sndio —cc=gcc-5 —enable-fontconfig —enable-frei0r —enable-gnutls —enable-gray —enable-libass —enable-libfreetype —enable-libfribidi —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopus —enable-librtmp —enable-libsoxr —enable-libspeex —enable-libtheora —enable-libvidstab —enable-libvo-amrwbenc —enable-libvorbis —enable-libvpx —enable-libwebp —enable-libx264 —enable-libxvid
    libavutil 55. 34.101 / 55. 34.101
    libavcodec 57. 64.101 / 57. 64.101
    libavformat 57. 56.101 / 57. 56.101
    libavdevice 57. 1.100 / 57. 1.100
    libavfilter 6. 65.100 / 6. 65.100
    libswscale 4. 2.100 / 4. 2.100
    libswresample 2. 3.100 / 2. 3.100
    libpostproc 54. 1.100 / 54. 1.100
    Input #0, h264, from ’/home/vout1’ :
    Duration : N/A, bitrate : N/A
    Stream #0:0 : Video : h264 (High), yuv420p(progressive), 960x540, 25 fps, 25 tbr, 1200k tbn, 50 tbc
    [rtsp @ 0x3d68b30] Unsupported lower transport method, only UDP and TCP are supported for output.
    Could not write header for output file #0 (incorrect codec parameters ?) : Invalid argumentStream mapping :
    Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
    Last message repeated 1 times

    ffmpeg sees the stream because it got the resolution right. But it thinks my stream is the default 25 fps, but I specified -r 10 to say the frame rate is only 10 fps. Second, the stream is not being created.

    What is the proper command line syntax and how can I make ffmpeg use one port for everything, even if I can only have one stream ?

    Thank you in advance for your help.

  • I cannot add subtitles to MP4 using FFmpeg

    14 janvier 2024, par Nau

    I have a video called test_video.mp4 downloaded from YouTube

    


    enter image description here

    


    This is the information of the video obtained by running ffmpeg -i test_video.mp4 :

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.19.102
  Duration: 00:00:17.62, start: 0.000000, bitrate: 265 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480 [SAR 1:1 DAR 4:3], 138 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.


    


    I have also a file with subtitles called test_sub.srt :

    


    1
00:00:01,000 --> 00:00:05,000
Hello

2
00:00:10,000 --> 00:00:15,000
World


    


    When I run ffmpeg -i test_video.mp4 -i test_sub.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng test_out.mp4, soft subtitles are added :

    


    enter image description here

    


    The problem comes when I try to do the same to a bigger video called test2_video.mp4, I run ffmpeg -i test2_video.mp4 -i test_sub.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng test2_out.mp4 but subtitles are not added to test2_out.mp4, this is the information of the video when I run ffmpeg -i test2_video.mp4 :

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test2_video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:59:11.08, start: 0.000000, bitrate: 2131 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1997 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    


    Why does this happen ?, the version of FFmpeg that I'm running is 4.2.7-0ubuntu0.1