[FFmpeg-user] FFmpeg hue can not get same result to canvas huerotate

Steven Liu lingjiujianke at gmail.com
Fri Oct 27 06:55:44 EEST 2017


    I test with canvas of javascript(H5) ,test on Chrome, the code is bellow:
<!DOCTYPE html>

        <video id="video1" controls width="270" autoplay>
            <source src="b.mp4" type='video/mp4'>

        <p>get from video refresh every 20ms</p>

        <canvas id="myCanvas" width="270" height="135"
style="border:1px solid #d3d3d3;">
            Your browser does not support the HTML5 canvas tag.

        <p> picture from ffmpeg use "ffmpeg -y -i
http://bbs.chinaffmpeg.com/b.mp4 -filter_complex "hue=h=90" -vframes 1
ffmpeg.jpg" </p>

        <img src="./ffmpeg.jpg" />


var v=document.getElementById("video1");
var c=document.getElementById("myCanvas");

        function() {
            var i=window.setInterval(
                    function() {
                        ctx.filter = 'hue-rotate(90deg)';
        v.addEventListener('pause',function() {window.clearInterval(i);},false);
        v.addEventListener('ended',function() {clearInterval(i);},false);



set the hue-rotate to 90.

and set the same deg with ffmpeg:

picture from ffmpeg use "ffmpeg -y -i http://bbs.chinaffmpeg.com/b.mp4
-filter_complex "hue=h=90" -vframes 1 ffmpeg.jpg"

the result is i get similar picture, but the picture get from ffmpeg
is looks like cover by a green color :(

the attechment file is result example, the web link is :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: different_result.png
Type: image/png
Size: 136111 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20171027/22bdb817/attachment.png>

More information about the ffmpeg-user mailing list