
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (36)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (4604)
-
Decoded YUV shows green edge when rendered with OpenGL
2 février 2023, par AlexAny idea, why decoded YUV -> RGB(shader conversion) has that extra green edge on the right side ?

Almost any 1080X1920 video seems to have this issue.



A screen recording of the issue is uploaded here https://imgur.com/a/JtUZq4h


Once I manually scale up the texture width, I can see it fills up to the viewport, but it would be nice if I could fix the actual cause. Is it some padding that's part of YUV colorspace ? What else could it be ?


My model is -1 to 1, filling the entire width

The texture coordinates are also 0 to 1 ratio

float vertices[] = {
 -1.0, 1.0f, 0.0f, 0.0, // top left
 1.0f, 1.0f, 1.0, 0.0, // top right
 -1.0f, -1.0f, 0.0f, 1.0f, // bottom left
 1.0f, -1.0f, 1.0f, 1.0f // bottom right
};



Fragment Shader


#version 330 core

in vec2 TexCoord;

out vec4 FragColor;
precision highp float;
uniform sampler2D textureY;
uniform sampler2D textureU;
uniform sampler2D textureV;
uniform float alpha;
uniform vec2 texScale;


void main()
{
 float y = texture(textureY, TexCoord / texScale).r;
 float u = texture(textureU, TexCoord / texScale).r - 0.5; 
 float v = texture(textureV, TexCoord / texScale).r - 0.5;
 
 vec3 rgb;
 
 //yuv - 709
 rgb.r = clamp(y + (1.402 * v), 0, 255);
 rgb.g = clamp(y - (0.2126 * 1.5748 / 0.7152) * u - (0.0722 * 1.8556 / 0.7152) * v, 0, 255);
 rgb.b = clamp(y + (1.8556 * u), 0,255);

 FragColor = vec4(rgb, 1.0);
} 



Texture Class


class VideoTexture {
 public:
 VideoTexture(Decoder *dec) : decoder(dec) {
 glGenTextures(1, &texture1);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 glBindTexture(GL_TEXTURE_2D, texture1);
 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[0], decoder->frameQueue.first().height, 0, format, GL_UNSIGNED_BYTE, 0);
 glGenerateMipmap(GL_TEXTURE_2D);

 glGenTextures(1, &texture2);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 glBindTexture(GL_TEXTURE_2D, texture2);
 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[1], decoder->frameQueue.first().height / 2, 0, format, GL_UNSIGNED_BYTE, 0);
 glGenerateMipmap(GL_TEXTURE_2D);

 glGenTextures(1, &texture3);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 glBindTexture(GL_TEXTURE_2D, texture3);
 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[2], decoder->frameQueue.first().height / 2, 0, format, GL_UNSIGNED_BYTE, 0);
 glGenerateMipmap(GL_TEXTURE_2D);
 }

 void Render(Shader *shader, Gui *gui) {
 if (decoder->frameQueue.isEmpty()) {
 return;
 }

 glActiveTexture(GL_TEXTURE0);
 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[0], decoder->frameQueue.first().height, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[0]);
 glBindTexture(GL_TEXTURE_2D, texture1);
 shader->setInt("textureY", 0);

 glActiveTexture(GL_TEXTURE1);
 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[1], decoder->frameQueue.first().height / 2, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[1]);
 glBindTexture(GL_TEXTURE_2D, texture2);
 shader->setInt("textureU", 1);

 glActiveTexture(GL_TEXTURE2);
 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[2], decoder->frameQueue.first().height / 2, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[2]);
 glBindTexture(GL_TEXTURE_2D, texture3);
 shader->setInt("textureV", 2);
 }

 ~VideoTexture() {
 printf("\nVideo texture destructor");
 glDeleteTextures(1, &texture1);
 glDeleteTextures(1, &texture2);
 glDeleteTextures(1, &texture3);
 }

 private:
 GLuint texture1;
 GLuint texture2;
 GLuint texture3;
 GLint internalFormat = GL_RG8;
 GLint format = GL_RED;
 int currentFrame = 0;
 Decoder *decoder;
}



-
How to define an in-memory object for opengl to render
23 novembre 2016, par Ted YuCurrently I’m working on an android application, in which I want to fetch frames from Camera, render off-screen and encode into a video. I took the ideas from grafika, camera and egl context works well. However, MediaCodec does not function for some reasons, so I turn to ffmpeg. I do as follows :
- Open camera in camera thread
- Setup egl context in egl thread, create an off-screen surface
- Setup ffmpeg encoder/muxer in encode thread
- Generate texture and new a SurfaceTexture backed with that texture in egl thread, and pass the SurfaceTexture to the camera thread for previewing
- Everytime SurfaceTexture has frame available, draw the texture to the off-screen surface in egl thread
- Read pixels with glReadPixels to a buffer, and pass the buffer to the encode thread
- Encode video in the encode thread if there is any available frames
Everything works fine without glReadPixels, and performance goes low with the glReadPixels invokation uncommented, even the encode thread is not running.
grafika gets high performance by drawing on MediaCodec’s input surface (see VideoEncoderCore).
So I wonder how to do the same thing with ffmpeg ? Is it possible to allocating a frame buffer for rendering and encoding, so that I can get rid of glReadPixels (memory copying) ?
-
Scroll seamless image with FFMPEG
22 septembre 2022, par RobI want to create a video from a single image. The image should scroll vertically and the output needs to be seamless so it can be looped (the image itself is seamless).


Example of what I want to create :
GIF example
and the texture from the example : seamless texture.


Length of the video is not that important since if the scrolling is seamless I should be able to just loop it with
ffmpeg -stream_loop 3 -i input.mp4 -c copy output.mp4
afterwards.

I have tried :


ffmpeg -loop 1 -i input.png -framerate 30 -vf "scroll=vertical=0.002,crop=iw:600:0:0,format=yuv420p" -t 10 -y output.mp4



which creates a video with the desired scrolling effect but its not seamless due to Issues matching the video length with the height of the image/scrolling speed and it looks something like this : Example output (exaggerated) Also ignore it scrolls the other way.


I'm not sure how to proceed, maybe its just a simple math that needs to be done to add to

-t X
by looking at the scroll speed & image height ? . Any ideas welcome how to solve this with either ffmpeg/python/powershell under windows.