
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (1)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (372)
-
Overlay text on video with ffmpeg
7 avril 2017, par ACIDSTEALTHI have some short mp4 video clips. Each one represents a response to a question or prompt. I would like to overlay the question/prompt text atop a grey semi-opaque banner. I need to be able to control the size, position, color, and opacity of the grey banner as well as the size, color, font family, justification, etc of the text that is overlaid atop it.
I’ll prepend my question by stating that my experience with ffmpeg is limited to applying watermarks to videos via it’s Ruby wrapper streamio-ffmpeg. I know what I want to do is possible, I just don’t know where to begin. What I would like to know is how I can do this with ffmpeg. Specifically I am hoping for some sample code that I can learn from and adapt to my specific need, as well as how I can execute that code on a video within the context of a Rails app.
-
YouTube live says not receiving data
27 décembre 2016, par Steve LobdellSo, I’m using ffmpeg. I can stream videos to YouTube live I’ve downloaded from the internet successfully using this command :
ffmpeg -re -i "C:\video.flv" -c:v libx264 -preset slow -crf 18 -c:a copy -f flv "rtmp://a.rtmp.youtube.com/live2/xyz"
When I try to stream a video that’s been recorded from a specific device, that is also flv and with same command, it’s not working. FFMpeg says it’s transmitting, no errors there. In the live dashboard on YouTube I get a green "Starting" briefly but then it goes grey to say it’s not receiving data. The only difference is the actual flv files.
Any idea why YouTube Live would say it’s not receiving any data instead of giving me an error, when it clearly is receiving it because it works with other video files ? Thanks
-
Video rendering in OpenGL on Qt5
28 janvier 2016, par BobnonoI’m trying to render my decoded frame from FFMPEG to an QOpenGLWindow.
FFMPEG give me NV12 AVFrame or YUV420p or RGB.
I choose the simplest RGB.I created an c_gl_video_yuv class inherit from QOpenGLWindow and QOpenGLFunctions_3_3.
I want to use shader to draw my rectangle and texture it with the video frame. (for YUV I want the sader to convert it in RGB and apply texture)
my c_gl_video_yuv class is define as below :
class c_gl_video_yuv : public QOpenGLWindow,protected QOpenGLFunctions_3_3_Core
{
public:
c_gl_video_yuv();
~c_gl_video_yuv();
---
void update_texture(AVFrame *frame, int w, int h);
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void paintEvent(QPaintEvent *);
private:
---
GLuint textures[2];
---
// Shader program
QOpenGLShaderProgram *m_program;
GLint locVertices;
GLint locTexcoord;
};I initialise the OpenGL :
void c_gl_video_yuv::initializeGL()
{
// Init shader program
initializeOpenGLFunctions();
glGenTextures(2, textures);
/* Apply some filter on the texture */
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D, textures[1]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
qDebug() << "c_gl_video_yuv::initializeGL() initialise shader"<< endl;
m_program = new QOpenGLShaderProgram(this);
m_program->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/shader/Ressources/vertex_yuv.glsl");
m_program->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shader/Ressources/rgb_to_rgb_shader .glsl");
m_program->link();
// /* Grab location of shader attributes. */
locVertices = m_program->attributeLocation("position");
locTexcoord = m_program->attributeLocation("texpos");
/* Enable vertex arrays to push the data. */
glEnableVertexAttribArray(locVertices);
glEnableVertexAttribArray(locTexcoord);
/* set data in the arrays. */
glVertexAttribPointer(locVertices, 2, GL_FLOAT, GL_FALSE, 0,
&vertices[0][0]);
glVertexAttribPointer(locTexcoord, 2, GL_FLOAT, GL_FALSE, 0,
&texcoords[0][0]);
// GL options
glEnable(GL_DEPTH_TEST);
}And I render
void c_gl_video_yuv::paintGL()
{
qDebug() << "paintGL() set viewport "<* Clear background. */
glClearColor(0.5f,0.5f,0.5f,1.0f);
glClear(GL_COLOR_BUFFER_BIT);
if(first_frame)
{
qDebug() << "paintGL() Bind shader" << endl;
m_program->bind();
/* Get Ytex attribute to associate to TEXTURE0 */
m_program->bindAttributeLocation("Ytex",0);
m_program->bindAttributeLocation("UVtex",1);
qDebug() << "paintGL() Bind texture" << endl;
if(!is_init)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, frame_width, frame_height, 0, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0] );
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, textures[1]);
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, frame_width, frame_height, 0, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0] );
is_init = true;
}
else
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, frame_width, frame_height, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0]);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, textures[1]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, frame_width, frame_height, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0]);
}
glVertexAttribPointer(locVertices, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glVertexAttribPointer(locTexcoord, 2, GL_FLOAT, GL_FALSE, 0, texcoords);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDisableVertexAttribArray(1);
glDisableVertexAttribArray(0);
m_program->release();
}
}the vertex shader is :
#version 330 core
attribute vec3 position;
attribute vec2 texpos;
varying vec2 opos;
void main(void)
{
opos = texpos;
gl_Position = vec4(position, 1.0);
}and the Fragment shader is :
version 330 core
in vec2 TexCoords;
out vec4 color;
uniform sampler2D YImage;
uniform sampler2D UVImage;
const vec3 r_c = vec3(1.164383, 0.000000, 1.596027);
const vec3 g_c = vec3(1.164383, -0.391762, -0.812968);
const vec3 b_c = vec3(1.164383, 2.017232, 0.000000);
const vec3 offset = vec3(-0.0625, -0.5, -0.5);
void main()
{
float y_val = texture(YImage, TexCoords).r;
float u_val = texture(UVImage, TexCoords).r;
float v_val = texture(UVImage, TexCoords).g;
vec3 yuv = vec3(y_val, u_val, v_val);
yuv += offset;
color.r = dot(yuv, r_c);
color.g = dot(yuv, g_c);
color.b = dot(yuv, b_c);
color.a = 1.0;
};(for RGB frame a replace thevec3(1.164383, 0.000000, 1.596027) ; by vec3(1.0, 1.000000, 1.0) ;
So before i receive a frame it render nothing, just a grey window - noarmal
After I receive a frame, the textures are uploaded and the shaders normaly create the player. But nothing appear not even a black rectangle nothing, just plain grey.What is wrong ?
It is not the right way to upload texture, or my vertex are not created ?
of course i declarde my vetrtices eand texture coordonateconst GLfloat vertices[][2] = {
{-1.f, -1.f},
{1.f, -1.f},
{-1.f, 1.f},
{1.f, 1.f}
};
const GLfloat texcoords[][2] = {
{0.0f, 1.0f},
{1.0f, 1.0f},
{0.0f, 0.0f},
{1.0f, 0.0f}
};I am very new to OpenGL so it is quite fuzzy in my head, but I thought it is not really hard to draw a rectangle with a streaming texture.
Maybe i should use vbo or fbo but I still don’t really understand this.If someone can help me, I will appreciate !
Thanks