In my experiment I got the following size reductions using the commands explained earlier in the post: Format You'll have to play with the CRF value on both formats to measure quality versus the size of the file. If we put MP4 first then the browser will play that format, even if it can play VP9 video. The browser will stop at the first format that it can play and discard all the others. Note that the order of the source tags does matter. playsinline prevents mobile players from going full screen to play the video.muted because the video doesn't have audio.autoplay to make sure the video plays automatically, just like the GIF would.I'm using the attributes of the video tag: The video tag that we use to play the video is pretty much standard. This is the command: ffmpeg -i input.gif -c vp9 -b:v 0 -crf 41 output.webm Putting it all together # For this version, we have to include the codec ( -c vp9) in addition to the commands we used for MP4. Once it is configured we can use it to generate a WebM-based VP9 video. I have configured my version of FFMPEG to work with VP8 and VP9 It is not included in a default FFMPEG installation. The command is: ffmpeg -i input.gif -b:v 0 -crf 25 output.mp4 WebM next # We do care about the quality of the video so we'll use Constant Rate Factor (CRF) to make sure that we get the best possible quality for the given file. We'll use 2 video codecs to replace the GIF file: MP4 and VP9. In this post, I'll take a look at the conversion and display of this animated "gifs".įor the video conversion, we'll use FFMPEG command line utility as we've done with most of the prior work posted here. One way to reduce the file size is to convert it to video. The flipside is that the files tend to be unnecessarily large. Unable to find a suitable output format for 'myAudio.Animated GIFs are a good way to demonstrate short sequences of events or actions in your browser or application. Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default) Input #0, matroska,webm, from 'myAudio.webm':ĭuration: N/A, start: 0.000000, bitrate: N/A Warning: not compiled with thread support, using thread emulation Ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developersīuilt with emcc (Emscripten gcc/clang-like replacement) 1.39.11Ĭonfiguration: -cc=emcc -ranlib=emranlib -enable-cross-compile -target-os=none -arch=x86 -disable-runtime-cpudetect -disable-asm -disable-fast-unaligned -disable-pthreads -disable-w32threads -disable-os2threads -disable-debug -disable-stripping -disable-safe-bitstream-reader -disable-all -enable-ffmpeg -enable-avcodec -enable-avformat -enable-avfilter -enable-swresample -enable-swscale -disable-network -disable-d3d11va -disable-dxva2 -disable-vaapi -disable-vdpau -enable-decoder=vp8 -enable-decoder=h264 -enable-decoder=vorbis -enable-decoder=opus -enable-decoder=mp3 -enable-decoder=aac -enable-decoder=pcm_s16le -enable-decoder=mjpeg -enable-decoder=png -enable-demuxer=matroska -enable-demuxer=ogg -enable-demuxer=mov -enable-demuxer=mp3 -enable-demuxer=wav -enable-demuxer=image2 -enable-demuxer=concat -enable-protocol=file -enable-filter=aresample -enable-filter=scale -enable-filter=crop -enable-filter=overlay -enable-filter=hstack -enable-filter=vstack -disable-bzlib -disable-iconv -disable-libxcb -disable-lzma -disable-sdl2 -disable-securetransport -disable-xlib -enable-zlib -enable-encoder=libvpx_vp8 -enable-encoder=libopus -enable-muxer=webm -enable-muxer=ogg -enable-muxer=null -enable-libopus -enable-libvpx -extra-cflags='-s USE_ZLIB=1 -I./libvpx/dist/include' -extra-ldflags=-L./libvpx/dist/lib
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |