Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (42)

  • 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

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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (5096)

  • FFMPEG-PHP on Windows (not Linux as prev question) error Unknown encoder 'libfaac'

    19 novembre 2020, par Jonathan

    I am doing this on a Windows server and is not already answered as per the other question on here on a Linux server.

    


    Im using FFMPEG on a project handling video uploads and I keep getting an issue with Videos with AAC audio encoding.

    


    I tried using aac and other aac encoders, but the windows version of FFMPEG says unknown encoders. I tried without setting an AudioCode so it might convert to native. But still the same.

    


    Please see the log output below :

    


    <pre>object(FFMpeg\Exception\RuntimeException)#35 (7) {&#xA;  ["message":protected]=>&#xA;  string(15) "Encoding failed"&#xA;  ["string":"Exception":private]=>&#xA;  string(0) ""&#xA;  ["code":protected]=>&#xA;  int(0)&#xA;  ["file":protected]=>&#xA;  string(108) "C:\inetpub\wwwroot\dev\ffmpeg-lib\ffmpeg-php\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Media\AbstractVideo.php"&#xA;  ["line":protected]=>&#xA;  int(106)&#xA;  ["trace":"Exception":private]=>&#xA;  array(1) {&#xA;    [0]=>&#xA;    array(5) {&#xA;      ["file"]=>&#xA;      string(45) "C:\inetpub\wwwroot\dev\ffmpeg-lib\process.php"&#xA;      ["line"]=>&#xA;      int(35)&#xA;      ["function"]=>&#xA;      string(4) "save"&#xA;      ["class"]=>&#xA;      string(26) "FFMpeg\Media\AbstractVideo"&#xA;      ["type"]=>&#xA;      string(2) "->"&#xA;    }&#xA;  }&#xA;  ["previous":"Exception":private]=>&#xA;  object(Alchemy\BinaryDriver\Exception\ExecutionFailureException)#43 (9) {&#xA;    ["command":protected]=>&#xA;    string(397) "C:\ffmpeg\bin\ffmpeg.exe -y -ss 00:00:17.00 -i "temp/temp_20201110-100656_1080p-220mb.mp4" -t 00:00:52.00 -threads 12 -vcodec libx264 -acodec libfaac -b:v 1000k -refs 6 -coder 1 -sc_threshold 40 -flags &#x2B;loop -me_range 16 -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k -pass 1 -passlogfile "W:/TempIIS\ffmpeg-passes5fabd88bb6b0912dmm/pass-5fabd88bb6c3b" "temp/20201111-122651.mp4""&#xA;    ["errorOutput":protected]=>&#xA;    string(2301) "ffmpeg version git-2020-08-31-4a11a6f Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200805&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --enable-libsvtav1 --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 58.100 / 56. 58.100&#xA;  libavcodec     58.101.101 / 58.101.101&#xA;  libavformat    58. 51.101 / 58. 51.101&#xA;  libavdevice    58. 11.101 / 58. 11.101&#xA;  libavfilter     7. 87.100 /  7. 87.100&#xA;  libswscale      5.  8.100 /  5.  8.100&#xA;  libswresample   3.  8.100 /  3.  8.100&#xA;  libpostproc    55.  8.100 / 55.  8.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;temp/temp_20201110-100656_1080p-220mb.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 19529854&#xA;    compatible_brands: mp42isom&#xA;    creation_time   : 2016-04-11T06:32:53.000000Z&#xA;  Duration: 00:02:25.98, start: 0.000000, bitrate: 13772 kb/s&#xA;    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2016-04-11T06:32:53.000000Z&#xA;      handler_name    : Sound Media Handler&#xA;    Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 13639 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2016-04-11T06:32:53.000000Z&#xA;      handler_name    : Video Media Handler&#xA;      encoder         : AVC Coding&#xA;Unknown encoder &#x27;libfaac&#x27;&#xA;"&#xA;    ["message":protected]=>&#xA;    string(2750) "ffmpeg failed to execute command C:\ffmpeg\bin\ffmpeg.exe -y -ss 00:00:17.00 -i "temp/temp_20201110-100656_1080p-220mb.mp4" -t 00:00:52.00 -threads 12 -vcodec libx264 -acodec libfaac -b:v 1000k -refs 6 -coder 1 -sc_threshold 40 -flags &#x2B;loop -me_range 16 -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k -pass 1 -passlogfile "W:/TempIIS\ffmpeg-passes5fabd88bb6b0912dmm/pass-5fabd88bb6c3b" "temp/20201111-122651.mp4":&#xA;&#xA;Error Output:&#xA;&#xA; ffmpeg version git-2020-08-31-4a11a6f Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200805&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --enable-libsvtav1 --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 58.100 / 56. 58.100&#xA;  libavcodec     58.101.101 / 58.101.101&#xA;  libavformat    58. 51.101 / 58. 51.101&#xA;  libavdevice    58. 11.101 / 58. 11.101&#xA;  libavfilter     7. 87.100 /  7. 87.100&#xA;  libswscale      5.  8.100 /  5.  8.100&#xA;  libswresample   3.  8.100 /  3.  8.100&#xA;  libpostproc    55.  8.100 / 55.  8.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;temp/temp_20201110-100656_1080p-220mb.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 19529854&#xA;    compatible_brands: mp42isom&#xA;    creation_time   : 2016-04-11T06:32:53.000000Z&#xA;  Duration: 00:02:25.98, start: 0.000000, bitrate: 13772 kb/s&#xA;    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2016-04-11T06:32:53.000000Z&#xA;      handler_name    : Sound Media Handler&#xA;    Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 13639 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2016-04-11T06:32:53.000000Z&#xA;      handler_name    : Video Media Handler&#xA;      encoder         : AVC Coding&#xA;Unknown encoder &#x27;libfaac&#x27;&#xA;"&#xA;    ["string":"Exception":private]=>&#xA;    string(0) ""&#xA;    ["code":protected]=>&#xA;    int(0)&#xA;    ["file":protected]=>&#xA;    string(116) "C:\inetpub\wwwroot\dev\ffmpeg-lib\ffmpeg-php\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\ProcessRunner.php"&#xA;    ["line":protected]=>&#xA;    int(95)&#xA;    ["trace":"Exception":private]=>&#xA;    array(5) {&#xA;      [0]=>&#xA;      array(5) {&#xA;        ["file"]=>&#xA;        string(116) "C:\inetpub\wwwroot\dev\ffmpeg-lib\ffmpeg-php\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\ProcessRunner.php"&#xA;        ["line"]=>&#xA;        int(73)&#xA;        ["function"]=>&#xA;        string(18) "doExecutionFailure"&#xA;        ["class"]=>&#xA;        string(34) "Alchemy\BinaryDriver\ProcessRunner"&#xA;        ["type"]=>&#xA;        string(2) "->"&#xA;      }&#xA;      [1]=>&#xA;      array(5) {&#xA;        ["file"]=>&#xA;        string(117) "C:\inetpub\wwwroot\dev\ffmpeg-lib\ffmpeg-php\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\AbstractBinary.php"&#xA;        ["line"]=>&#xA;        int(207)&#xA;        ["function"]=>&#xA;        string(3) "run"&#xA;        ["class"]=>&#xA;        string(34) "Alchemy\BinaryDriver\ProcessRunner"&#xA;        ["type"]=>&#xA;        string(2) "->"&#xA;      }&#xA;      [2]=>&#xA;      array(5) {&#xA;        ["file"]=>&#xA;        string(117) "C:\inetpub\wwwroot\dev\ffmpeg-lib\ffmpeg-php\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\AbstractBinary.php"&#xA;        ["line"]=>&#xA;        int(136)&#xA;        ["function"]=>&#xA;        string(3) "run"&#xA;        ["class"]=>&#xA;        string(35) "Alchemy\BinaryDriver\AbstractBinary"&#xA;        ["type"]=>&#xA;        string(2) "->"&#xA;      }&#xA;      [3]=>&#xA;      array(5) {&#xA;        ["file"]=>&#xA;        string(108) "C:\inetpub\wwwroot\dev\ffmpeg-lib\ffmpeg-php\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Media\AbstractVideo.php"&#xA;        ["line"]=>&#xA;        int(96)&#xA;        ["function"]=>&#xA;        string(7) "command"&#xA;        ["class"]=>&#xA;        string(35) "Alchemy\BinaryDriver\AbstractBinary"&#xA;        ["type"]=>&#xA;        string(2) "->"&#xA;      }&#xA;      [4]=>&#xA;      array(5) {&#xA;        ["file"]=>&#xA;        string(45) "C:\inetpub\wwwroot\dev\ffmpeg-lib\process.php"&#xA;        ["line"]=>&#xA;        int(35)&#xA;        ["function"]=>&#xA;        string(4) "save"&#xA;        ["class"]=>&#xA;        string(26) "FFMpeg\Media\AbstractVideo"&#xA;        ["type"]=>&#xA;        string(2) "->"&#xA;      }&#xA;    }&#xA;    ["previous":"Exception":private]=>&#xA;    NULL&#xA;  }&#xA;}&#xA;</pre>

    &#xA;

    Output of ffmpeg -encoders

    &#xA;

       V..... a64multi             Multicolor charset for Commodore 64 (codec a64_multi)&#xA; V..... a64multi5            Multicolor charset for Commodore 64, extended with 5th color (colram) (codec a64_multi5)&#xA; V..... alias_pix            Alias/Wavefront PIX image&#xA; V..... amv                  AMV Video&#xA; V..... apng                 APNG (Animated Portable Network Graphics) image&#xA; V..... asv1                 ASUS V1&#xA; V..... asv2                 ASUS V2&#xA; V..... libaom-av1           libaom AV1 (codec av1)&#xA; V..... librav1e             librav1e AV1 (codec av1)&#xA; V..... libsvtav1            SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)&#xA; V..... avrp                 Avid 1:1 10-bit RGB Packer&#xA; V..X.. avui                 Avid Meridien Uncompressed&#xA; V..... ayuv                 Uncompressed packed MS 4:4:4:4&#xA; V..... bmp                  BMP (Windows and OS/2 bitmap)&#xA; VF.... cfhd                 GoPro CineForm HD&#xA; V..... cinepak              Cinepak&#xA; V..... cljr                 Cirrus Logic AccuPak&#xA; V.S... vc2                  SMPTE VC-2 (codec dirac)&#xA; VFS... dnxhd                VC3/DNxHD&#xA; V..... dpx                  DPX (Digital Picture Exchange) image&#xA; VFS... dvvideo              DV (Digital Video)&#xA; V.S... ffv1                 FFmpeg video codec #1&#xA; VF.... ffvhuff              Huffyuv FFmpeg variant&#xA; V..... fits                 Flexible Image Transport System&#xA; V..... flashsv              Flash Screen Video&#xA; V..... flashsv2             Flash Screen Video Version 2&#xA; V..... flv                  FLV / Sorenson Spark / Sorenson H.263 (Flash Video) (codec flv1)&#xA; V..... gif                  GIF (Graphics Interchange Format)&#xA; V..... h261                 H.261&#xA; V..... h263                 H.263 / H.263-1996&#xA; V.S... h263p                H.263&#x2B; / H.263-1998 / H.263 version 2&#xA; V..... libx264              libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)&#xA; V..... libx264rgb           libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)&#xA; V..... h264_amf             AMD AMF H.264 Encoder (codec h264)&#xA; V..... h264_mf              H264 via MediaFoundation (codec h264)&#xA; V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)&#xA; V..... h264_qsv             H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)&#xA; V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)&#xA; V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)&#xA; V..... hap                  Vidvox Hap&#xA; V..... libx265              libx265 H.265 / HEVC (codec hevc)&#xA; V..... nvenc_hevc           NVIDIA NVENC hevc encoder (codec hevc)&#xA; V..... hevc_amf             AMD AMF HEVC encoder (codec hevc)&#xA; V..... hevc_mf              HEVC via MediaFoundation (codec hevc)&#xA; V..... hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)&#xA; V..... hevc_qsv             HEVC (Intel Quick Sync Video acceleration) (codec hevc)&#xA; VF.... huffyuv              Huffyuv / HuffYUV&#xA; V..... jpeg2000             JPEG 2000&#xA; VF.... libopenjpeg          OpenJPEG JPEG 2000 (codec jpeg2000)&#xA; VF.... jpegls               JPEG-LS&#xA; VF.... ljpeg                Lossless JPEG&#xA; VF.... magicyuv             MagicYUV video&#xA; VFS... mjpeg                MJPEG (Motion JPEG)&#xA; V..... mjpeg_qsv            MJPEG (Intel Quick Sync Video acceleration) (codec mjpeg)&#xA; V.S... mpeg1video           MPEG-1 video&#xA; V.S... mpeg2video           MPEG-2 video&#xA; V..... mpeg2_qsv            MPEG-2 video (Intel Quick Sync Video acceleration) (codec mpeg2video)&#xA; V.S... mpeg4                MPEG-4 part 2&#xA; V..... libxvid              libxvidcore MPEG-4 part 2 (codec mpeg4)&#xA; V..... msmpeg4v2            MPEG-4 part 2 Microsoft variant version 2&#xA; V..... msmpeg4              MPEG-4 part 2 Microsoft variant version 3 (codec msmpeg4v3)&#xA; V..... msvideo1             Microsoft Video-1&#xA; V..... pam                  PAM (Portable AnyMap) image&#xA; V..... pbm                  PBM (Portable BitMap) image&#xA; V..... pcx                  PC Paintbrush PCX image&#xA; V..... pgm                  PGM (Portable GrayMap) image&#xA; V..... pgmyuv               PGMYUV (Portable GrayMap YUV) image&#xA; VF.... png                  PNG (Portable Network Graphics) image&#xA; V..... ppm                  PPM (Portable PixelMap) image&#xA; VF.... prores               Apple ProRes&#xA; VF.... prores_aw            Apple ProRes (codec prores)&#xA; VFS... prores_ks            Apple ProRes (iCodec Pro) (codec prores)&#xA; V..... qtrle                QuickTime Animation (RLE) video&#xA; V..... r10k                 AJA Kona 10-bit RGB Codec&#xA; V..... r210                 Uncompressed RGB 10-bit&#xA; V..... rawvideo             raw video&#xA; V..... roqvideo             id RoQ video (codec roq)&#xA; V..... rpza                 QuickTime video (RPZA)&#xA; V..... rv10                 RealVideo 1.0&#xA; V..... rv20                 RealVideo 2.0&#xA; V..... sgi                  SGI image&#xA; V..... snow                 Snow&#xA; V..... sunrast              Sun Rasterfile image&#xA; V..... svq1                 Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1&#xA; V..... targa                Truevision Targa image&#xA; V..... libtheora            libtheora Theora (codec theora)&#xA; VF.... tiff                 TIFF image&#xA; VF.... utvideo              Ut Video&#xA; V..... v210                 Uncompressed 4:2:2 10-bit&#xA; V..... v308                 Uncompressed packed 4:4:4&#xA; V..... v408                 Uncompressed packed QT 4:4:4:4&#xA; V..... v410                 Uncompressed 4:4:4 10-bit&#xA; V..... libvpx               libvpx VP8 (codec vp8)&#xA; V..... libvpx-vp9           libvpx VP9 (codec vp9)&#xA; V..... vp9_qsv              VP9 video (Intel Quick Sync Video acceleration) (codec vp9)&#xA; V..... libwebp_anim         libwebp WebP image (codec webp)&#xA; V..... libwebp              libwebp WebP image (codec webp)&#xA; V..... wmv1                 Windows Media Video 7&#xA; V..... wmv2                 Windows Media Video 8&#xA; V..... wrapped_avframe      AVFrame to AVPacket passthrough&#xA; V..... xbm                  XBM (X BitMap) image&#xA; V..... xface                X-face image&#xA; V..... xwd                  XWD (X Window Dump) image&#xA; V..... y41p                 Uncompressed YUV 4:1:1 12-bit&#xA; V..... yuv4                 Uncompressed packed 4:2:0&#xA; VF.... zlib                 LCL (LossLess Codec Library) ZLIB&#xA; V..... zmbv                 Zip Motion Blocks Video&#xA; A..... aac                  AAC (Advanced Audio Coding)&#xA; A..... aac_mf               AAC via MediaFoundation (codec aac)&#xA; A..... ac3                  ATSC A/52A (AC-3)&#xA; A..... ac3_fixed            ATSC A/52A (AC-3) (codec ac3)&#xA; A..... ac3_mf               AC3 via MediaFoundation (codec ac3)&#xA; A..... adpcm_adx            SEGA CRI ADX ADPCM&#xA; A..... adpcm_argo           ADPCM Argonaut Games&#xA; A..... g722                 G.722 ADPCM (codec adpcm_g722)&#xA; A..... g726                 G.726 ADPCM (codec adpcm_g726)&#xA; A..... g726le               G.726 little endian ADPCM ("right-justified") (codec adpcm_g726le)&#xA; A..... adpcm_ima_apm        ADPCM IMA Ubisoft APM&#xA; A..... adpcm_ima_qt         ADPCM IMA QuickTime&#xA; A..... adpcm_ima_ssi        ADPCM IMA Simon &amp; Schuster Interactive&#xA; A..... adpcm_ima_wav        ADPCM IMA WAV&#xA; A..... adpcm_ms             ADPCM Microsoft&#xA; A..... adpcm_swf            ADPCM Shockwave Flash&#xA; A..... adpcm_yamaha         ADPCM Yamaha&#xA; A..... alac                 ALAC (Apple Lossless Audio Codec)&#xA; A..... libopencore_amrnb    OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band) (codec amr_nb)&#xA; A..... libvo_amrwbenc       Android VisualOn AMR-WB (Adaptive Multi-Rate Wide-Band) (codec amr_wb)&#xA; A..... aptx                 aptX (Audio Processing Technology for Bluetooth)&#xA; A..... aptx_hd              aptX HD (Audio Processing Technology for Bluetooth)&#xA; A..... comfortnoise         RFC 3389 comfort noise generator&#xA; A..X.. dca                  DCA (DTS Coherent Acoustics) (codec dts)&#xA; A..... eac3                 ATSC A/52 E-AC-3&#xA; A..... flac                 FLAC (Free Lossless Audio Codec)&#xA; A..... g723_1               G.723.1&#xA; A..... libgsm               libgsm GSM (codec gsm)&#xA; A..... libgsm_ms            libgsm GSM Microsoft variant (codec gsm_ms)&#xA; A..X.. mlp                  MLP (Meridian Lossless Packing)&#xA; A..... mp2                  MP2 (MPEG audio layer 2)&#xA; A..... mp2fixed             MP2 fixed point (MPEG audio layer 2) (codec mp2)&#xA; A..... libtwolame           libtwolame MP2 (MPEG audio layer 2) (codec mp2)&#xA; A..... libmp3lame           libmp3lame MP3 (MPEG audio layer 3) (codec mp3)&#xA; A..... libshine             libshine MP3 (MPEG audio layer 3) (codec mp3)&#xA; A..... mp3_mf               MP3 via MediaFoundation (codec mp3)&#xA; A..... nellymoser           Nellymoser Asao&#xA; A..X.. opus                 Opus&#xA; A..... libopus              libopus Opus (codec opus)&#xA; A..... pcm_alaw             PCM A-law / G.711 A-law&#xA; A..... pcm_dvd              PCM signed 16|20|24-bit big-endian for DVD media&#xA; A..... pcm_f32be            PCM 32-bit floating point big-endian&#xA; A..... pcm_f32le            PCM 32-bit floating point little-endian&#xA; A..... pcm_f64be            PCM 64-bit floating point big-endian&#xA; A..... pcm_f64le            PCM 64-bit floating point little-endian&#xA; A..... pcm_mulaw            PCM mu-law / G.711 mu-law&#xA; A..... pcm_s16be            PCM signed 16-bit big-endian&#xA; A..... pcm_s16be_planar     PCM signed 16-bit big-endian planar&#xA; A..... pcm_s16le            PCM signed 16-bit little-endian&#xA; A..... pcm_s16le_planar     PCM signed 16-bit little-endian planar&#xA; A..... pcm_s24be            PCM signed 24-bit big-endian&#xA; A..... pcm_s24daud          PCM D-Cinema audio signed 24-bit&#xA; A..... pcm_s24le            PCM signed 24-bit little-endian&#xA; A..... pcm_s24le_planar     PCM signed 24-bit little-endian planar&#xA; A..... pcm_s32be            PCM signed 32-bit big-endian&#xA; A..... pcm_s32le            PCM signed 32-bit little-endian&#xA; A..... pcm_s32le_planar     PCM signed 32-bit little-endian planar&#xA; A..... pcm_s64be            PCM signed 64-bit big-endian&#xA; A..... pcm_s64le            PCM signed 64-bit little-endian&#xA; A..... pcm_s8               PCM signed 8-bit&#xA; A..... pcm_s8_planar        PCM signed 8-bit planar&#xA; A..... pcm_u16be            PCM unsigned 16-bit big-endian&#xA; A..... pcm_u16le            PCM unsigned 16-bit little-endian&#xA; A..... pcm_u24be            PCM unsigned 24-bit big-endian&#xA; A..... pcm_u24le            PCM unsigned 24-bit little-endian&#xA; A..... pcm_u32be            PCM unsigned 32-bit big-endian&#xA; A..... pcm_u32le            PCM unsigned 32-bit little-endian&#xA; A..... pcm_u8               PCM unsigned 8-bit&#xA; A..... pcm_vidc             PCM Archimedes VIDC&#xA; A..... real_144             RealAudio 1.0 (14.4K) (codec ra_144)&#xA; A..... roq_dpcm             id RoQ DPCM&#xA; A..X.. s302m                SMPTE 302M&#xA; A..... sbc                  SBC (low-complexity subband codec)&#xA; A..X.. sonic                Sonic&#xA; A..X.. sonicls              Sonic lossless&#xA; A..... libspeex             libspeex Speex (codec speex)&#xA; A..X.. truehd               TrueHD&#xA; A..... tta                  TTA (True Audio)&#xA; A..X.. vorbis               Vorbis&#xA; A..... libvorbis            libvorbis (codec vorbis)&#xA; A..... wavpack              WavPack&#xA; A..... libwavpack            (codec wavpack)&#xA; A..... wmav1                Windows Media Audio 1&#xA; A..... wmav2                Windows Media Audio 2&#xA; S..... ssa                  ASS (Advanced SubStation Alpha) subtitle (codec ass)&#xA; S..... ass                  ASS (Advanced SubStation Alpha) subtitle&#xA; S..... dvbsub               DVB subtitles (codec dvb_subtitle)&#xA; S..... dvdsub               DVD subtitles (codec dvd_subtitle)&#xA; S..... mov_text             3GPP Timed Text subtitle&#xA; S..... srt                  SubRip subtitle (codec subrip)&#xA; S..... subrip               SubRip subtitle&#xA; S..... text                 Raw text subtitle&#xA; S..... webvtt               WebVTT subtitle&#xA; S..... xsub                 DivX subtitles (XSUB)&#xA;

    &#xA;

    Log output if i try using AAC encoder

    &#xA;

    <pre>object(FFMpeg\Exception\RuntimeException)#35 (7) {&#xA;  ["message":protected]=>&#xA;  string(15) "Encoding failed"&#xA;  ["string":"Exception":private]=>&#xA;  string(0) ""&#xA;  ["code":protected]=>&#xA;  int(0)&#xA;  ["file":protected]=>&#xA;  string(108) "C:\inetpub\wwwroot\dev\ffmpeg-lib\ffmpeg-php\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Media\AbstractVideo.php"&#xA;  ["line":protected]=>&#xA;  int(106)&#xA;  ["trace":"Exception":private]=>&#xA;  array(1) {&#xA;    [0]=>&#xA;    array(5) {&#xA;      ["file"]=>&#xA;      string(45) "C:\inetpub\wwwroot\dev\ffmpeg-lib\process.php"&#xA;      ["line"]=>&#xA;      int(35)&#xA;      ["function"]=>&#xA;      string(4) "save"&#xA;      ["class"]=>&#xA;      string(26) "FFMpeg\Media\AbstractVideo"&#xA;      ["type"]=>&#xA;      string(2) "->"&#xA;    }&#xA;  }&#xA;  ["previous":"Exception":private]=>&#xA;  object(Alchemy\BinaryDriver\Exception\ExecutionFailureException)#43 (9) {&#xA;    ["command":protected]=>&#xA;    string(393) "C:\ffmpeg\bin\ffmpeg.exe -y -ss 00:00:17.00 -i "temp/temp_20201110-100656_1080p-220mb.mp4" -t 00:00:52.00 -threads 12 -vcodec libx264 -acodec aac -b:v 1000k -refs 6 -coder 1 -sc_threshold 40 -flags &#x2B;loop -me_range 16 -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k -pass 1 -passlogfile "W:/TempIIS\ffmpeg-passes5fabd8bdf3612uvd6b/pass-5fabd8bdf378b" "temp/20201111-122741.mp4""&#xA;    ["errorOutput":protected]=>&#xA;    string(830102) "ffmpeg version git-2020-08-31-4a11a6f Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200805&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --enable-libsvtav1 --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 58.100 / 56. 58.100&#xA;  libavcodec     58.101.101 / 58.101.101&#xA;  libavformat    58. 51.101 / 58. 51.101&#xA;  libavdevice    58. 11.101 / 58. 11.101&#xA;  libavfilter     7. 87.100 /  7. 87.100&#xA;  libswscale      5.  8.100 /  5.  8.100&#xA;  libswresample   3.  8.100 /  3.  8.100&#xA;  libpostproc    55.  8.100 / 55.  8.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;temp/temp_20201110-100656_1080p-220mb.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 19529854&#xA;    compatible_brands: mp42isom&#xA;    creation_time   : 2016-04-11T06:32:53.000000Z&#xA;  Duration: 00:02:25.98, start: 0.000000, bitrate: 13772 kb/s&#xA;    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2016-04-11T06:32:53.000000Z&#xA;      handler_name    : Sound Media Handler&#xA;    Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 13639 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2016-04-11T06:32:53.000000Z&#xA;      handler_name    : Video Media Handler&#xA;      encoder         : AVC Coding&#xA;Stream mapping:&#xA;  Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))&#xA;  Stream #0:0 -> #0:1 (aac (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[aac @ 000001fc5a9ce8c0] Sample rate index in program config element does not match the sample rate index configured by the container.&#xA;[h264 @ 000001fc5a3dac80] Invalid NAL unit size (-360624822 > 108076).&#xA;[h264 @ 000001fc5a3dac80] Error splitting the input into NAL units.&#xA;[aac @ 000001fc5a9ce8c0] Inconsistent channel configuration.&#xA;[aac @ 000001fc5a9ce8c0] get_buffer() failed&#xA;Error while decoding stream #0:0: Invalid argument&#xA;[aac @ 000001fc5a9ce8c0] Sample rate index in program config element does not match the sample rate index configured by the container.&#xA;[aac @ 000001fc5a9ce8c0] Inconsistent channel configuration.&#xA;[aac @ 000001fc5a9ce8c0] get_buffer() failed&#xA;Error while decoding stream #0:0: Invalid argument&#xA;[aac @ 000001fc5a9ce8c0] channel element 2.15 is not allocated&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[aac @ 000001fc5a9ce8c0] Sample rate index in program config element does not match the sample rate index configured by the container.&#xA;[aac @ 000001fc5a9ce8c0] Inconsistent channel configuration.&#xA;[aac @ 000001fc5a9ce8c0] get_buffer() failed&#xA;Error while decoding stream #0:0: Invalid argument&#xA;[h264 @ 000001fc5a3be480] Invalid NAL unit size (1926587749 > 39711).&#xA;[h264 @ 000001fc5a3be480] Error splitting the input into NAL units.&#xA;[h264 @ 000001fc5a3e4540] Invalid NAL unit size (-1483385910 > 21666).&#xA;[h264 @ 000001fc5a3e4540] Error splitting the input into NAL units.&#xA;[h264 @ 000001fc5ad06500] Invalid NAL unit size (1060193647 > 41388).&#xA;[h264 @ 000001fc5ad06500] Error splitting the input into NAL units.&#xA;Error while decoding stream #0:1: Invalid data found when processing input&#xA;[h264 @ 000001fc5ad22e80] Invalid NAL unit size (1499431567 > 26513).&#xA;</pre>

    &#xA;

  • The use cases for a element in HTML

    1er janvier 2014, par silvia

    The W3C HTML WG and the WHATWG are currently discussing the introduction of a <main> element into HTML.

    The <main> element has been proposed by Steve Faulkner and is specified in a draft extension spec which is about to be accepted as a FPWD (first public working draft) by the W3C HTML WG. This implies that the W3C HTML WG will be looking for implementations and for feedback by implementers on this spec.

    I am supportive of the introduction of a <main> element into HTML. However, I believe that the current spec and use case list don’t make a good enough case for its introduction. Here are my thoughts.

    Main use case : accessibility

    In my opinion, the main use case for the introduction of <main> is accessibility.

    Like any other users, when blind users want to perceive a Web page/application, they need to have a quick means of grasping the content of a page. Since they cannot visually scan the layout and thus determine where the main content is, they use accessibility technology (AT) to find what is known as “landmarks”.

    “Landmarks” tell the user what semantic content is on a page : a header (such as a banner), a search box, a navigation menu, some asides (also called complementary content), a footer, …. and the most important part : the main content of the page. It is this main content that a blind user most often wants to skip to directly.

    In the days of HTML4, a hidden “skip to content” link at the beginning of the Web page was used as a means to help blind users access the main content.

    In the days of ARIA, the aria @role=main enables authors to avoid a hidden link and instead mark the element where the main content begins to allow direct access to the main content. This attribute is supported by AT – in particular screen readers – by making it part of the landmarks that AT can directly skip to.

    Both the hidden link and the ARIA @role=main approaches are, however, band aids : they are being used by those of us that make “finished” Web pages accessible by adding specific extra markup.

    A world where ARIA is not necessary and where accessibility developers would be out of a job because the normal markup that everyone writes already creates accessible Web sites/applications would be much preferable over the current world of band-aids.

    Therefore, to me, the primary use case for a <main> element is to achieve exactly this better world and not require specialized markup to tell a user (or a tool) where the main content on a page starts.

    An immediate effect would be that pages that have a <main> element will expose a “main” landmark to blind and vision-impaired users that will enable them to directly access that main content on the page without having to wade through other text on the page. Without a <main> element, this functionality can currently only be provided using heuristics to skip other semantic and structural elements and is for this reason not typically implemented in AT.

    Other use cases

    The <main> element is a semantic element not unlike other new semantic elements such as <header>, <footer>, <aside>, <article>, <nav>, or <section>. Thus, it can also serve other uses where the main content on a Web page/Web application needs to be identified.

    Data mining

    For data mining of Web content, the identification of the main content is one of the key challenges. Many scholarly articles have been published on this topic. This stackoverflow article references and suggests a multitude of approaches, but the accepted answer says “there’s no way to do this that’s guaranteed to work”. This is because Web pages are inherently complex and many <div>, <p>, <iframe> and other elements are used to provide markup for styling, notifications, ads, analytics and other use cases that are necessary to make a Web page complete, but don’t contribute to what a user consumes as semantically rich content. A <main> element will allow authors to pro-actively direct data mining tools to the main content.

    Search engines

    One particularly important “data mining” tool are search engines. They, too, have a hard time to identify which sections of a Web page are more important than others and employ many heuristics to do so, see e.g. this ACM article. Yet, they still disappoint with poor results pointing to findings of keywords in little relevant sections of a page rather than ranking Web pages higher where the keywords turn up in the main content area. A <main> element would be able to help search engines give text in main content areas a higher weight and prefer them over other areas of the Web page. It would be able to rank different Web pages depending on where on the page the search words are found. The <main> element will be an additional hint that search engines will digest.

    Visual focus

    On small devices, the display of Web pages designed for Desktop often causes confusion as to where the main content can be found and read, in particular when the text ends up being too small to be readable. It would be nice if browsers on small devices had a functionality (maybe a default setting) where Web pages would start being displayed as zoomed in on the main content. This could alleviate some of the headaches of responsive Web design, where the recommendation is to show high priority content as the first content. Right now this problem is addressed through stylesheets that re-layout the page differently depending on device, but again this is a band-aid solution. Explicit semantic markup of the main content can solve this problem more elegantly.

    Styling

    Finally, naturally, <main> would also be used to style the main content differently from others. You can e.g. replace a semantically meaningless <div id=”main”> with a semantically meaningful <main> where their position is identical. My analysis below shows, that this is not always the case, since oftentimes <div id=”main”> is used to group everything together that is not the header – in particular where there are multiple columns. Thus, the ease of styling a <main> element is only a positive side effect and not actually a real use case. It does make it easier, however, to adapt the style of the main content e.g. with media queries.

    Proposed alternative solutions

    It has been proposed that existing markup serves to satisfy the use cases that <main> has been proposed for. Let’s analyse these on some of the most popular Web sites. First let’s list the propsed algorithms.

    Proposed solution No 1 : Scooby-Doo

    On Sat, Nov 17, 2012 at 11:01 AM, Ian Hickson <ian@hixie.ch> wrote :
    | The main content is whatever content isn’t
    | marked up as not being main content (anything not marked up with <header>,
    | <aside>, <nav>, etc).
    

    This implies that the first element that is not a <header>, <aside>, <nav>, or <footer> will be the element that we want to give to a blind user as the location where they should start reading. The algorithm is implemented in https://gist.github.com/4032962.

    Proposed solution No 2 : First article element

    On Sat, Nov 17, 2012 at 8:01 AM, Ian Hickson  wrote :
    | On Thu, 15 Nov 2012, Ian Yang wrote :
    | >
    | > That’s a good idea. We really need an element to wrap all the <p>s,
    | > <ul>s, <ol>s, <figure>s, <table>s ... etc of a blog post.
    |
    | That’s called <article>.
    

    This approach identifies the first <article> element on the page as containing the main content. Here’s the algorithm for this approach.

    Proposed solution No 3 : An example heuristic approach

    The readability plugin has been developed to make Web pages readable by essentially removing all the non-main content from a page. An early source of readability is available. This demonstrates what a heuristic approach can perform.

    Analysing alternative solutions

    Comparison

    I’ve picked 4 typical Websites (top on Alexa) to analyse how these three different approaches fare. Ideally, I’d like to simply apply the above three scripts and compare pictures. However, since the semantic HTML5 elements <header>, <aside>, <nav>, and <footer> are not actually used by any of these Web sites, I don’t actually have this choice.

    So, instead, I decided to make some assumptions of where these semantic elements would be used and what the outcome of applying the first two algorithms would be. I can then compare it to the third, which is a product so we can take screenshots.

    Google.com

    http://google.com – search for “Scooby Doo”.

    The search results page would likely be built with :

    • a <nav> menu for the Google bar
    • a <header> for the search bar
    • another <header> for the login section
    • another <nav> menu for the search types
    • a <div> to contain the rest of the page
    • a <div> for the app bar with the search number
    • a few <aside>s for the left and right column
    • a set of <article>s for the search results
    “Scooby Doo” would find the first element after the headers as the “main content”. This is the element before the app bar in this case. Interestingly, there is a <div @id=main> already in the current Google results page, which “Scooby Doo” would likely also pick. However, there are a nav bar and two asides in this div, which clearly should not be part of the “main content”. Google actually placed a @role=main on a different element, namely the one that encapsulates all the search results.

    “First Article” would find the first search result as the “main content”. While not quite the same as what Google intended – namely all search results – it is close enough to be useful.

    The “readability” result is interesting, since it is not able to identify the main text on the page. It is actually aware of this problem and brings a warning before displaying this page :

    Readability of google.com

    Facebook.com

    https://facebook.com

    A user page would likely be built with :

    • a <header> bar for the search and login bar
    • a <div> to contain the rest of the page
    • an <aside> for the left column
    • a <div> to contain the center and right column
    • an <aside> for the right column
    • a <header> to contain the center column “megaphone”
    • a <div> for the status posting
    • a set of <article>s for the home stream
    “Scooby Doo” would find the first element after the headers as the “main content”. This is the element that contains all three columns. It’s actually a <div @id=content> already in the current Facebook user page, which “Scooby Doo” would likely also pick. However, Facebook selected a different element to place the @role=main : the center column.

    “First Article” would find the first news item in the home stream. This is clearly not what Facebook intended, since they placed the @role=main on the center column, above the first blog post’s title. “First Article” would miss that title and the status posting.

    The “readability” result again disappoints but warns that it failed :

    YouTube.com

    http://youtube.com

    A video page would likely be built with :

    • a <header> bar for the search and login bar
    • a <nav> for the menu
    • a <div> to contain the rest of the page
    • a <header> for the video title and channel links
    • a <div> to contain the video with controls
    • a <div> to contain the center and right column
    • an <aside> for the right column with an <article> per related video
    • an <aside> for the information below the video
    • a <article> per comment below the video
    “Scooby Doo” would find the first element after the headers as the “main content”. This is the element that contains the rest of the page. It’s actually a <div @id=content> already in the current YouTube video page, which “Scooby Doo” would likely also pick. However, YouTube’s related videos and comments are unlikely to be what the user would regard as “main content” – it’s the video they are after, which generously has a <div id=watch-player>.

    “First Article” would find the first related video or comment in the home stream. This is clearly not what YouTube intends.

    The “readability” result is not quite as unusable, but still very bare :

    Wikipedia.com

    http://wikipedia.com (“Overscan” page)

    A Wikipedia page would likely be built with :

    • a <header> bar for the search, login and menu items
    • a <div> to contain the rest of the page
    • an &ls ; article> with title and lots of text
    • <article> an <aside> with the table of contents
    • several <aside>s for the left column
    Good news : “Scooby Doo” would find the first element after the headers as the “main content”. This is the element that contains the rest of the page. It’s actually a <div id=”content” role=”main”> element on Wikipedia, which “Scooby Doo” would likely also pick.

    “First Article” would find the title and text of the main element on the page, but it would also include an <aside>.

    The “readability” result is also in agreement.

    Results

    In the following table we have summarised the results for the experiments :

    Site Scooby-Doo First article Readability
    Google.com FAIL SUCCESS FAIL
    Facebook.com FAIL FAIL FAIL
    YouTube.com FAIL FAIL FAIL
    Wikipedia.com SUCCESS SUCCESS SUCCESS

    Clearly, Wikipedia is the prime example of a site where even the simple approaches find it easy to determine the main content on the page. WordPress blogs are similarly successful. Almost any other site, including news sites, social networks and search engine sites are petty hopeless with the proposed approaches, because there are too many elements that are used for layout or other purposes (notifications, hidden areas) such that the pre-determined list of semantic elements that are available simply don’t suffice to mark up a Web page/application completely.

    Conclusion

    It seems that in general it is impossible to determine which element(s) on a Web page should be the “main” piece of content that accessibility tools jump to when requested, that a search engine should put their focus on, or that should be highlighted to a general user to read. It would be very useful if the author of the Web page would provide a hint through a <main> element where that main content is to be found.

    I think that the <main> element becomes particularly useful when combined with a default keyboard shortcut in browsers as proposed by Steve : we may actually find that non-accessibility users will also start making use of this shortcut, e.g. to get to videos on YouTube pages directly without having to tab over search boxes and other interactive elements, etc. Worthwhile markup indeed.

  • The use cases for a element in HTML

    1er janvier 2014, par silvia

    The W3C HTML WG and the WHATWG are currently discussing the introduction of a <main> element into HTML.

    The <main> element has been proposed by Steve Faulkner and is specified in a draft extension spec which is about to be accepted as a FPWD (first public working draft) by the W3C HTML WG. This implies that the W3C HTML WG will be looking for implementations and for feedback by implementers on this spec.

    I am supportive of the introduction of a <main> element into HTML. However, I believe that the current spec and use case list don’t make a good enough case for its introduction. Here are my thoughts.

    Main use case : accessibility

    In my opinion, the main use case for the introduction of <main> is accessibility.

    Like any other users, when blind users want to perceive a Web page/application, they need to have a quick means of grasping the content of a page. Since they cannot visually scan the layout and thus determine where the main content is, they use accessibility technology (AT) to find what is known as “landmarks”.

    “Landmarks” tell the user what semantic content is on a page : a header (such as a banner), a search box, a navigation menu, some asides (also called complementary content), a footer, …. and the most important part : the main content of the page. It is this main content that a blind user most often wants to skip to directly.

    In the days of HTML4, a hidden “skip to content” link at the beginning of the Web page was used as a means to help blind users access the main content.

    In the days of ARIA, the aria @role=main enables authors to avoid a hidden link and instead mark the element where the main content begins to allow direct access to the main content. This attribute is supported by AT – in particular screen readers – by making it part of the landmarks that AT can directly skip to.

    Both the hidden link and the ARIA @role=main approaches are, however, band aids : they are being used by those of us that make “finished” Web pages accessible by adding specific extra markup.

    A world where ARIA is not necessary and where accessibility developers would be out of a job because the normal markup that everyone writes already creates accessible Web sites/applications would be much preferable over the current world of band-aids.

    Therefore, to me, the primary use case for a <main> element is to achieve exactly this better world and not require specialized markup to tell a user (or a tool) where the main content on a page starts.

    An immediate effect would be that pages that have a <main> element will expose a “main” landmark to blind and vision-impaired users that will enable them to directly access that main content on the page without having to wade through other text on the page. Without a <main> element, this functionality can currently only be provided using heuristics to skip other semantic and structural elements and is for this reason not typically implemented in AT.

    Other use cases

    The <main> element is a semantic element not unlike other new semantic elements such as <header>, <footer>, <aside>, <article>, <nav>, or <section>. Thus, it can also serve other uses where the main content on a Web page/Web application needs to be identified.

    Data mining

    For data mining of Web content, the identification of the main content is one of the key challenges. Many scholarly articles have been published on this topic. This stackoverflow article references and suggests a multitude of approaches, but the accepted answer says “there’s no way to do this that’s guaranteed to work”. This is because Web pages are inherently complex and many <div>, <p>, <iframe> and other elements are used to provide markup for styling, notifications, ads, analytics and other use cases that are necessary to make a Web page complete, but don’t contribute to what a user consumes as semantically rich content. A <main> element will allow authors to pro-actively direct data mining tools to the main content.

    Search engines

    One particularly important “data mining” tool are search engines. They, too, have a hard time to identify which sections of a Web page are more important than others and employ many heuristics to do so, see e.g. this ACM article. Yet, they still disappoint with poor results pointing to findings of keywords in little relevant sections of a page rather than ranking Web pages higher where the keywords turn up in the main content area. A <main> element would be able to help search engines give text in main content areas a higher weight and prefer them over other areas of the Web page. It would be able to rank different Web pages depending on where on the page the search words are found. The <main> element will be an additional hint that search engines will digest.

    Visual focus

    On small devices, the display of Web pages designed for Desktop often causes confusion as to where the main content can be found and read, in particular when the text ends up being too small to be readable. It would be nice if browsers on small devices had a functionality (maybe a default setting) where Web pages would start being displayed as zoomed in on the main content. This could alleviate some of the headaches of responsive Web design, where the recommendation is to show high priority content as the first content. Right now this problem is addressed through stylesheets that re-layout the page differently depending on device, but again this is a band-aid solution. Explicit semantic markup of the main content can solve this problem more elegantly.

    Styling

    Finally, naturally, <main> would also be used to style the main content differently from others. You can e.g. replace a semantically meaningless <div id=”main”> with a semantically meaningful <main> where their position is identical. My analysis below shows, that this is not always the case, since oftentimes <div id=”main”> is used to group everything together that is not the header – in particular where there are multiple columns. Thus, the ease of styling a <main> element is only a positive side effect and not actually a real use case. It does make it easier, however, to adapt the style of the main content e.g. with media queries.

    Proposed alternative solutions

    It has been proposed that existing markup serves to satisfy the use cases that <main> has been proposed for. Let’s analyse these on some of the most popular Web sites. First let’s list the propsed algorithms.

    Proposed solution No 1 : Scooby-Doo

    On Sat, Nov 17, 2012 at 11:01 AM, Ian Hickson <ian@hixie.ch> wrote :
    | The main content is whatever content isn’t
    | marked up as not being main content (anything not marked up with <header>,
    | <aside>, <nav>, etc).
    

    This implies that the first element that is not a <header>, <aside>, <nav>, or <footer> will be the element that we want to give to a blind user as the location where they should start reading. The algorithm is implemented in https://gist.github.com/4032962.

    Proposed solution No 2 : First article element

    On Sat, Nov 17, 2012 at 8:01 AM, Ian Hickson  wrote :
    | On Thu, 15 Nov 2012, Ian Yang wrote :
    | >
    | > That’s a good idea. We really need an element to wrap all the <p>s,
    | > <ul>s, <ol>s, <figure>s, <table>s ... etc of a blog post.
    |
    | That’s called <article>.
    

    This approach identifies the first <article> element on the page as containing the main content. Here’s the algorithm for this approach.

    Proposed solution No 3 : An example heuristic approach

    The readability plugin has been developed to make Web pages readable by essentially removing all the non-main content from a page. An early source of readability is available. This demonstrates what a heuristic approach can perform.

    Analysing alternative solutions

    Comparison

    I’ve picked 4 typical Websites (top on Alexa) to analyse how these three different approaches fare. Ideally, I’d like to simply apply the above three scripts and compare pictures. However, since the semantic HTML5 elements <header>, <aside>, <nav>, and <footer> are not actually used by any of these Web sites, I don’t actually have this choice.

    So, instead, I decided to make some assumptions of where these semantic elements would be used and what the outcome of applying the first two algorithms would be. I can then compare it to the third, which is a product so we can take screenshots.

    Google.com

    http://google.com – search for “Scooby Doo”.

    The search results page would likely be built with :

    • a <nav> menu for the Google bar
    • a <header> for the search bar
    • another <header> for the login section
    • another <nav> menu for the search types
    • a <div> to contain the rest of the page
    • a <div> for the app bar with the search number
    • a few <aside>s for the left and right column
    • a set of <article>s for the search results
    “Scooby Doo” would find the first element after the headers as the “main content”. This is the element before the app bar in this case. Interestingly, there is a <div @id=main> already in the current Google results page, which “Scooby Doo” would likely also pick. However, there are a nav bar and two asides in this div, which clearly should not be part of the “main content”. Google actually placed a @role=main on a different element, namely the one that encapsulates all the search results.

    “First Article” would find the first search result as the “main content”. While not quite the same as what Google intended – namely all search results – it is close enough to be useful.

    The “readability” result is interesting, since it is not able to identify the main text on the page. It is actually aware of this problem and brings a warning before displaying this page :

    Readability of google.com

    Facebook.com

    https://facebook.com

    A user page would likely be built with :

    • a <header> bar for the search and login bar
    • a <div> to contain the rest of the page
    • an <aside> for the left column
    • a <div> to contain the center and right column
    • an <aside> for the right column
    • a <header> to contain the center column “megaphone”
    • a <div> for the status posting
    • a set of <article>s for the home stream
    “Scooby Doo” would find the first element after the headers as the “main content”. This is the element that contains all three columns. It’s actually a <div @id=content> already in the current Facebook user page, which “Scooby Doo” would likely also pick. However, Facebook selected a different element to place the @role=main : the center column.

    “First Article” would find the first news item in the home stream. This is clearly not what Facebook intended, since they placed the @role=main on the center column, above the first blog post’s title. “First Article” would miss that title and the status posting.

    The “readability” result again disappoints but warns that it failed :

    YouTube.com

    http://youtube.com

    A video page would likely be built with :

    • a <header> bar for the search and login bar
    • a <nav> for the menu
    • a <div> to contain the rest of the page
    • a <header> for the video title and channel links
    • a <div> to contain the video with controls
    • a <div> to contain the center and right column
    • an <aside> for the right column with an <article> per related video
    • an <aside> for the information below the video
    • a <article> per comment below the video
    “Scooby Doo” would find the first element after the headers as the “main content”. This is the element that contains the rest of the page. It’s actually a <div @id=content> already in the current YouTube video page, which “Scooby Doo” would likely also pick. However, YouTube’s related videos and comments are unlikely to be what the user would regard as “main content” – it’s the video they are after, which generously has a <div id=watch-player>.

    “First Article” would find the first related video or comment in the home stream. This is clearly not what YouTube intends.

    The “readability” result is not quite as unusable, but still very bare :

    Wikipedia.com

    http://wikipedia.com (“Overscan” page)

    A Wikipedia page would likely be built with :

    • a <header> bar for the search, login and menu items
    • a <div> to contain the rest of the page
    • an &ls ; article> with title and lots of text
    • <article> an <aside> with the table of contents
    • several <aside>s for the left column
    Good news : “Scooby Doo” would find the first element after the headers as the “main content”. This is the element that contains the rest of the page. It’s actually a <div id=”content” role=”main”> element on Wikipedia, which “Scooby Doo” would likely also pick.

    “First Article” would find the title and text of the main element on the page, but it would also include an <aside>.

    The “readability” result is also in agreement.

    Results

    In the following table we have summarised the results for the experiments :

    Site Scooby-Doo First article Readability
    Google.com FAIL SUCCESS FAIL
    Facebook.com FAIL FAIL FAIL
    YouTube.com FAIL FAIL FAIL
    Wikipedia.com SUCCESS SUCCESS SUCCESS

    Clearly, Wikipedia is the prime example of a site where even the simple approaches find it easy to determine the main content on the page. WordPress blogs are similarly successful. Almost any other site, including news sites, social networks and search engine sites are petty hopeless with the proposed approaches, because there are too many elements that are used for layout or other purposes (notifications, hidden areas) such that the pre-determined list of semantic elements that are available simply don’t suffice to mark up a Web page/application completely.

    Conclusion

    It seems that in general it is impossible to determine which element(s) on a Web page should be the “main” piece of content that accessibility tools jump to when requested, that a search engine should put their focus on, or that should be highlighted to a general user to read. It would be very useful if the author of the Web page would provide a hint through a <main> element where that main content is to be found.

    I think that the <main> element becomes particularly useful when combined with a default keyboard shortcut in browsers as proposed by Steve : we may actually find that non-accessibility users will also start making use of this shortcut, e.g. to get to videos on YouTube pages directly without having to tab over search boxes and other interactive elements, etc. Worthwhile markup indeed.