Recherche avancée

Médias (91)

Autres articles (28)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

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

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (6264)

  • FFMPEG subtitle : mov_text removal

    27 mars 2014, par user3461178

    I have problems with subtitles. My video playout can not play them. So I have been trying to remove it.

    C:\Users\Jakub\Desktop\eclipse\workspace\tvpohoda_archiv>"c:\\lib/ffmpeg/bin/ffm
    peg.exe" -i "videa/1050028-CITRON_-_Uz_zavrate_ridnou_c.m4v"  -sn -c:a copy -c:v
    copy  "videa/1050028-CITRON_-_Uz_zavrate_ridnou_c2.mov"
    ffmpeg version N-57650-gcb52d6d Copyright (c) 2000-2013 the FFmpeg developers
     built on Oct 30 2013 20:35:46 with gcc 4.8.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
    e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
    ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
    cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
    ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
     libavutil      52. 48.100 / 52. 48.100
     libavcodec     55. 39.100 / 55. 39.100
     libavformat    55. 19.104 / 55. 19.104
     libavdevice    55.  5.100 / 55.  5.100
     libavfilter     3. 90.100 /  3. 90.100
     libswscale      2.  5.101 /  2.  5.101
     libswresample   0. 17.104 /  0. 17.104
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videa/1050028-CITRON_-_Uz_zavrate_ridno
    u_c.m4v':
     Metadata:
       major_brand     : M4V
       minor_version   : 512
       compatible_brands: isomiso2avc1
       encoder         : Lavf55.19.104
     Duration: 00:04:56.49, start: 0.021333, bitrate: 7239 kb/s
       Chapter #0.0: start 0.000000, end 296.400000
       Metadata:
         title           : Chapter 1
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [
    SAR 212:225 DAR 53:45], 6997 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 24
    0 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574)
       Metadata:
         handler_name    : SubtitleHandler
    File 'videa/1050028-CITRON_-_Uz_zavrate_ridnou_c2.mov' already exists. Overwrite
    ? [y/N] y
    Output #0, mov, to 'videa/1050028-CITRON_-_Uz_zavrate_ridnou_c2.mov':
     Metadata:
       major_brand     : M4V
       minor_version   : 512
       compatible_brands: isomiso2avc1
       encoder         : Lavf55.19.104
       Chapter #0.0: start 0.021000, end 296.421000
       Metadata:
         title           : Chapter 1
       Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 720x576 [SAR 212
    :225 DAR 53:45], q=2-31, 6997 kb/s, 25 fps, 12800 tbn, 12800 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, 240 kb/s
    (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame= 7408 fps=0.0 q=-1.0 Lsize=  262031kB time=00:04:56.49 bitrate=7239.9kbits
    /s
    video:253116kB audio:8700kB subtitle:0 global headers:0kB muxing overhead 0.0820
    40%

    Or :

    C:\Users\Jakub\Desktop\eclipse\workspace\tvpohoda_archiv>"c:\\lib/ffmpeg/bin/ffm
    peg.exe" -i "videa/1050028-CITRON_-_Uz_zavrate_ridnou_c.m4v"  -map 0:0 -map 0:1
    -c:a copy -c:v copy  "videa/1050028-CITRON_-_Uz_zavrate_ridnou_c2.mov"
    ffmpeg version N-57650-gcb52d6d Copyright (c) 2000-2013 the FFmpeg developers
     built on Oct 30 2013 20:35:46 with gcc 4.8.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
    e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
    ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
    cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
    ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
     libavutil      52. 48.100 / 52. 48.100
     libavcodec     55. 39.100 / 55. 39.100
     libavformat    55. 19.104 / 55. 19.104
     libavdevice    55.  5.100 / 55.  5.100
     libavfilter     3. 90.100 /  3. 90.100
     libswscale      2.  5.101 /  2.  5.101
     libswresample   0. 17.104 /  0. 17.104
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videa/1050028-CITRON_-_Uz_zavrate_ridno
    u_c.m4v':
     Metadata:
       major_brand     : M4V
       minor_version   : 512
       compatible_brands: isomiso2avc1
       encoder         : Lavf55.19.104
     Duration: 00:04:56.49, start: 0.021333, bitrate: 7239 kb/s
       Chapter #0.0: start 0.000000, end 296.400000
       Metadata:
         title           : Chapter 1
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [
    SAR 212:225 DAR 53:45], 6997 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 24
    0 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574)
       Metadata:
         handler_name    : SubtitleHandler
    Output #0, mov, to 'videa/1050028-CITRON_-_Uz_zavrate_ridnou_c2.mov':
     Metadata:
       major_brand     : M4V
       minor_version   : 512
       compatible_brands: isomiso2avc1
       encoder         : Lavf55.19.104
       Chapter #0.0: start 0.021000, end 296.421000
       Metadata:
         title           : Chapter 1
       Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 720x576 [SAR 212
    :225 DAR 53:45], q=2-31, 6997 kb/s, 25 fps, 12800 tbn, 12800 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, 240 kb/s
    (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame= 2702 fps=0.0 q=-1.0 size=   95498kB time=00:01:48.03 bitrate=7241.6kbits/
    frame= 4436 fps=4435 q=-1.0 size=  157319kB time=00:02:57.38 bitrate=7265.2kbits
    frame= 6296 fps=4196 q=-1.0 size=  223194kB time=00:04:11.77 bitrate=7262.0kbits
    frame= 7408 fps=4121 q=-1.0 Lsize=  262031kB time=00:04:56.49 bitrate=7239.9kbit
    s/s
    video:253116kB audio:8700kB subtitle:0 global headers:0kB muxing overhead 0.0820
    40%

    But it did not worked, subtitles have stayed there.

    i am normally starting this ffmpeg from java but this files are from command line

    Please can you help me ?

  • Using FFmpeg to encode 2pass mp4

    30 juin 2016, par Erin.Yang

    I am trying to use FFmpeg to encode my 4K mp4 file to a 2pass 265 mp4 file for the purposes of testing. I am new to video compression and hope I’m making a simple mistake that someone can correct.

    All infos in command line as below :

    C:\Ying\FF>C:\Ying\FF\ffmpeg.exe -y -i C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4 -preset veryslow -x265-params pass=1 -vcodec hevc -b:v 15M -acodec libvo
    _aacenc -b:a 128K C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4
    ffmpeg version N-74286-ge5774f2 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.3 (GCC)
     configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontco
    nfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-l
    ibfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-am
    rwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
    twolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --en
    able-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
     libavutil      54. 30.100 / 54. 30.100
     libavcodec     56. 57.100 / 56. 57.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 32.100 /  5. 32.100
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : X-MEN__DAYS_OF_FUTURE_PAST.Title800
       encoder         : Lavf56.40.101
     Duration: 00:00:50.01, start: 0.000000, bitrate: 11067 kb/s
       Chapter #0:0: start 0.000000, end 50.000000
       Metadata:
         title           : (26)01:17:27:726
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], 11492 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (de
    fault)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 0 kb/s
       Metadata:
         handler_name    : SubtitleHandler
    x265 [info]: HEVC encoder version 1.7
    x265 [info]: build info [Windows][GCC 4.9.2][64 bit] 8bpp
    x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    x265 [info]: Main profile, Level-5 (Main tier)
    x265 [info]: Thread pool created using 32 threads
    x265 [info]: frame threads / pool features       : 8 / wpp(34 rows)
    x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
    x265 [info]: Residual QT: max TU size, max depth : 32 / 3 inter / 3 intra
    x265 [info]: ME / range / subpel / merge         : dia / 57 / 2 / 1
    x265 [info]: Keyframe min / max / scenecut       : 25 / 250 / 40
    x265 [info]: Lookahead / bframes / badapt        : 40 / 8 / 2
    x265 [info]: b-pyramid / weightp / weightb / refs: 1 / 1 / 1 / 1
    x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 64 / 1
    x265 [info]: Rate Control / qCompress            : ABR-15000 kbps / 0.60
    x265 [info]: tools: rd=2 psy-rd=0.30 rdoq=2 psy-rdoq=1.00 early-skip signhide
    x265 [info]: tools: tmvp b-intra fast-intra strong-intra-smoothing deblock sao
    x265 [info]: tools: stats-write
    Output #0, mp4, to 'C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : X-MEN__DAYS_OF_FUTURE_PAST.Title800
       encoder         : Lavf56.40.101
       Chapter #0:0: start 0.000000, end 50.000000
       Metadata:
         title           : (26)01:17:27:726
       Stream #0:0(und): Video: hevc (libx265) ([35][0][0][0] / 0x0023), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 15000 kb/s, 30 fps, 15360 tbn, 30
    tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc56.57.100 libx265
       Stream #0:1(und): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc56.57.100 libvo_aacenc
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
     Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
    Press [q] to stop, [?] for help
    frame= 1502 fps=2.6 q=-0.0 Lsize=  100652kB time=00:00:50.01 bitrate=16485.9kbits/s dup=75 drop=0
    video:99814kB audio:782kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 0.054657%
    x265 [info]: frame I:     11, Avg QP:13.26  kb/s: 59293.48
    x265 [info]: frame P:    443, Avg QP:15.21  kb/s: 33977.10
    x265 [info]: frame B:   1048, Avg QP:18.35  kb/s: 8420.64
    x265 [info]: global :   1502, Avg QP:17.39  kb/s: 16330.84
    x265 [info]: Weighted P-Frames: Y:4.5% UV:4.5%
    x265 [info]: Weighted B-Frames: Y:1.9% UV:1.6%
    x265 [info]: consecutive B-frames: 23.8% 11.9% 14.8% 22.9% 17.8% 7.0% 0.0% 0.0% 1.8%

    C:\Ying\FF>C:\Ying\FF\ffmpeg.exe -y -i C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4 -preset veryslow -x265-params pass=2 -vcodec hevc -b:v 15M -acodec libvo
    _aacenc -b:a 128K C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4
    ffmpeg version N-74286-ge5774f2 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.3 (GCC)
     configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontco
    nfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-l
    ibfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-am
    rwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
    twolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --en
    able-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
     libavutil      54. 30.100 / 54. 30.100
     libavcodec     56. 57.100 / 56. 57.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 32.100 /  5. 32.100
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Ying\FF\Xman-4K_50sec_3840x2160.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : X-MEN__DAYS_OF_FUTURE_PAST.Title800
       encoder         : Lavf56.40.101
     Duration: 00:00:50.01, start: 0.000000, bitrate: 11067 kb/s
       Chapter #0:0: start 0.000000, end 50.000000
       Metadata:
         title           : (26)01:17:27:726
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], 11492 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (de
    fault)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 0 kb/s
       Metadata:
         handler_name    : SubtitleHandler
    x265 [info]: HEVC encoder version 1.7
    x265 [info]: build info [Windows][GCC 4.9.2][64 bit] 8bpp
    x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    x265 [info]: Main profile, Level-6 (Main tier)
    x265 [info]: Thread pool created using 32 threads
    x265 [info]: frame threads / pool features       : 8 / wpp(34 rows)
    x265 [error]: statistics are damaged at line 1495, parser out=1
    [libx265 @ 0000000001e97d00] Cannot open libx265 encoder.
    Output #0, mp4, to 'C:\Ying\FF\Xman-4K_3840x2160_50sec_15M_H265_veryslow_2pass.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : X-MEN__DAYS_OF_FUTURE_PAST.Title800
       encoder         : Lavf56.40.101
       Chapter #0:0: start 0.000000, end 50.000000
       Metadata:
         title           : (26)01:17:27:726
       Stream #0:0(und): Video: hevc, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 30 fps (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc56.57.100 libx265
       Stream #0:1(und): Audio: aac, 0 channels, 128 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc56.57.100 libvo_aacenc
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
     Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    MediaInfo :

    General
    Complete name                            : E:\4K\2ndRound\Xman-4K_50sec_3840x2160.mp4.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 66.0 MiB
    Duration                                 : 50s 6ms
    Overall bit rate                         : 11.1 Mbps
    Movie name                               : X-MEN__DAYS_OF_FUTURE_PAST.Title800
    Writing application                      : Lavf56.40.101

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L5.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 47s 567ms
    Bit rate                                 : 11.5 Mbps
    Width                                    : 3 840 pixels
    Height                                   : 2 160 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 30.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.046
    Stream size                              : 65.2 MiB (99%)

    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 50s 6ms
    Bit rate mode                            : Constant
    Bit rate                                 : 128 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 781 KiB (1%)

    Menu #1
    ID                                       : 3
    Codec ID                                 : text
    Duration                                 : 50s 0ms
    Language                                 : English

    Menu #2
    00:00:00.000                             : (26)01:17:27:726

  • ffmpeg concatenation after using drawtext filter

    12 août 2016, par Sven Hoskens

    I’m fairly new to ffmpeg, but after a few days of searching on this issue, I’ve completely hit a brick wall. Any help would be appreciated.

    My use case : Our client wants to upload videos for multiple regions. Each video will be the same format, 1920x1080, mp4. For each region, they want to add a different image at the end of the video, for a few seconds. This image contains their logo, some additional info, and a variable code. They will enter this code alongside the uploaded video. The image stays the same, so is already present on the server.
    So basically, I have an input video, a video of an image, and a small code. I need to add this code to the video of the image (in a predefined position), and then I need to add the resulting video to the end of the input video. Once that is complete, I just need to output the video in 1920x1080 and in 1024x576.

    I have tried several things, but the concatenation step always fails with the manipulated video’s.

    Attempt 1

    In my first attempt, I used ffmpeg to create a video from an image, and add the text in the designated area.

    ffmpeg -y -f lavfi -i image.png -r 30 -t 10 -pix_fmt yuv420p -map 0:v -vf drawtext="fontfile=HelveticaNeue.dfont: text='GLNS/TEST/1234b': fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=7: x=179: y=805" imageVideo.mp4

    This command creates a .mp4 video of the correct size, with a duration of 10 seconds, and adds the text ’GLNS/TEST/1234b’ in the correct location.

    Next, I use the following command to concatenate the two videos. Both have the same resolution and codec.

    ffmpeg -f concat -safe 0 -i config.txt -vf scale=1920:1080 outputHD.mp4 -vf scale=1024:576 outputSD.mp4

    config.txt contains following :

    file my_input_file.mp4
    file ImageVideo.mp4

    This concatenation works with regular videos. However, when I use it with ImageVideo.mp4 (the one created by the first command) I get this error log :

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f86dc924600] Auto-inserting h264_mp4toannexb bitstream filtereed=0.509x    
    [aac @ 0x7f86dc019e00] Number of bands (31) exceeds limit (5).
    Error while decoding stream #0:1: Invalid data found when processing input
    [aac @ 0x7f86dc019e00] Number of bands (27) exceeds limit (8).
    Error while decoding stream #0:1: Invalid data found when processing input
    [h264 @ 0x7f86dd857200] Error splitting the input into NAL units.
    [h264 @ 0x7f86dd829400] Invalid NAL unit size.
    [h264 @ 0x7f86dd829400] Error splitting the input into NAL units.
    [aac @ 0x7f86dc019e00] Number of bands (10) exceeds limit (1).
    Error while decoding stream #0:1: Invalid data found when processing input
    [h264 @ 0x7f86dd816800] Invalid NAL unit size.
    [h264 @ 0x7f86dd816800] Error splitting the input into NAL units.
    [aac @ 0x7f86dc019e00] Number of bands (24) exceeds limit (1).
    Error while decoding stream #0:1: Invalid data found when processing input

    #this goes on for a few hundred lines

    The resulting output is identical to the input video, but does not contain the desired image video at the end.

    Attempt 2

    Since the above attempt didn’t work, I tried concatenating a video I let our designer make of the image with Adobe After Effects. This video was also saved as a .mp4 with the H264 codec. If I concatenate the input video and this one, I get a correct result. However, as soon as I add the code in the designated area with this command :

    ffmpeg -i new_image_video.mp4 -vf drawtext="fontfile=HelveticaNeue.dfont: text='GLNS/TEST/1234b': fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=7: x=179: y=805" -c:v libx264 imageVideo.mp4

    I get this error :

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff94c800000] Auto-inserting h264_mp4toannexb bitstream filter97x    
    [h264 @ 0x7ff94b053800] top block unavailable for requested intra mode -1
    [h264 @ 0x7ff94b053800] error while decoding MB 0 0, bytestream 49526
    [h264 @ 0x7ff94b053e00] number of reference frames (1+3) exceeds max (3; probably corrupt input), discarding one
    [h264 @ 0x7ff94b053e00] chroma_log2_weight_denom 28 is out of range
    [h264 @ 0x7ff94b053e00] illegal long ref in memory management control operation 2
    [h264 @ 0x7ff94b053e00] cabac_init_idc 32 overflow
    [h264 @ 0x7ff94b053e00] decode_slice_header error
    [h264 @ 0x7ff94b053e00] no frame!
    [h264 @ 0x7ff94b053800] concealing 8160 DC, 8160 AC, 8160 MV errors in I frame
    [h264 @ 0x7ff94b072a00] reference overflow 22 > 15 or 0 > 15
    [h264 @ 0x7ff94b072a00] decode_slice_header error
    [h264 @ 0x7ff94b072a00] no frame!
    [h264 @ 0x7ff94b01a400] illegal modification_of_pic_nums_idc 20
    [h264 @ 0x7ff94b01a400] decode_slice_header error
    [h264 @ 0x7ff94b01a400] no frame!
    [h264 @ 0x7ff94b01aa00] illegal modification_of_pic_nums_idc 20
    [h264 @ 0x7ff94b01aa00] decode_slice_header error
    [h264 @ 0x7ff94b01aa00] no frame!
    Error while decoding stream #0:0: Invalid data found when processing input
    [h264 @ 0x7ff94b053800] deblocking_filter_idc 8 out of range
    [h264 @ 0x7ff94b053800] decode_slice_header error
    [h264 @ 0x7ff94b053800] no frame!
    Error while decoding stream #0:0: Invalid data found when processing input
    [h264 @ 0x7ff94b053e00] illegal memory management control operation 8
    [h264 @ 0x7ff94b053e00] co located POCs unavailable
    [h264 @ 0x7ff94b053e00] error while decoding MB 2 0, bytestream -35
    [h264 @ 0x7ff94b053e00] concealing 8160 DC, 8160 AC, 8160 MV errors in B frame
    [h264 @ 0x7ff94b072a00] number of reference frames (1+3) exceeds max (3; probably corrupt input), discarding one

    # this goes on for a while...

    [h264 @ 0x7ff94b01a400] concealing 4962 DC, 4962 AC, 4962 MV errors in B frame
    Error while decoding stream #0:0: Invalid data found when processing input
    frame= 2553 fps= 17 q=-1.0 Lsize=   26995kB time=00:01:42.16 bitrate=2164.6kbits/s dup=0 drop=60 speed=0.697x    
    video:25258kB audio:1661kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.285236%
    [libx264 @ 0x7ff94b810400] frame I:35    Avg QP:17.45  size: 55070
    [libx264 @ 0x7ff94b810400] frame P:711   Avg QP:19.73  size: 18712
    [libx264 @ 0x7ff94b810400] frame B:1807  Avg QP:21.53  size:  5884
    [libx264 @ 0x7ff94b810400] consecutive B-frames:  3.4%  5.0%  4.9% 86.6%
    [libx264 @ 0x7ff94b810400] mb I  I16..4: 38.2% 49.3% 12.5%
    [libx264 @ 0x7ff94b810400] mb P  I16..4: 12.4% 14.0%  1.0%  P16..4: 29.6%  4.8%  1.9%  0.0%  0.0%    skip:36.2%
    [libx264 @ 0x7ff94b810400] mb B  I16..4:  1.5%  1.2%  0.1%  B16..8: 27.3%  1.6%  0.1%  direct: 1.8%  skip:66.4%  L0:45.8% L1:51.4% BI: 2.8%
    [libx264 @ 0x7ff94b810400] 8x8 transform intra:49.5% inter:85.4%
    [libx264 @ 0x7ff94b810400] coded y,uvDC,uvAC intra: 21.2% 22.3% 2.5% inter: 4.6% 7.0% 0.0%
    [libx264 @ 0x7ff94b810400] i16 v,h,dc,p: 23% 26% 10% 41%
    [libx264 @ 0x7ff94b810400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 19% 35%  3%  3%  3%  3%  3%  2%
    [libx264 @ 0x7ff94b810400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 20% 16%  5%  7%  6%  5%  5%  4%
    [libx264 @ 0x7ff94b810400] i8c dc,h,v,p: 67% 16% 15%  2%
    [libx264 @ 0x7ff94b810400] Weighted P-Frames: Y:7.3% UV:4.2%
    [libx264 @ 0x7ff94b810400] ref P L0: 66.3%  8.7% 17.9%  7.0%  0.1%
    [libx264 @ 0x7ff94b810400] ref B L0: 88.2% 10.1%  1.7%
    [libx264 @ 0x7ff94b810400] ref B L1: 94.9%  5.1%
    [libx264 @ 0x7ff94b810400] kb/s:2026.12
    [aac @ 0x7ff94b072400] Qavg: 635.626

    The resulting output is identical to the input video, but does not contain the desired image video at the end.

    One thing I have noticed : When I inspect the video files on mac (Get info) they always contain these lines at ’More info’ :

    Dimensions: 1920 x 1080
    Codecs: H.264, AAC
    Color profile: HD(1-1-1)
    Duration: 01:42
    Audio channels: 2
    Last opened: Today 11:02

    However, the video’s which pass through the drawtext filter have this :

    Dimensions: 1920 x 1080
    Codecs: AAC, H.264
    Duration: 00:10
    Audio channels: 2
    Last opened: Today 11:07

    As you can see, there is no color profile entry, and the codecs have switched places. I assume this is related to my issue, but I can’t seem to find a fix for it.

    PS : The application will run in a php environment (Symfony). I noticed the concat command wasn’t available in the Symfony bundle for ffmpeg, so I’m using the regular terminal commands. I’ll execute these using php.

    EDIT
    Attempt 3

    On advise of a coworker, I tried converting the video to .avi and reconverting to .mp4, in the hopes this would lose any corrupted or extra info included by the drawtext filter. This spits out a completely different error.

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f812413da00] Auto-inserting h264_mp4toannexb bitstream filtereed=0.516x    
    [concat @ 0x7f8124009a00] DTS 1569260 < 2551000 out of order
    [h264 @ 0x7f8124846800] left block unavailable for requested intra4x4 mode -1
    [h264 @ 0x7f8124846800] error while decoding MB 0 0, bytestream 47919
    [h264 @ 0x7f8124846800] concealing 8160 DC, 8160 AC, 8160 MV errors in I frame
    [aac @ 0x7f8125809a00] Queue input is backward in time
    [aac @ 0x7f8125815a00] Queue input is backward in time
    [h264 @ 0x7f8124846e00] number of reference frames (1+3) exceeds max (3; probably corrupt input), discarding one
    [h264 @ 0x7f8124846e00] chroma_log2_weight_denom 26 is out of range
    [h264 @ 0x7f8124846e00] deblocking_filter_idc 32 out of range
    [h264 @ 0x7f8124846e00] decode_slice_header error
    [h264 @ 0x7f8124846e00] no frame!
    [mp4 @ 0x7f8124802200] Non-monotonous DTS in output stream 0:1; previous: 4902912, current: 4505491; changing to 4902913. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x7f8125813000] Non-monotonous DTS in output stream 1:1; previous: 4902912, current: 4505491; changing to 4902913. This may result in incorrect timestamps in the output file.
    [h264 @ 0x7f8124803400] reference overflow 20 > 15 or 0 > 15
    [h264 @ 0x7f8124803400] decode_slice_header error
    [h264 @ 0x7f8124803400] no frame!
    [mp4 @ 0x7f8124802200] Non-monotonous DTS in output stream 0:1; previous: 4902913, current: 4506515; changing to 4902914. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x7f8125813000] Non-monotonous DTS in output stream 1:1; previous: 4902913, current: 4506515; changing to 4902914. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x7f8124802200] Non-monotonous DTS in output stream 0:1; previous: 4902914, current: 4507539; changing to 4902915. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x7f8125813000] Non-monotonous DTS in output stream 1:1; previous: 4902914, current: 4507539; changing to 4902915. This may result in incorrect timestamps in the output file.

    # Again, this continues for quite a while.