Comments on: Encode h.264 and WebM videos for MediaElement.js using FFmpeg https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/ Tips on .Net, SQL Server, Sharepoint & AI Sat, 20 Sep 2014 16:17:02 +0000 hourly 1 https://wordpress.org/?v=6.3.4 By: Aslam Doctor https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/#comment-38348 Sat, 20 Sep 2014 16:17:02 +0000 http://blogs.visigo.com/chriscoulson/?p=104#comment-38348 This is just perfect. Thank You for all the efforts in sharing. I had the MP4 files but they were not working on chrome. Now after using Your conversion method, its working perfectly.

]]>
By: Faron Coder https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/#comment-38345 Wed, 03 Sep 2014 22:52:18 +0000 http://blogs.visigo.com/chriscoulson/?p=104#comment-38345 Hello —

For those who use unix based ffmpeg – here’s the corresponding to author’s codes (above) in name of unix.

ffmpeg -y -i $fileid -vcodec libx264 -pix_fmt yuv420p -vprofile high -preset fast -b:v 500k -maxrate 500k -bufsize 1000k -vf “scale=trunc(oh*a/2)*2:480” -threads 0 -acodec libvo_aacenc -b:a 128k “$file.mp4” < /dev/null

ffmpeg -y -i $fileid -vcodec libvpx -quality good -cpu-used 5 -b:v 500k -maxrate 500k -bufsize 1000k -vf "scale=trunc(oh*a/2)*2:480" -threads 0 -acodec libvorbis -f webm "$file.webm" < /dev/null

ffmpeg -y -i $fileid -ss 1 -vframes 1 -r 1 -vf "scale=trunc(oh*a/2)*2:480" -f image2 "$file.jpg" < /dev/null
ffmpeg -y -i $fileid -ss 2 -vframes 1 -r 1 -vf "scale=trunc(oh*a/2)*2:480" -f image2 "$file.jpg" < /dev/null
ffmpeg -y -i $fileid -ss 3 -vframes 1 -r 1 -vf "scale=trunc(oh*a/2)*2:480" -f image2 "$file.jpg" < /dev/null
ffmpeg -y -i $fileid -ss 5 -vframes 1 -r 1 -vf "scale=trunc(oh*a/2)*2:480" -f image2 "$file.jpg" < /dev/null
ffmpeg -y -i $fileid -ss 10 -vframes 1 -r 1 -vf "scale=trunc(oh*a/2)*2:480" -f image2 "$file.jpg" < /dev/null

]]>
By: Peter https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/#comment-38283 Thu, 20 Feb 2014 15:47:02 +0000 http://blogs.visigo.com/chriscoulson/?p=104#comment-38283 For backup, example (from that web site):

This will create one thumbnail image every minute, named img001.jpg, img002.jpg, img003.jpg, … (%03d means that ordinal number of each thumbnail image should be formatted using 3 digits)

ffmpeg -i myvideo.avi -f image2 -vf fps=fps=1/60 img%03d.jpg

]]>
By: Peter https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/#comment-38282 Thu, 20 Feb 2014 15:45:40 +0000 http://blogs.visigo.com/chriscoulson/?p=104#comment-38282 For image thumbnails. Your sample means that ffmpeg must load video file each time it will generate image thumbnail from it. This can be expensive on memory consumption. There is another way to extract multiple image thumbnails from video at once. Sample: https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video

]]>
By: Dan https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/#comment-38171 Wed, 14 Aug 2013 21:32:05 +0000 http://blogs.visigo.com/chriscoulson/?p=104#comment-38171 Hi Chris, great article! It helped me to get started with webm encoding.

I couldn’t figure out why my webm videos would play on Firefox and Chrome, but not Android, so I did some testing and analysis and discovered that the formula for resizing would only work for my Android S3 if the formula was: scale=trunc(oh*a/16)*16:x where x is a multiple of 16.

I may be incorrect, but it seems to be consistent in my results.

I hope this helps some peeps out!

]]>
By: Chris Coulson https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/#comment-7723 Wed, 13 Feb 2013 22:38:46 +0000 http://blogs.visigo.com/chriscoulson/?p=104#comment-7723 In reply to Mike.

Thanks for pointing that out. It’s actually supposed to be AAC (for the audio codec used). I’ve updated the post.

]]>
By: Mike https://blogs.visigo.com/chriscoulson/encode-h-264-and-webm-videos-for-mediaelement-js-using-ffmpeg/#comment-7722 Wed, 13 Feb 2013 22:29:18 +0000 http://blogs.visigo.com/chriscoulson/?p=104#comment-7722 It’s probably just a typo in your batch file, but I think you mean (H.264 / AVC) rather than ACC. If this is the biggest problem either of us run into, we’re in good shape. Thanks for this!

]]>