Recherche avancée

Médias (91)

Autres articles (106)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (10172)

  • ffmpeg : -copyts makes -t stop at timestamps, not duration

    30 juillet 2017, par arielCo

    From

    -t duration (input/output)

    When used as an input option (before -i), limit the duration of data read from the input file.

    When used as an output option (before an output url), stop writing the output after its duration reaches duration.

    So this should yield a 1-minute file with timestamps starting at 1:49, right ?

    ffmpeg -y -copyts -ss 1:49 -i ~/Videos/input.mkv -c copy -t 1:00 timing-1m49s.mkv
    ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 7 (SUSE Linux)
     configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-netcdf --enable-vaapi --enable-vdpau --enable-libfdk_aac --enable-nonfree --enable-libmp3lame --enable-libtwolame --enable-libx264 --enable-libx265 --enable-libxvid
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    Input #0, matroska,webm, from '/home/ariel/Videos/input.mkv':
     Metadata:
       encoder         : libebml v0.7.7 + libmatroska v0.8.0
       creation_time   : 2006-07-20T03:07:03.000000Z
     Duration: 00:23:57.06, start: 0.000000, bitrate: 1983 kb/s
       Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x480, SAR 37:30 DAR 37:20, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
       Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
       Stream #0:2(jpn): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
       Stream #0:3(eng): Subtitle: dvd_subtitle, 720x480 (default)
       Metadata:
         title           : English Audio
       Stream #0:4(eng): Subtitle: dvd_subtitle, 720x480
       Metadata:
         title           : Japanese Audio
    Output #0, matroska, to 'timing-1m49s.mkv':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 720x480 [SAR 37:30 DAR 37:20], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
       Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default)
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    
    video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

    Wrong. It outputs a file with no frames :

    -rwxrwx--- 1 root users 805 Jul 30 01:36 timing-1m49s.mkv

    I have to specify -t 1:49 or more, and e.g. -t 1:55 produces a 6-second file that starts at 0:00 and according to the metadata should last 1:55.

    I arrived at this point trying to extract a clip and add subtitles in the same command, but this minimal case looks to me contrary to the documentation.

  • Glitchy audio or broken video in fragmented MP4

    6 septembre 2022, par PookyFan

    I'm working on small C++ library for muxing audio and video. This is basically a facade for FFMPEG functions and structures. The code is here with minimal reproduction testing code here and as of now it seems like it's working fine... almost.

    


    For the record - my MP4 file is so-called "fragmented MP4", with headers moved at the beginning of the file in a way that would allow to stream that file (ie. play it in a browser while it's being buffered). That's what these movflags I'm setting in Mp4Muxer::writeHeader() are for.

    


    While testing this library with raw H264 video stream and MP3 file (video is <1 min long, MP3 - a few minutes long), I observed that :

    &#xA;

      &#xA;
    • if I don't limit muxing audio stream when it's way "ahead" of the video (and it will be since MP3 is longer, so eventually video frames stop coming but audio frames still come in), all muxes just fine with no errors, but playing output MP4 with ffplay after just a few seconds results in the following log (and also frozen video, while audio keeps playing) :
    • &#xA;

    &#xA;

    [h264 @ 0x7f90a40ae2c0] Invalid NAL unit size (2162119 > 76779).0&#xA;[h264 @ 0x7f90a40ae2c0] Error splitting the input into NAL units.&#xA;[mp3float @ 0x7f90a4009540] Header missing  515KB sq=    0B f=0/0&#xA;[h264 @ 0x7f90a40cb0c0] Invalid NAL unit size (-860010620 > 17931).&#xA;[h264 @ 0x7f90a40cb0c0] Error splitting the input into NAL units.&#xA;[h264 @ 0x7f90a42bf440] Invalid NAL unit size (-168012642 > 8000).&#xA;[h264 @ 0x7f90a42bf440] Error splitting the input into NAL units.&#xA;[h264 @ 0x7f90a42fa780] Invalid NAL unit size (-1843711407 > 5683).&#xA;[ and it repeats...]&#xA;

    &#xA;

      &#xA;
    • even if I limit how much a stream can be "ahead" of the other, limiting it too much results in no muxed data in the output
    • &#xA;

    • any other intermediate level of limiting how much one stream can be buffered in muxer relative to the other stream results in glitchy audio, with the following errors popping out every now and then in ffplay (the more strict limit is, the more often they are printed) :
    • &#xA;

    &#xA;

    [mp3float @ 0x7f744c01b640] overread, skip -6 enddists: -1 -1=0/0 &#xA;

    &#xA;

    Not limitting muxed audio (at all or enough) relative to muxed video also results in following messages in my muxing application :

    &#xA;

    [mp4 @ 0x55d0c6c21940] Delay between the first packet and last packet in the muxing queue is 10004898 > 10000000: forcing output&#xA;

    &#xA;

    For now, the fix is quite ugly and I don't even understand why it works, but before writting MP4 header I manually set a limit for frames buffered by muxer, like so :

    &#xA;

    formatCtxt->max_interleave_delta = 10000000LL * 10LL;&#xA;

    &#xA;

    This way the muxer can store more packets of one stream that's way "ahead" of the other (maximum difference between DTS of the packets at the beginning and at the end of queue is set to 10x larger than default ; it also gets rid of information log mentioned above). Obviously, I'd like to resolve it more properly, without hacking things like that.

    &#xA;

    I was trying various things, including manual skipping of ID3 tags in MP3 file (but seems like FFMPEG handles them just fine and it didn't change anything). I was also experimenting with FLAC in MP4 instead of MP3. and while I know it's rather experimental thing, I encountered very similar problems with glitching audio (no problem with video being frozen when lots of audio data gets muxed, though). It also seems that problem with glitching audio or frozen video varies in scale depending on how large are input data chunks that I feed muxer with. For now, honestly, I'm out of ideas.

    &#xA;

  • The ffmpeg webm_dash_manifest demuxer fails with webvtt subtitles

    30 janvier 2020, par Hyldrean

    I am trying to create a DASH manifest using ffmpeg and I encounter some difficulties with the subtitles. I get the error

    [webm_dash_manifest @ 0x55e19db48180] EBML header parsing failed
    [webm_dash_manifest @ 0x55e19db48180] Failed to read file headers
    subtitles.vtt: Operation not permitted

    The subtitles are encoded in the plain text webvtt format. I first assume that the EBML header are missing because the subtitles were not contained in a webm container. I then tried to create a webm file containing only the subtitles. It appears impossible.

    I think the problem comes from the webm_dash_manifest demuxer. It seeks metadata in a file with no metadata. However neither Google nor Stack Overflow give me an answer.

    The command I used :

    ffmpeg \
    -f webm_dash_manifest -i video.webm \
    -f webm_dash_manifest -i audio.webm \
    -f webm_dash_manifest -i subtitles.vtt \
    -map 0 -map 1 -map 2 \
    -c copy \
    -f webm_dash_manifest \
    -adaptation_sets "id=0,streams=0 id=1,streams=1 id=2,stream=2" \
    minimal.mpd

    and the ffmpeg output :

    ffmpeg version 3.2.14-1~deb9u1 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
     configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     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
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [webm_dash_manifest @ 0x55e19db17160] Could not find codec parameters for stream 0 (Video: vp9, none, 1280x534): unspecified pixel format
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, webm_dash_manifest, from 'video.webm':
     Metadata:
       title           : Cloud Atlas
       ENCODER         : Lavf58.35.104
     Duration: 00:05:00.01, bitrate: 998 kb/s
       Chapter #0:0: start 0.000000, end 300.000000
       Metadata:
         title           : Chapter 01
       Stream #0:0(eng): Video: vp9, none, 1280x534, SAR 1:1 DAR 640:267, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default) (forced)
       Metadata:
         title           : Video @ 6.9 Mbps [frame B:188517 Avg QP:20.66]
         ENCODER         : Lavc58.66.100 libvpx-vp9
         DURATION        : 00:05:00.008000000
         webm_dash_manifest_duration: 300008
         webm_dash_manifest_initialization_range: 900
         webm_dash_manifest_file_name: video.webm
         webm_dash_manifest_track_number: 1
         webm_dash_manifest_cues_start: 37455991
         webm_dash_manifest_cues_end: 37457486
         webm_dash_manifest_bandwidth: 1420427
         webm_dash_manifest_cluster_keyframe: 1
         webm_dash_manifest_cue_timestamps: 298715
    Input #1, webm_dash_manifest, from 'audio.webm':
     Metadata:
       title           : Cloud Atlas
       ENCODER         : Lavf58.35.104
     Duration: 00:05:00.01, bitrate: 126 kb/s
       Chapter #1:0: start 0.000000, end 300.000000
       Metadata:
         title           : Chapter 01
       Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
       Metadata:
         title           : Audio Eng DTS 5.1 channels 24 bits @ 1509 Kbps cbr
         ENCODER         : Lavc58.66.100 libopus
         DURATION        : 00:05:00.007000000
         webm_dash_manifest_duration: 300007
         webm_dash_manifest_initialization_range: 838
         webm_dash_manifest_file_name: audio.webm
         webm_dash_manifest_track_number: 1
         webm_dash_manifest_cues_start: 4744091
         webm_dash_manifest_cues_end: 4745279
         webm_dash_manifest_bandwidth: 137531
         webm_dash_manifest_cluster_keyframe: 1
         webm_dash_manifest_cue_timestamps: 295000
    [webm_dash_manifest @ 0x55e19db48180] EBML header parsing failed
    [webm_dash_manifest @ 0x55e19db48180] Failed to read file headers
    subtitles.vtt: Operation not permitted

    I noticed that ffmpeg -f webm_dash_manifest -i subtitles.vtt suffices to reproduce the error.

    I have also tried without the -f webm_dash_manifest flag, with no success :

    ffmpeg \
    -f webm_dash_manifest -i video.webm \
    -f webm_dash_manifest -i audio.webm \
    -i subtitles.vtt \
    -map 0 -map 1 -map 2 \
    -c copy \
    -f webm_dash_manifest \
    -adaptation_sets "id=0,streams=0 id=1,streams=1 id=2,stream=2" minimal.mpd

    Output :

    ffmpeg version 3.2.14-1~deb9u1 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
     configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     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
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [webm_dash_manifest @ 0x557f55dd1160] Could not find codec parameters for stream 0 (Video: vp9, none, 1280x534): unspecified pixel format
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, webm_dash_manifest, from 'video.webm':
     Metadata:
       title           : Cloud Atlas
       ENCODER         : Lavf58.35.104
     Duration: 00:05:00.01, bitrate: 998 kb/s
       Chapter #0:0: start 0.000000, end 300.000000
       Metadata:
         title           : Chapter 01
       Stream #0:0(eng): Video: vp9, none, 1280x534, SAR 1:1 DAR 640:267, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default) (forced)
       Metadata:
         title           : Video @ 6.9 Mbps [frame B:188517 Avg QP:20.66]
         ENCODER         : Lavc58.66.100 libvpx-vp9
         DURATION        : 00:05:00.008000000
         webm_dash_manifest_duration: 300008
         webm_dash_manifest_initialization_range: 900
         webm_dash_manifest_file_name: video.webm
         webm_dash_manifest_track_number: 1
         webm_dash_manifest_cues_start: 37455991
         webm_dash_manifest_cues_end: 37457486
         webm_dash_manifest_bandwidth: 1420427
         webm_dash_manifest_cluster_keyframe: 1
         webm_dash_manifest_cue_timestamps: 298715
    Input #1, webm_dash_manifest, from 'audio.webm':
     Metadata:
       title           : Cloud Atlas
       ENCODER         : Lavf58.35.104
     Duration: 00:05:00.01, bitrate: 126 kb/s
       Chapter #1:0: start 0.000000, end 300.000000
       Metadata:
         title           : Chapter 01
       Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
       Metadata:
         title           : Audio Eng DTS 5.1 channels 24 bits @ 1509 Kbps cbr
         ENCODER         : Lavc58.66.100 libopus
         DURATION        : 00:05:00.007000000
         webm_dash_manifest_duration: 300007
         webm_dash_manifest_initialization_range: 838
         webm_dash_manifest_file_name: audio.webm
         webm_dash_manifest_track_number: 1
         webm_dash_manifest_cues_start: 4744091
         webm_dash_manifest_cues_end: 4745279
         webm_dash_manifest_bandwidth: 137531
         webm_dash_manifest_cluster_keyframe: 1
         webm_dash_manifest_cue_timestamps: 295000
    Input #2, webvtt, from 'subtitles.vtt':
     Duration: N/A, bitrate: N/A
       Stream #2:0: Subtitle: webvtt
    Could not write header for output file #0 (incorrect codec parameters ?): Operation not permittedStream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #1:0 -> #0:1 (copy)
     Stream #2:0 -> #0:2 (copy)
       Last message repeated 1 times

    Note : [webm_dash_manifest @ 0x557f55dd1160] Could not find codec parameters for stream 0 (Video: vp9, none, 1280x534): unspecified pixel format is harmless according to this post.

    The subtitles have been extracted with ffmpeg :

    ffmpeg -i "Cloud Atlas.mkv" -map 0:6 -t 00:05:00 -c:s webvtt -dash 1 subtitles.vtt

    Thank you for reading my long post, I have no idea what to do next.

    EDIT : The WebM Project website says : ’Initial WebM release does not support subtitles’. Has someone heard of a new release ? Or a convenient way to create DASH manifest with subtitles ?