tl; dr
- GIFã¯ã¯ãŒã«ã§ãããå質ãšããã©ãŒãã³ã¹ã®ç¹ã§ã²ã©ãã§ãã
- GIFã
video
眮ãæããããšvideo
è¯ãèãvideo
æ¬ ç¹ããããŸãïŒ ããªããŒããããŠããã ãç¯å²èŠæ±ã䜿çšããŸãã - ä»æ¥ãSafari Technology Previewã§
img src =".mp4"
ã䜿çšã§ããŸãã - äºåçãªçµæã§ã¯ãã¿ã°å ã®mp4ã¯ãåçã®GIF ããã20åéã衚瀺ããã7åéããã³ãŒããããŸã-ãã¡ã€ã«ãµã€ãºã1/14ã§ããããšã«å ããŠïŒ
- CSSããã¯ã°ã©ãŠã³ããããªãšã¬ã¹ãã³ã·ããããªã¯ãã¯ãŒã«ãªæ©èœã«ãªãå¯èœæ§ããããŸãã
- æåŸã«ãcinemagraphã«ã¯GIFã®æ¬ é¥ã¯ãããŸããã
- çŸåšãä»ã®ãã©ãŠã¶ããã©ããŒããã®ãåŸ ã£ãŠããŸãããã®æçš¿ã¯Chromeã§46MBãSafari TPã§ããã2MBã§ãã
Eric PortisãJack NobleãJohn DavisãDoron Shermanãããã³Yoav Weissã«æè¬ããŸãã
ãã®ç¿»èš³ã¯ã倧èŠæš¡é¡§å®¢åãã®å°ééçºäŒç€Ÿã§ããEDISON Softwareã«ãã£ãŠãµããŒããããŸãããããšãã°ã ã²ãŒã ãLeague of Legendsãã®GameStarsã®ã¯ã©ã€ã¢ã³ãéšåã® éçºãUnityãšã³ãžã³ã®3次å ãããã«ãªããžã§ã¯ãã衚瀺ããã³ã³ããŒãã³ãã®éçºãããã³
ã¯ããã«
GIFã¢ãã¡ãŒã·ã§ã³ã奜ãã§å«ã
Safari TPã¯ãããããžã®ã¢ãããŒããæ ¹æ¬çã«å€æŽããŸããã ä»ãç§ã¯ã¢ãã¡ãŒã·ã§ã³ãGIFãã倧奜ãã§ãã
ã¢ãã¡ãŒã·ã§ã³GIFã¯æ©èœã§ãã GIF89aä»æ§ããã®åŒçšïŒ
ã°ã©ãã£ãã¯ã¹å ±æ圢åŒã¯ãå¶éä»ãã§ç·šæã§ããŸãããã¢ãã¡ãŒã·ã§ã³ã®ãã©ãããã©ãŒã ãšããŠã¯æå³ãããŠããŸããã
ãããããããã¯ã·ããã°ã©ã ã ããŒã ãããã³åµé çãªè¡šçŸã®ããã®ã¯ãŒã«ãªããŒã«ã«ãªããŸããã ãã ãããã®ã¯ãŒã«ãã¯ãã¹ãŠé«äŸ¡ã§ãã ã¢ãã¡ãŒã·ã§ã³GIFã¯Webããã©ãŒãã³ã¹ã«ãšã£ãŠã²ã©ããã®ã§ãã ãããã¯ãµã€ãºã倧ãããã»ã«ã©ãŒããŒã¿ã«åœ±é¿ãäžããããå€ãã®ã¡ã¢ãªãšããã»ããµã®ããã©ãŒãã³ã¹ãå¿ èŠãšãã åæç»ãåŒãèµ·ãããããããªãŒã殺ããŸãã éåžžã GIFã¯H.264ãããªããã12å倧ããããã©ãŠã¶ãŒã«ããŒãããŠè¡šç€ºãããš2åã®ãšãã«ã®ãŒãæ¶è²»ããŸã ã ãããŠãããããã¹ãŠã®ãªãœãŒã¹ããèŠãç®ããããªããã®ã«è²»ãããŠããŸã-GIFã¯256è²ã«å¶éãããŠãããããGIFãã¡ã€ã«ã¯æããããã®ã«ãªããŸãïŒããã€ãã®ã¯ãŒã«ãªåé¿çããããŸãïŒã
ç§ã®åšã¯ããããæããŠããŸããã圌女ã®ããããªãŒãåžžã«æ»ãã§ããçç±ãç解ããŠããŸããã
GIFã«ã¯å€ãã®å©ç¹ããããŸãããã©ãŠã¶ããªããŒããŒã䜿çšããŠããã«èŠæ±ãããèªåçã«åçãããŠã«ãŒããããŸãã 圌ãã¯çãã§ãã åžå Ž 調æ»ã§ã¯ããŠãŒã¶ãŒã¯ãŠãŒã¶ãŒãšã®å¯Ÿè©±ã¬ãã«ãé«ããéåžžã¯é·ããããªãéæ¢ç»åãããçããããªïŒ1åæªæºïŒãšã·ããã°ã©ãïŒãããã«ç¹°ãè¿ãããåããçºçããåçïŒã®äž¡æ¹ã奜ãããšã瀺ãããŸããã ã¢ãã¡ãŒã·ã§ã³GIFã¯ããŠãŒã¶ãŒãçŽæ¥äœ¿çšããã®ã«æé©ã§ãã
ããã§ã¯ãGIFãæãã/æãGIFããã©ã®ããã«ããŠGifãæããã®ã§ããããïŒ
ææ°ã®Safari Tech Previewã§ã¯ã Jerry Nobleã®åªåã®ãããã§ãã¿ã°ã§MP4ãã¡ã€ã«ã䜿çšã§ããŸãã ææ¡ãããŠããäŸã¯ãé·åœ¢åŒã®ãããªã§ã¯ãªããGIFã®ãããªé³å£°ã®ãªããã€ã¯ããã©ãŒãããã®åšæçãªãããªã§ãã èªåã§èŠãŠãã ããïŒ
img src="rocky.mp4"
ãã£ãããïŒ ããžãã¹ã䜿ãããããç¹ã«ã€ã³ã¿ãŒãããã§ã®äœæ¥ãªã©ãå€ãã®åéã§åœ¹ç«ã¡ãŸãã
...ãããããã§ã«ãããªã¿ã°ããããŸã
æ¢ã« è¿°ã¹ãããã«ã
video
ã¿ã°ã䜿çšãããšãã¢ãã¡ãŒã·ã§ã³GIFã䜿çšãããããããã©ãŒãã³ã¹ãå€§å¹ ã«åäžããŸãã ãã®ããã2014幎ãTwitterã¯GIFãµããŒããè¿œå ããã«ã ã¢ãã¡ãŒã·ã§ã³GIFãµããŒããèããè¿œå ããŸããã Twitterã¯ä»£ããã«GIFããã®å Žã§MP4ã«ãã©ã³ã¹ã³ãŒããã
video
ã¿ã°å ã«è¡šç€ºããŸããã ãã¹ãŠã®ãã©ãŠã¶ãH.264ããµããŒãããããã«ãªã£ããããããã¯éåžžã«ç°¡åãªç§»è¡ã§ããã
ã¢ãã¡ãŒã·ã§ã³GIFã®MP 4ãžã®åã³ãŒãã£ã³ã°ã¯éåžžã«ç°¡åã§ãã
ffmpeg -i source.gif output.mp4
ãå®è¡ããã ãã§ã
ãã ãã誰ããCMSãåæ§ç¯ããŠ
img
ã
video
å€æã§ããããã§ã¯ãããŸããã å¯èœã§ãã£ãŠããGIFã®ãããªïŒGifïŒãã€ã¯ããã©ãŒããããé ä¿¡ãããã®æ¹æ³ã«ã¯3ã€ã®åé¡ããããŸãã
1.ãvideoãã¿ã°ã䜿çšãããšããã©ãŠã¶ãŒã®ããã©ãŒãã³ã¹ãäœäžãã
Doug SillarsãHTTP Archiveã®æçš¿ã§æè¿ææããããã« ã
video
ã¿ã°ã䜿çšãããšãèŠèŠçãªãã¬ãŒã³ããŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãå€§å¹ ã«äœäžããŸãã
img
ã¿ã°ãšã¯ç°ãªãã ãã©ãŠã¶ã¯
video
ã³ã³ãã³ããããŠã³ããŒãããŸãã ã éåžžãããªããŒããŒã¯ããŒãžã¬ã€ã¢ãŠãã«äžå¯æ¬ ã§ãããããJavaScriptãCSSãããã³ç»åãªãœãŒã¹ã®ã¿ãããªããŒãããŸãã
video
ã³ã³ãã³ãã®é·ãã¯ããã€ã¯ããã©ãŒã ãããã³ã°ãã©ãŒã ãŸã§ä»»æã§ãããããã¡ã€ã³ã¹ããªãŒã ãã³ã³ãã³ããåæããæºåãã§ãããŸã§ã
video
ã¿ã°ã¯ã¹ããããããŸãã ããã«ããã
video
ã³ã³ãã³ãã®èªã¿èŸŒã¿ãæ°çŸããªç§é 延ããŸãã
ããšãã°ã VelocityããŒãžã®äžéšã«ãããããªã¯ãããŒãžã®èªã¿èŸŒã¿ã«5ç§ããããããŸããã ããã¯ã ãªã¯ãšã¹ãããã27çªç®ã«å€ããªãœãŒã¹ã§ãããWebãã©ã³ããããŠã³ããŒãããåŸãã¬ã³ããªã³ã°ãéå§ããããŸã§å®å šã«ã¯ããŒããããŸããã
ããã«æªãããšã«ãå€ãã®ãã©ãŠã¶ã¯
video
ã¿ã°ã«é·ã圢åŒã®ã³ã³ãã³ããå«ãŸããŠãããšæ³å®ããŠããŸãã ãã¹ãŠã®ãããªãèŠèŽããªããŠãã€ã³ã¿ãŒããããã©ãã£ãã¯ãæ¶è²»ãããããªãã¡ã€ã«å šäœãäžåºŠã«ããŠã³ããŒããã代ããã«ããã©ãŠã¶ã¯æåã«1ãã€ãã®ãªã¯ãšã¹ããå®è¡ããŠããµãŒããŒãHTTP-Rangeãªã¯ãšã¹ãããµããŒãããŠãããã©ããã確èªããŸã ã ãã®åŸã圌ã¯ãããŸããŸãªãããã¯ãµã€ãºã®ããã€ãã®ç¯å²èŠæ±ã«åŸã£ãŠããããªãé©åã«ïŒãã ããããŸãã«ãïŒãããã¡ãªã³ã°ãããªãããã«ããŸãã çµæãšããŠããã©ãŠã¶ãã³ã³ãã³ãã®ãã³ãŒããéå§ããåã«TCPãä»ããŠè€æ°åéä¿¡ããããŠãŒã¶ãŒãäœããèŠããŸã§ã«å€§å¹ ãªé 延ãçºçããŸãã é«ã¬ã€ãã³ã·ã®ã»ã«ã©ãŒããŒã¿ã䜿çšããå Žåããããã®ã©ãŠã³ãããã³äŒéã¯æ°çŸãŸãã¯æ°åããªç§ã®ãããªãããŠã³ããŒãã§ããŸãã
ãããŠããã€ãã£ãã®
video
èŠçŽ ãããæªãããšã¯äœã§ããïŒ å žåçãªJavaScriptãããªãã¬ãŒã€ãŒã å€ãã®å ŽåãWebãµã€ãã«ãããªãåã蟌ãæãç°¡åãªæ¹æ³ã¯ãYouTubeãVimeoãªã©ã®ãµãŒãã¹ã䜿çšãããããªã®ã³ãŒãã£ã³ã°ããã¹ãã£ã³ã°ãUXã®è€éããåé¿ããããšã§ãã ããã¯éåžžçŽ æŽãããã¢ã€ãã¢ã§ããããã€ã¯ããã©ãŒããããããªããããªãªã©ã®éãã³ã³ãã³ãã®å Žåãjavascriptãã¬ãŒã€ãŒãšãããã®ãã¹ãã£ã³ã°ãµãŒãã¹ãå°å ¥ãããªãœãŒã¹ïŒcss / js / jpg / woffïŒã«ããé 延ãè¿œå ããã ãã§ãã
video
ãããŒã¯ã¢ããããããšã«å ããŠããã©ãŠã¶ã«javascriptãã¬ãŒã€ãŒã®ããŠã³ããŒããè©äŸ¡ãå®è¡ã匷å¶ãããã®åŸã§ã®ã¿ãããªã®ããŠã³ããŒããéå§ã§ããŸãã
å€ãã®äººãç¥ã£ãŠããããã«ããã«ã¡ããçšã«èšèšãããè¢ãç®åºãåžœãããŒããçµã¿èŸŒãŸããŠãããããç§ã¯Lokiãžã£ã±ããã倧奜ãã§ãã ããããVimeoã§ãã¹ããããŠããçŽ æŽããããããªã䜿çšããŠããLoki USAã®ããŒã ããŒãžãèŠãŠãã ããã
泚ææ·±ãèŠããšãDOMã®ããŠã³ããŒããå®äºããçŽåŸã«ããã¬ãŒã€ãŒã®JavaScriptãå®éã«ãªã¯ãšã¹ããããŠããããšãããããŸãã ãã ããå®å šã«ã¯ããŒããããããããªã¹ããªãŒã ãããªãåŸã§éå§ããæºåãã§ããŠããŸãã
WPTçµæ
2.ãããªãå³ã¯ãªãã¯ããŠä¿åããããšã¯ã§ããŸãã
æé·ã®ãããªã³ã³ãã³ã-ãããªããã°ããã¬ããæ ç»-ã¯ãJavaScriptããŒã¹ã®ãã¬ãŒã€ãŒãéããŠæäŸãããŸãã éåžžããããã®ãã¬ãŒã€ãŒã¯ãŠãŒã¶ãŒã«äŸ¿å©ãªãä»ããå ±æããªã³ã¯ãŸãã¯ããã¯ããŒã¯ããŒã«ãæäŸãããããYouTubeïŒãŸãã¯ã©ãã§ãïŒã«æ»ã£ãŠãããªãåã³èŠã€ããããšãã§ããŸãã ããã©ããããããŒã ãã·ããã°ã©ããªã©ã®ãã€ã¯ããã©ãŒãããã³ã³ãã³ãã¯éåžžããã¬ãŒã€ãŒãçµç±ããªãããããŠãŒã¶ãŒã¯GIFãã¢ããããŒãããŠå人ã«éä¿¡ã§ããããšãæåŸ ããŠããŸãã ãã®èžãç«ã®å¥¥ããã¯é¢çœãã£ãã§ã-ç§ã¯ããããã¹ãŠã®ç§ã®å人ãšå ±æããªããã°ãªããŸããïŒ
video
ã¿ã°ã䜿çšããŠãã€ã¯ããã©ãŒã ãããªã衚瀺ããå ŽåããŠãŒã¶ãŒã¯å³ã¯ãªãã¯ãã¯ãªãã¯ããã©ãã°ããŠä¿åã§ããŸããã ãããŠãç«ãã³ãµãŒããã®åœŒãã®åã³ã¯ãUXã®å€±æããé©ãã«ãªããŸãã
3.èªååçã®éå
æåŸã«ã
img
ã¿ã°ãšGIFã¿ã°ã®ä»£ããã«
video
ã¿ã°ãšMP4ã¿ã°ã䜿çšãããšããã©ãŠã¶ãšã
video autoplay
å±æ§ãæªçšããŠãŠãŒã¶ãŒã®æ³šæãåŒãæªè³ªãªåºå販売è ãšã®éã®çŸåšã®ç«ãšããŠã¹ã®ã²ãŒã ã®ç¶æ³ã«å°éã§ããŸãã åŸæ¥ãã¢ãã€ã«ãã©ãŠã¶ã¯èªååçå±æ§ãç¡èŠããŠããããåç»ã®åçãæåŠããŠãããããå šç»é¢ã¢ãŒãã«åãæ¿ããå¿ èŠããããŸããã éå»æ°å¹Žã«ããã£ãŠã AppleãšGoogleã¯åã蟌ã¿åç»ã®å¶éãèªååçã§ç·©åããŸãããããã«ããã
video
ã¿ã°ã§Gifã®ãããªç»åã䜿çšã§ããŸãã ãã ããåºåãããã¯ãŒã¯ã¯ãããæªçšããè¿œå ã®å¶éãåŒãèµ·ãããŸãã
video
ã¿ã°ãèªåçã«åçããå Žåã¯ãã³ã³ãã³ãã®ãµãŠã³ãããªãïŒ
muted
ïŒã«ãããããªãŒãã£ãªãã©ãã¯ãåé€ããå¿ èŠããããŸãã
...ãããããã§ã«ã¢ãã¡ãŒã·ã§ã³åãããWebPããããŸãã ãããŠãã¢ãã¡ãŒã·ã§ã³PNGã
ã¢ãã¡ãŒã·ã§ã³ããµããŒããã圢åŒã¯GIFã ãã§ã¯ãããŸããã WebPãšPNGãã¢ãã¡ãŒã·ã§ã³ããµããŒãããŠããŸãã ãã ããGIFãšåæ§ã«ãã¢ãã¡ãŒã·ã§ã³çšã§ã¯ãªããH.264ãH.265ãVP9ãAV1ãªã©ã®å°çšãããªã³ãŒããã¯ãããå€§å¹ ã«éããªããŸããã
ã¢ãã¡ãŒã·ã§ã³PNGã¯çŸåšããã¹ãŠã®ãã©ãŠã¶ã§åºããµããŒããããŠãããGIFãªã©ã®ã«ã©ãŒãã¬ããã®å¶éã«ãé¢ä¿ããŠããŸããããããªå§çž®ã«ã¯äŸç¶ãšããŠéå¹ççãªãã¡ã€ã«åœ¢åŒã§ãã
ã¢ãã¡ãŒã·ã§ã³WebPã¯åªããŠããŸãããåŸæ¥ã®ãããªåœ¢åŒãšæ¯èŒãããšãäŸç¶ãšããŠåé¡ããããŸãã åãå ¥ããããŠããæšæºããªãããšã«å ããŠãã¢ãã¡ãŒã·ã§ã³WebPã«ã¯ãµããµã³ããªã³ã°ãšåºç¯å²ã®ãµããŒãããããŸããã ããã«ããµããŒããšã³ã·ã¹ãã ã¯æçåãããŠããŸãã AndroidãChromeãOperaã®ãã¹ãŠã®ããŒãžã§ã³ã§ãããã¢ãã¡ãŒã·ã§ã³WebPããµããŒãããŠããŸãã-ãããã®ãã©ãŠã¶ã
Accept: image / webp
ãµããŒãã«ã€ããŠè©±ããŠããå Žåã§ãã Chrome 42ãOpera 15以éããŸãã¯Android 5以éãå¿ èŠã§ãã
ãããã£ãŠãã¢ãã¡ãŒã·ã§ã³åãããWebPå§çž®ã¯ãã¢ãã¡ãŒã·ã§ã³åãããGIFãPNGãããã¯ããã«åªããŠããŸãããç§ãã¡ã¯ããè¯ãã§ããŸãã ïŒä»¥äžã®ãã¡ã€ã«ãµã€ãºã®æ¯èŒãåç §ïŒ
ãããŠéãé£ã¹ãŠ......
img
ã¿ã°ã«å«ããåŸæ¥ã®ãããªåœ¢åŒïŒMP4ãªã©ïŒã®ãµããŒããè¿œå ããããšã«ãããSafari Technology Previewã¯ããã©ãŒãã³ã¹ãšUXã®åé¡ãä¿®æ£ããŸããã ãã€ã¯ããã©ãŒãããã䜿çšãã
video
å°ãããŠçç£æ§ãé«ãïŒããšãã°ã
video
ã¿ã°ã䜿çšããŠMP4ã転éïŒãç°¡åã«ããŠã³ããŒããèªåèµ·åãå ±æã§ããŸãïŒããšãã°ãæ§åã®GIFãšåæ§ïŒã
img src="ottawa-river.mp4"
ããã§ãã©ããããéããªããŸããïŒ éçºè ããŒã«ãéããSafari Technology Previewãšä»ã®ãã©ãŠã¶ãŒã®éãã確èªããŸãã
æ®å¿µãªãããSafariã¯WebPageTestã§ããŸãæ©èœãããä¿¡é Œã§ãããã¹ããã³ãããŒã¯ãäœæããããšã¯éåžžã«å°é£ã§ãã åæ§ã«ãTech Previewã®äœ¿çšã¯éåžžã«å°ãããããçŸæç¹ã§RUMããŒã«ãšããã©ãŒãã³ã¹ãæ¯èŒããããšã¯å®çšçã§ã¯ãããŸããã
ãã ãã2ã€ã®ããšãã§ããŸãã ãŸããçãã€ãã®ãµã€ãºãæ¯èŒãã次ã«Image.decodeïŒïŒã«ãŒã«ã䜿çšããŠãããã€ã¹äžã®ããŸããŸãªãªãœãŒã¹ã®åœ±é¿ã枬å®ããŸãã
ã¡ã¢ãªç¯çŽ
1ã€ã¯ã¡ã¢ãªã®ç¯çŽã§ãã æ¯èŒã®ããã«ã giphy.comãã100åã®äººæ°ã®ããã¢ãã¡ãŒã·ã§ã³GIFããã©ã³ã¹ã³ãŒãããããããvp8 / vp9 / webp / h264 / h265ã«å€æããŸããã
泚æ ïŒãããã®çµæã¯è¡šé¢çãªãã®ã«éããªããšèããã¹ãã§ãã vp9ã§ã®çµæã¯vp8ã§ã®çµæãããæªãããšããããã®ã§ãåã³ãŒããã¯ãããè¯ãæ§æã§ããŸãã SSIMãèæ ®ããããå æ¬çãªç 究ãå¿ èŠã§ãã
å€æçµæã®äžå€®å€ïŒp50ïŒã¯æ¬¡ã®ãšããã§ãã
ã¯ããã¢ãã¡ãŒã·ã§ã³WebPã¯å°ããã§ããããããªåœ¢åŒã¯ã¯ããã«å°ãããªã£ãŠããŸãã ææ°ã®ãããªã³ãŒããã¯ã¯ãªã³ã©ã€ã³ãããªã®ã¹ããªãŒãã³ã°ã«æé©åãããŠãããããããã¯èª°ãé©ãããšã§ã¯ãããŸããã H.265ã¢ã«ãŽãªãºã ã¯ãäºæ³ã©ããAV1ã§ãéåžžã«åªããŠããŸãã
ããã§ã®å©ç¹ã¯ã転éé床ã ãã§ãªãã ãšã³ããŠãŒã¶ãŒã«ãšã£ãŠãå€§å¹ ãªã³ã¹ãåæžã§ã ã
img
ã¿ã°ã§ãããªã䜿çšãããšãã»ã«ã©ãŒã§ã¯ããã«é«éã«ããŒããããŸãã
ãã³ãŒããšèŠèŠããã©ãŒãã³ã¹ã®åäž
次ã«ã衚瀺ã®ãã³ãŒãããã³è¡šç€ºå¹æã®åœ±é¿ãæ€èšããŸãã H.264ïŒããã³H.265ïŒã«ã¯ãã¡ã€ã³ã³ã¢ã䜿çšãã代ããã«ããŒããŠã§ã¢ãã³ãŒãã䜿çšãããšãã倧ããªå©ç¹ããããŸãã
ã©ã®ããã«æž¬å®ã§ããŸããïŒ ãã©ãŠã¶ãŒã¯ãŸã ææ¡ãããŠããããŒããŒç»åAPIãå®è£ ããŠããªããããç»åããŠãŒã¶ãŒã«è¡šç€ºããå§ãããšãã®è¯ãæ¯èŒãšããŠãSteve Souder ãŠãŒã¶ãŒã¿ã€ãã³ã°ãšã«ã¹ã¿ã ã¡ããªãã¯æŠç¥ã䜿çšã§ããŸãã ãã¬ãŒã ã¬ãŒãã¯æž¬å®ããŸããããæåã®ãã¬ãŒã ããã€è¡šç€ºããããã瀺ããŸãã æè¿æ¡çšãããImage.decodeïŒïŒèŠåã䜿çšããŠããã³ãŒãããã©ãŒãã³ã¹ã枬å®ããããšãã§ããŸãã 以äžã®ãã¹ãããŒãžã§ã
img
ã¿ã°ã«äžæã®GIFãšMP4ã100åè¿œå ãããã³ãŒããšã¬ã³ããªã³ã°ã®ããã©ãŒãã³ã¹ãæ¯èŒããŸãã
let image = new Image;
t_startReq = new Date().getTime();
document.getElementById("testimg").appendChild(image);
image.onload = timeOnLoad;
image.src = src;
return image.decode().then(() => { resolve(image); });
çµæã¯å°è±¡çã§ãã ãããã¯ãŒã¯ã«æ¥ç¶ããã«ããŒã«ã«ã§äœæ¥ããŠãã匷åãªMacBook Pro 2017ã§ããGIFãã¡ã€ã«ã¯MP4ã®20åã®æéïŒ
onload
ã«ãã£ãŠéç¥ãããïŒãæç»ãããã³ãŒãã«7åã®æéãå¿ èŠã§ããããšãããããŸãã
ã³ã£ããããïŒ ãªããžããªãã³ããŒããŠãèªåã§ãã§ãã¯ã¢ãŠãããŸãã ãããã¯ãŒã¯è»¢éæ¡ä»¶GIFãšMP4ãããããè¿œå ãããšããã¹ãçµæãäžåè¡¡ã«æªãããšã«æ³šæããŠãã ããã ç¹ã«ããã³ãŒãã¯æåŸã®ãã€ããçµäºããåã«éå§ã§ãããããéä¿¡ã衚瀺ããã³ãŒãã®ãã«ã¿ã¯ã¯ããã«å°ãããªããŸãã å®éãããã¯ãã¡ã¢ãªãç¯çŽããã ãã§ãŠãŒã¶ãŒãšã¯ã¹ããªãšã³ã¹ãå€§å¹ ã«åäžããããšã瀺åããŠããŸãã ãã ããlocalhostãèµ·åãããšãã«è¡ã£ãããã«ããããã¯ãŒã¯æ¥ç¶ãé€å€ãããšããããªã䜿çšãããšããã©ãŒãã³ã¹ãå€§å¹ ã«åäžããããšãããããŸãã
ãããã©ã®ããã«å®è£ ã§ããŸããïŒ
ããŠãSafari Technology Previewã¯ãã®ãã¶ã€ã³ãã³ãã¬ãŒãããµããŒãããŠããŸããããµããŒããããŠããªããã©ãŠã¶ãŒã§ç Žæããç»åã衚瀺ããã«ã©ã®ããã«äœ¿çšã§ããŸããïŒ è¯ããã¥ãŒã¹ã§ãïŒ æ¯èŒçç°¡åã§ãã
ãªãã·ã§ã³1ïŒã¬ã¹ãã³ã·ãç»åã䜿çšãã
çæ³çã«ã¯ãæãç°¡åãªæ¹æ³ã¯ãHTML5
picture
ã¿ã°ã®
source type
å±æ§ã䜿çšããããš
source type
ã
ããã§ãããããšãã§ãããšèšãããã§ãã ãã ããSafariã«ã¯ãmimetypeã®å®£èšã«é¢ä¿ãªãããªããŒããŒãæåã®
source
ãããŒããããšããåä»ãªWebKitãã°ããããŸãã ã¡ã€ã³DOMããŒããŒã¯ãšã©ãŒãèªèããæ£ãããœãŒã¹ãéžæããŸãã ãã ããæå·ã¯ãã§ã«è¡ãããŠããŸãã ããªããŒããŒã¯ãã€ã¡ãŒãžã以åã«ããŠã³ããŒãããæ©èœã倱ããããã«ã誀ã£ãããŒãžã§ã³ãããŒãããŠããã€ãã倱ããŸãã 幞ããªããšã«ããã®ãšã©ãŒãä¿®æ£ããSafari TP 45ã«ä¿®æ£ã衚瀺ãããã¯ãã§ãã
ã€ãŸãã次ã®ããŒãžã§ã³ã®Safariã90ïŒ ä»¥äžã®ãŠãŒã¶ãŒã«ã€ã³ã¹ããŒã«ããããŸã§ã
picture
ãš
source type
ã䜿çšããŠMIME
source type
ãéžæããããšã¯ãå§ãããŸããã
ãªãã·ã§ã³2. MP4ãã¢ãã¡ãŒã·ã§ã³WebPãããã³GIFã®ãã©ãŒã«ããã¯ã䜿çšãã
HTMLããŒã¯ã¢ãããå€æŽããããªãå Žåã¯ãHTTPã䜿çšããŠMP4ãã³ã³ãã³ãããŽã·ãšãŒã·ã§ã³ã§Safariã«éä¿¡ã§ããŸãã ãããè¡ãã«ã¯ã
Accept
ããã³
User-Agent
ããããŒã«ã·ããã°ã©ãã®ã³ããŒïŒä»¥åãšåæ§ïŒããã³
Vary
å¿çãããã€ãäœæããå¿ èŠããããŸãã
WebKit BUG 179178ã解決ããã
Accept: video / *
ããããŒã®ãã¹ããè¿œå ã§ããå ŽåïŒããšãã°ã
Accept: image / webp
確èªã§ããŸãïŒãå°ããããã«ãªããŸãã ããããæçµçµæã¯ããã¹ãŠã®ãã©ãŠã¶ãŒããµããŒããã
img
microformatãããªã«æé©ãªåœ¢åŒãååŸããããšã§ãã
nginxã§ã¯ã次ã®ããã«ãªããŸãã
map $http_user_agent $mp4_suffix {
default "";
"~*Safari/605" ".mp4";
}
location ~* .(gif)$ {
add_header Vary Accept;
try_files $uri$mp4_suffix $uri =404;
}
ãã¡ããã
Vary: Accept, User-Agent
ãæå®ããŠãããã·ãããã€ããŒãšCDNã«åå¿çãç°ãªãæ¹æ³ã§ãã£ãã·ã¥ããããã«æå®ããããšãå¿ããªãã§ãã ããã å®éãCache-Controlããã©ã€ããŒããšããŠããŒã¯ããTLSã䜿çšããŠãããé«åºŠãªISPããã©ãŒãã³ã¹åŒ·åãããã·ãã³ã³ãã³ãããã£ãã·ã¥ããªãããã«ããŸãã
ãªãã·ã§ã³3ïŒRESSãšããããªãã¿ã°ã䜿çšãã
HTMLãæäœã§ããå Žåã¯ããå¿çãµãŒããŒåŽãïŒRESSïŒãã¯ãããžãŒã䜿çšã§ããŸãã ãã®ãã©ã¡ãŒã¿ãŒã¯ããã©ãŠã¶ãŒæ€åºããžãã¯ãHTMLåºåã«å€æããŸãã
ããšãã°ãPHPã§ãããè¡ãããšãã§ããŸãã
äžèšã®ããã«ã
Vary: User-Agent
ããããŒãä¿®æ£ããŠããã£ãã·ã¥çšã®HTMLã®ç°ãªãããŒãžã§ã³ãããããšãCDNã«äŒããããšãå¿ããªãã§ãã ããã äžéšã®CDNã¯VaryããããŒãèªåçã«è©äŸ¡ããŸãããä»ã®CDNã¯åçŽãªCDNæ§æã®æŽæ°ã§ããããµããŒãã§ããŸãã
ããŒãã¹ïŒãµãŠã³ããã©ãã¯ãåé€ããããšãå¿ããªãã§ãã ãã
GIFãMP4ã«å€æããã®ã§ã¯ãªããMP4ãGIFã«å€æããã®ã§ãã¡ã¢ãªãç¯çŽããããã«ãªãŒãã£ãªãã©ãã¯ãåé€ããå¿ èŠãããããšãèŠããŠããå¿ èŠããããŸãã ïŒãœãŒã¹ãšããŠGIFã䜿çšããŠããªãããšãæããŠãã ãããããã§ããïŒãªãŒãã£ãªãã©ãã¯ã¯ããã¡ã€ã«ãµã€ãºã§è¿œå ãã€ããå æããŸãã ffmpegã䜿çšããæãç°¡åãªæ¹æ³ïŒ
ffmpeg -i cats.mp4 -vcodec copy -an cats.mp4
ãµã€ãºå¶éã¯ãããŸããïŒ
ãããæžããŠãããšãSafariã¯
img
ã¿ã°ã§æå®ãããã¹ãŠã®ãããªããã©ãã ãæéãããã£ãŠãç²ç®çã«ããŠã³ããŒãããŸãã äžæ¹ã§ãããã¯ãã©ãŠã¶ã®ããã©ãŒãã³ã¹ãæ¹åããã®ã«åœ¹ç«ã€ãããæåŸ ãããŠããŸãã ãã ãããŠãŒã¶ãŒã«120åã®ãããªãã¢ããããŒãããããã«åŒ·å¶ãããšãæãã«ãªãå¯èœæ§ããããŸãã ããŸããŸãªãµã€ãºã®ãããªããã¹ããããŠãŒã¶ãŒããµã€ããããã£ãŠããéã«ãã¹ãŠã®ãããªãã¢ããããŒãããŸããã ãããã£ãŠããŠãŒã¶ãŒã«èŠªåã«ããŠãã ããã é·ãåç»ãè¿œå ããå Žåã¯ã
video
ã¿ã°ã䜿çšããŠããã©ãŒãã³ã¹ãæ¹åããŠãã ããã
次ã¯äœã§ããã ã¬ã¹ãã³ã·ãåç»ãšèæ¯åç»
img
ã¿ã°ãä»ããŠMP4ããã¹ãã§ããããã«ãªã£ããããå€ãã®æ°ãããŠãŒã¹ã±ãŒã¹ã®æãéãããŸããã ãã®ãã¡ã®2ã€ãæãæµ®ãã³ãŸãïŒã¢ãããã£ããããªãšããã¯ã°ã©ãŠã³ããããªã ããã§ãMP4ã
srcsets
ãã¯ã©ã€ã¢ã³ããã³ããšContent-DPRã䜿çšããŠèŠæ±ãå€æŽãã
image media
ã䜿çšããŠè¡šç€ºãç·šéãããã¹ãŠã®æ©èœã䜿çšã§ããŸãã
CSS
background-image: url (.mp4)
ãããªãæ©èœããŸãã
ãããã«
ãããªã³ã³ãã³ãã
img
ã¿ã°ã«çµã¿èŸŒãããšã«ãããSafari Technology Previewã¯ãGIFãã¡ã€ã«ã«åºæã®ããã©ãŒãã³ã¹ãšå質ã倱ãããšãªã ãé©ãã¹ãGIFã®ãããªã¢ãã¡ãŒã·ã§ã³ãžã®éãéããŸãã , , . , , , - . , . Google? Microsoft? Mozilla? Samsung? .