Giter VIP home page Giter VIP logo

qmlffmpegplayer's Introduction

QmlFFmpegPlayer

a simple video player in qml with ffmpeg.

简易Qml视频播放器.

ffmpeg 4.0 解码,Qml/OpenGL转码yuv到RGB并渲染

仓库及镜像

github原仓库https://github.com/jaredtao/QmlFFmpegPlayer

gitee镜像https://gitee.com/jaredtao/QmlFFmpegPlayer

徽章

Windows MacOS license-link
win-badge macos-badge license-badge

效果图

说明

Qt版本5.9以上

FFmpeg 版本为4.2.2,已经在qmake中适配msvc x86、msvc x64、macos 64平台。

如果使用其它编译器或者其它平台,请自行修改。

答疑和技术支持

QQ群:734623697

联系方式


作者 涛哥
开发理念 传承工匠精神
博客 https://jaredtao.github.io/
博客-国内镜像 https://jaredtao.gitee.io
知乎专栏 https://zhuanlan.zhihu.com/TaoQt
QQ群 734623697(高质量群,只能交流技术、分享书籍、帮助解决实际问题)
邮箱 [email protected]

QQ(TIM)、微信二维码

****** 请放心联系我,乐于提供咨询服务,也可洽谈有偿技术支持相关事宜。


赞助

****** 觉得分享的内容还不错, 就请作者喝杯奶茶吧~~


qmlffmpegplayer's People

Contributors

jared2020 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qmlffmpegplayer's Issues

视频渲染结果与实际有色差

使用代码里的片段着色器进行YUV转RGB渲染出的视频可能存在色差,黑色不够黑,白色不够白。最后发现跟输入视频的YUV色域有关。视频色域不同,需要用不同的公式转换。参考下面这个文章后解决了,特在此记录。

YUV转RGB有哪些重要的点
https://zhuanlan.zhihu.com/p/436186749

Getting errors

The application builds and starts but throws the following errors in the Application Output pane:

18:49:09: Starting C:\Qt_Sandbox\QmlOpenGLResize-master\bin\Resize.exe ...
QML debugging is enabled. Only use this in a safe environment.
TaoRenderer::TaoRenderer
TaoRenderer::init
QOpenGLShader::compile(Fragment): ERROR: 4:29: 'clamp' : no matching overloaded function found - implicit conversion not allowed 
ERROR: 4:30: 'clamp' : no matching overloaded function found - implicit conversion not allowed 
ERROR: 4:31: 'clamp' : no matching overloaded function found - implicit conversion not allowed 


*** Problematic Fragment shader source code ***
#version 110
#ifdef GL_KHR_blend_equation_advanced
#extension GL_ARB_fragment_coord_conventions : enable
#extension GL_KHR_blend_equation_advanced : enable
#endif
#define lowp
#define mediump
#define highp
#line 1
varying vec2 v_texCoord;

uniform sampler2D tex_y;
uniform sampler2D tex_u;
uniform sampler2D tex_v;
uniform int pixFmt;
void main(void)
{
    vec3 yuv;
    vec3 rgb;
    if (pixFmt == 0) {
        //yuv420p
        yuv.x = texture2D(tex_y, v_texCoord).r;
        yuv.y = texture2D(tex_u, v_texCoord).r - 0.5;
        yuv.z = texture2D(tex_v, v_texCoord).r - 0.5;
//        rgb = mat3( 1,       1,         1,
//                    0,       -0.39465,  2.03211,
//                    1.13983, -0.58060,  0) * yuv;
        rgb = mat3( 1,       1,         1,
                        0,       -0.3455,  1.779,
                        1.4075, -0.7169,  0) * yuv;
    } else {
        //YUV444P
        yuv.x = texture2D(tex_y, v_texCoord).r;
        yuv.y = texture2D(tex_u, v_texCoord).r - 0.5;
        yuv.z = texture2D(tex_v, v_texCoord).r - 0.5;

        rgb.x = clamp( yuv.x + 1.402 *yuv.z, 0, 1);
        rgb.y = clamp( yuv.x - 0.34414 * yuv.y - 0.71414 * yuv.z, 0, 1);
        rgb.z = clamp( yuv.x + 1.772 * yuv.y, 0, 1);
    }
    gl_FragColor = vec4(rgb, 1);
}


***
 add fragment shader file failed.
TaoRenderer::resize

Can you please see what is issue with this fragment shader?
I am using Qt5.14.1 MSVC-2017-64bit on Windows-10.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.