Recherche avancée

Médias (91)

Autres articles (52)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • 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 (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (9920)

  • How to add subtitles using FFmpeg-kit ?

    17 novembre 2024, par Mohammed Bekele

    I'm running a Flutter app with Ffmpeg-kit package to burn a subtitle on a video. I have a words list with the timings and map that to generate an srt and ass file, but when executing this it didn't work.

    


    Firstly, here is how I generated the Ass file.

    


    Future<string> _createAssFile() async {&#xA;    String filePath = await getAssOutputFilePath();&#xA;&#xA;    final file = File(filePath);&#xA;    final buffer = StringBuffer();&#xA;&#xA;    // Write ASS headers&#xA;    buffer.writeln(&#x27;[Script Info]&#x27;);&#xA;    buffer.writeln(&#x27;Title: Generated ASS&#x27;);&#xA;    buffer.writeln(&#x27;ScriptType: v4.00&#x2B;&#x27;);&#xA;    buffer.writeln(&#x27;Collisions: Normal&#x27;);&#xA;    buffer.writeln(&#x27;PlayDepth: 0&#x27;);&#xA;    buffer.writeln(&#x27;Timer: 100,0000&#x27;);&#xA;    buffer.writeln(&#x27;[V4&#x2B; Styles]&#x27;);&#xA;    buffer.writeln(&#xA;        &#x27;Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding&#x27;);&#xA;    buffer.writeln(&#xA;        &#x27;Style: Default,Arial,40,&amp;H00FFFFFF,&amp;H000000FF,&amp;H00000000,&amp;H80000000,1,1,1,1,100,100,0,0,1,1,1,2,10,10,10,1&#x27;);&#xA;    buffer.writeln(&#x27;[Events]&#x27;);&#xA;    buffer.writeln(&#xA;        &#x27;Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text&#x27;);&#xA;&#xA;    // Write events (subtitles)&#xA;    for (int i = 0; i &lt; widget.words.length; i&#x2B;&#x2B;) {&#xA;      final word = widget.words[i];&#xA;      final startTime = _formatAssTime(word[&#x27;startTime&#x27;].toDouble());&#xA;      final endTime = _formatAssTime(word[&#x27;endTime&#x27;].toDouble());&#xA;      final text = word[&#x27;word&#x27;];&#xA;&#xA;      buffer.writeln(&#x27;Dialogue: 0,$startTime,$endTime,Default,,0,0,0,,$text&#x27;);&#xA;    }&#xA;&#xA;    await file.writeAsString(buffer.toString());&#xA;    return filePath;&#xA;  }&#xA;&#xA;  String _formatAssTime(double seconds) {&#xA;    final int hours = seconds ~/ 3600;&#xA;    final int minutes = ((seconds % 3600) ~/ 60);&#xA;    final int secs = (seconds % 60).toInt();&#xA;    final int millis = ((seconds - secs) * 1000).toInt() % 1000;&#xA;&#xA;    return &#x27;${hours.toString().padLeft(1, &#x27;0&#x27;)}:${minutes.toString().padLeft(2, &#x27;0&#x27;)}:${secs.toString().padLeft(2, &#x27;0&#x27;)}.${(millis ~/ 10).toString().padLeft(2, &#x27;0&#x27;)}&#x27;;&#xA;  }&#xA;</string>

    &#xA;

    Then I used this command which was the official way of adding ass file to a video.

    &#xA;

      String newCmd = "-i $videoPath -vf ass=$assFilePath -c:a copy $_outputPath";&#xA;

    &#xA;

    Yet when executing this command it did not work. However I changed it to this command

    &#xA;

    String newCmd = "-i $videoPath -i $assFilePath $_outputPath";&#xA;

    &#xA;

    Well, that code works but the styling is not being applied. So I tried yet another command to filter and position the ass file.

    &#xA;

    String newCmd = "-i $videoPath -i $assFilePath -filter_complex \"[0:v][1:s]ass=\\an5:text=&#x27;%{event.text}&#x27;,scale=iw*0.8:ih*0.8,setdar=16/9[outv]\" -map [outv] -c:a copy $_outputPath";&#xA;

    &#xA;

    This made it even worse, because the app crashed when I ran this. Also there is a log for this command before crashing

    &#xA;

    F/libc    (19624): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x19 in tid 21314 (pool-4-thread-7), pid 19624 (ple.caption_app)&#xA;*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***&#xA;Build fingerprint: &#x27;samsung/a15nsxx/a15:14/UP1A.231005.007/A155FXXU1AWKA:user/release-keys&#x27;&#xA;Revision: &#x27;5&#x27;&#xA;ABI: &#x27;arm64&#x27;&#xA;Processor: &#x27;7&#x27;&#xA;Timestamp: 2024-07-10 19:27:40.812476860&#x2B;0300&#xA;Process uptime: 1746s&#xA;Cmdline: com.example.caption_app&#xA;pid: 19624, tid: 21314, name: pool-4-thread-7  >>> com.example.caption_app &lt;&lt;&lt;&#xA;uid: 10377&#xA;tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)&#xA;signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000019&#xA;Cause: null pointer dereference&#xA;    x0  0000000000000001  x1  b400006ec98d8660  x2  0000000000000000  x3  0000000000000002&#xA;    x4  0000006f62d1ea12  x5  b400006e04f745ea  x6  352f35372f64352f  x7  7f7f7f7f7f7f7f7f&#xA;    x8  632ace36577a905e  x9  632ace36577a905e  x10 0000006e191378c0  x11 0000000000000001&#xA;    x12 0000000000000001  x13 0000000000000000  x14 0000000000000004  x15 0000000000000008&#xA;    x16 0000006e27ffa358  x17 0000006e27dbfb00  x18 0000006e00d48000  x19 0000006f62d1f0e8&#xA;    x20 0000006f62d24000  x21 0000006e27ffc5d0  x22 0000006e27ffc5f0  x23 0000000000000000&#xA;    x24 b400006f3f089248  x25 0000006f62d1f220  x26 b400006f3f057b20  x27 0000000000000002&#xA;    x28 0000000000000088  x29 0000006f62d1f100&#xA;    lr  0000006e27dbfb0c  sp  0000006f62d1f0a0  pc  0000006e27dbfb10  pst 0000000060001000&#xA;1 total frames&#xA;backtrace:&#xA;      #00 pc 0000000000121b10  /data/app/~~oWqjrGA2indQhuEw6u_J2A==/com.example.caption_app-u2Ofk54FVtMc5D-i3SLC6g==/base.apk!libavfilter.so (offset 0x10a46000) (avfilter_inout_free&#x2B;16)    &#xA;Lost connection to device.&#xA;

    &#xA;

    I tried the normal command in my local machine on Windows, and this is what I used

    &#xA;

    ffmpeg -i F:\ffmpeg\video.avi -vf subtitles=&#x27;F\:\\ffmpeg\\caption.srt&#x27;:force_style=&#x27;Fontsize=24&#x27; F:\ffmpeg\new.mp4&#xA;

    &#xA;

    As you can see above when subtitles are used it had an extra backslashes for each path and a pre backslash after the partition letter. But I don't know if this does apply for android devices. How can I make sense of this ?

    &#xA;

  • FFmpeg Could not write header (incorrect codec parameters ?) : Invalid data found when processing input [closed]

    14 juillet 2024, par cookie

    The command

    &#xA;

    ffmpeg -v verbose -i in.mkv -c copy -y out.mkv&#xA;

    &#xA;

    produces the following error :

    &#xA;

    ffmpeg version 7.0.1-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers&#xA;  built with gcc 13.2.0 (Rev5, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;  libavutil      59.  8.100 / 59.  8.100&#xA;  libavcodec     61.  3.100 / 61.  3.100&#xA;  libavformat    61.  1.100 / 61.  1.100&#xA;  libavdevice    61.  1.100 / 61.  1.100&#xA;  libavfilter    10.  1.100 / 10.  1.100&#xA;  libswscale      8.  1.100 /  8.  1.100&#xA;  libswresample   5.  1.100 /  5.  1.100&#xA;  libpostproc    58.  1.100 / 58.  1.100&#xA;[hevc @ 00000133b5bb5040] Invalid default display window&#xA;Input #0, matroska,webm, from &#x27;in.mkv&#x27;:&#xA;  Metadata:&#xA;    encoder         : libebml v1.3.0 &#x2B; libmatroska v1.4.1&#xA;    creation_time   : 2015-03-20T14:07:27.000000Z&#xA;  Duration: 00:24:11.75, start: 0.000000, bitrate: 5185 kb/s&#xA;  Chapters:&#xA;    Chapter #0:0: start 0.000000, end 48.047000&#xA;      Metadata:&#xA;        title           : Chapter 01&#xA;    Chapter #0:1: start 48.047000, end 137.846000&#xA;      Metadata:&#xA;        title           : Chapter 02&#xA;    Chapter #0:2: start 137.846000, end 535.868000&#xA;      Metadata:&#xA;        title           : Chapter 03&#xA;    Chapter #0:3: start 535.868000, end 1330.871000&#xA;      Metadata:&#xA;        title           : Chapter 04&#xA;    Chapter #0:4: start 1330.871000, end 1420.877000&#xA;      Metadata:&#xA;        title           : Chapter 05&#xA;    Chapter #0:5: start 1420.877000, end 1451.741000&#xA;      Metadata:&#xA;        title           : Chapter 06&#xA;    Chapter #0:6: start 1451.741000, end 1451.745000&#xA;      Metadata:&#xA;        title           : Chapter 07&#xA;  Stream #0:0: Video: hevc (Main 10), 1 reference frame, yuv420p10le(tv, left), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn (default)&#xA;      Metadata:&#xA;        _STATISTICS_WRITING_APP: mkvmerge v7.0.0 (&#x27;Where We Going&#x27;) 32bit built on Jun  9 2014 15:08:34&#xA;        _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 (&#x27;Where We Going&#x27;) 32bit built on Jun  9 2014 15:08:34&#xA;        _STATISTICS_WRITING_DATE_UTC: 2015-03-20 14:07:27&#xA;        _STATISTICS_WRITING_DATE_UTC-eng: 2015-03-20 14:07:27&#xA;        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES&#xA;        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES&#xA;        BPS             : 3754023&#xA;        BPS-eng         : 3754023&#xA;        DURATION        : 00:24:11.742000000&#xA;        DURATION-eng    : 00:24:11.742000000&#xA;        NUMBER_OF_FRAMES: 34807&#xA;        NUMBER_OF_FRAMES-eng: 34807&#xA;        NUMBER_OF_BYTES : 681234123&#xA;        NUMBER_OF_BYTES-eng: 681234123&#xA;  Stream #0:1(jpn): Audio: flac, 48000 Hz, stereo, s32 (24 bit) (default)&#xA;      Metadata:&#xA;        _STATISTICS_WRITING_APP: mkvmerge v7.0.0 (&#x27;Where We Going&#x27;) 32bit built on Jun  9 2014 15:08:34&#xA;        _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 (&#x27;Where We Going&#x27;) 32bit built on Jun  9 2014 15:08:34&#xA;        _STATISTICS_WRITING_DATE_UTC: 2015-03-20 14:07:27&#xA;        _STATISTICS_WRITING_DATE_UTC-eng: 2015-03-20 14:07:27&#xA;        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES&#xA;        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES&#xA;        BPS             : 1429414&#xA;        BPS-eng         : 1429414&#xA;        DURATION        : 00:24:11.745000000&#xA;        DURATION-eng    : 00:24:11.745000000&#xA;        NUMBER_OF_FRAMES: 17013&#xA;        NUMBER_OF_FRAMES-eng: 17013&#xA;        NUMBER_OF_BYTES : 259393130&#xA;        NUMBER_OF_BYTES-eng: 259393130&#xA;[out#0/matroska @ 00000133b5bb5a40] No explicit maps, mapping streams automatically...&#xA;[vost#0:0/copy @ 00000133b5c2f580] Created video stream from input stream 0:0&#xA;[aost#0:1/copy @ 00000133b5bf1680] Created audio stream from input stream 0:1&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;  Stream #0:1 -> #0:1 (copy)&#xA;[out#0/matroska @ 00000133b5bb5a40] Could not write header (incorrect codec parameters ?): Invalid data found when processing input&#xA;[AVIOContext @ 00000133b5c27940] Statistics: 291 bytes written, 0 seeks, 1 writeouts&#xA;[AVIOContext @ 00000133b5b97980] Statistics: 66432 bytes read, 2 seeks&#xA;Conversion failed!&#xA;

    &#xA;

    Originally, I was trying to add a subtitle to in.mkv, but I keep encountering this error. When I add the subtitle to another MKV file, it works fine, so I believe the problem lies with in.mkv.

    &#xA;

    Troubleshooting

    &#xA;

    Output only video stream produce the same error :

    &#xA;

    ffmpeg -i in.mkv -map 0:v:0 -c copy out.mkv&#xA;

    &#xA;

    Output only audio stream works fine :

    &#xA;

    ffmpeg -i in.mkv -map 0:a:0 -c copy out.mkv&#xA;

    &#xA;

    Output as mp4 got no error, but the output file is unplayable :

    &#xA;

    ffmpeg -i in.mkv -c copy -strict -2 out.mp4&#xA;

    &#xA;

    Re-encoding works fine :

    &#xA;

    ffmpeg -i in.mkv -c:v libx265 -c:a copy out.mkv&#xA;

    &#xA;

    How can I fix the video stream in in.mkv so that I can add a subtitle stream and remux the file without re-encoding the video ? Any insights or suggestions on handling this error would be greatly appreciated.

    &#xA;

  • ffmpeg does not respect the -t option and keeps recording [closed]

    21 juillet 2024, par Naman Muley

    The command I use is :

    &#xA;

     ffmpeg -f avfoundation -framerate 30 -i "2:0" -vcodec libx264 -pix_fmt yuv420p -acodec aac -strict experimental -t 10 ./recordings/tmp.mp4&#xA;

    &#xA;

    With the above command, I expect the recording output to stop after 10 seconds. But the ffmpeg command keeps running and does not stop.&#xA;Feels like I am missing something basic but I have now spent 3 hours debugging and cannot figure out why.

    &#xA;

    Usecase :&#xA;I need to record my screen's video as well as audio for a specifiable amount of time.

    &#xA;

    According to the manual, putting -t before -i limits the input recording and putting it after -i limits the output recording. I believe after the -i is the correct way to go.

    &#xA;

    Output of list devices :

    &#xA;

     ffmpeg -v verbose -f avfoundation -list_devices true -i ""&#xA;ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --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&#xA;  libavutil      59.  8.100 / 59.  8.100&#xA;  libavcodec     61.  3.100 / 61.  3.100&#xA;  libavformat    61.  1.100 / 61.  1.100&#xA;  libavdevice    61.  1.100 / 61.  1.100&#xA;  libavfilter    10.  1.100 / 10.  1.100&#xA;  libswscale      8.  1.100 /  8.  1.100&#xA;  libswresample   5.  1.100 /  5.  1.100&#xA;  libpostproc    58.  1.100 / 58.  1.100&#xA;[AVFoundation indev @ 0x7fdc48f047c0] AVFoundation video devices:&#xA;[AVFoundation indev @ 0x7fdc48f047c0] [0] FaceTime HD Camera (Built-in)&#xA;[AVFoundation indev @ 0x7fdc48f047c0] [1] Screwdriver Desk View Camera&#xA;[AVFoundation indev @ 0x7fdc48f047c0] [2] Capture screen 0&#xA;[AVFoundation indev @ 0x7fdc48f047c0] [3] Capture screen 1&#xA;[AVFoundation indev @ 0x7fdc48f047c0] AVFoundation audio devices:&#xA;[AVFoundation indev @ 0x7fdc48f047c0] [0] Built-in Microphone&#xA;[AVFoundation indev @ 0x7fdc48f047c0] [1] Screwdriver Microphone&#xA;[in#0 @ 0x7fdc49904080] Error opening input: Input/output error&#xA;Error opening input file .&#xA;Error opening input files: Input/output error&#xA;

    &#xA;

      &#xA;
    • I tried using different codecs and pix_fmt options.
    • &#xA;

    • Tried moving the -t before the -i option and after. no change.
    • &#xA;

    &#xA;

    Works with only audio input :&#xA;The below command that records only the audio works out just fine.

    &#xA;

    ffmpeg -f avfoundation -i ":0" -acodec libmp3lame -t 10 ./recordings/tmp.mp3&#xA;

    &#xA;