
Recherche avancée
Autres articles (60)
-
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
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 (5574)
-
Using 'blend' filter with ffmpeg colors my video pink
12 octobre 2022, par Ilan YashukI am using ffmpeg's library
fluent-ffmpeg
in nodejs.

My purpose is to blend a black box with text upon a video (using 'lighten' blend filter)
so the background will be deleted in a clean & beautiful way.


For some reason the video turns pink after I do that.


The code for blending :


return new Promise((resolve, reject) => {
ffmpeg()
 .input(videoPath) // input '0', the background video
 .input(picturePath) // input '1', the black box with text
 .complexFilter([
 {
 filter: "blend",
 inputs: ["1", "0"],
 options: {
 all_mode: "lighten",
 },
 },
 ])

 .saveToFile(endPath)
 .on("error", (err) => {
 console.log(err);
 reject(false);
 })
 .on("end", () => {
 resolve(true);
 });



Before the blend :






I've read here that the problem's cause may be that blend's format is
YUV
and notGBRP
. I've tried it and it didn't work.

Any help would be appreciated. If possible, please give a code answer and not a command-line answer because converting it sometimes tends to do problems.


-
opengl es yuv to rgb conversion display only green and pink colors
3 février 2014, par DSGI am doing yuv to rgb conversion using opengl shaders. But its only show green and pink colors. I am using ffmpeg to decode movie. I am beginner in this, so have no idea how to solve it. ffmpeg give me three buffers of yuv. I am directly assigning these buffers to three textures.
Here are shaders I am using.
static const char* VERTEX_SHADER =
"attribute vec4 vPosition; \n"
"attribute vec2 a_texCoord; \n"
"varying vec2 tc; \n"
"uniform mat4 u_mvpMat; \n"
"void main() \n"
"{ \n"
" gl_Position = u_mvpMat * vPosition; \n"
" tc = a_texCoord; \n"
"} \n";
static const char* YUV_FRAG_SHADER =
"#ifdef GL_ES \n"
"precision highp float; \n"
"#endif \n"
"varying vec2 tc; \n"
"uniform sampler2D TextureY; \n"
"uniform sampler2D TextureU; \n"
"uniform sampler2D TextureV; \n"
"uniform float imageWidth; \n"
"uniform float imageHeight; \n"
"void main(void) \n"
"{ \n"
"float nx, ny; \n"
"vec3 yuv; \n"
"vec3 rgb; \n"
"nx = tc.x; \n"
"ny = tc.y; \n"
"yuv.x = texture2D(TextureY, tc).r; \n"
"yuv.y = texture2D(TextureU, vec2(nx/2.0, ny/2.0)).r - 0.5; \n"
"yuv.z = texture2D(TextureV, vec2(nx/2.0, ny/2.0)).r - 0.5; \n"
// Using BT.709 which is the standard for HDTV
"rgb = mat3( 1, 1, 1, \n"
"0, -0.18732, 1.8556, \n"
"1.57481, -0.46813, 0)*yuv;\n"
// BT.601, which is the standard for SDTV is provided as a reference
//"rgb = mat3( 1, 1, 1, \n"
// "0, -0.34413, 1.772, \n"
// "1.402, -0.71414, 0) * yuv; \n"
"gl_FragColor = vec4(rgb, 1.0); \n"
"} \n";Output :
What wrong am I doing ? Please help me out with this.
Thank You.
UPDATE :
While debugging ffmpeg decoding, I found that ffmpeg decoder give PIX_FMT_YUV420P output format. Do I have to make some tweaks to get correct image colors ?
-
FFmpeg screen blend mode turns image pink
18 mai 2021, par IAmDamoSuzukiI'm having trouble using the screen blend mode. I'm trying to create a video delay/echo effects. I have things working fairly well, but whenever I try to use the screen blend mode I get a pink image. Other blend modes don't have this issue, but the screen mode is likely going to give me the best visual results.


I see that someone else asked a similar question here, and the answers suggested converting to RGBa before doing the blends. I've tried this and it didn't work. Here's my code and ffmpeg info.


ffmpeg -i sampleVideo.mov -c:v prores -profile:v 3 -filter_complex "split[dry][toEcho];[toEcho]setpts=PTS+0.2/TB[wet];[wet][dry]blend=all_mode=screen:all_opacity=1,format=yuv422p10le[out]" -map [out] sampleVideo_echo.mov



ffmpeg info :


ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
 built with Apple clang version 11.0.0 (clang-1100.0.33.17)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.3_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-fno-stack-check --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/morgan/Movies/AVAA/TapeDamage01.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 Duration: 00:00:05.16, start: 0.000000, bitrate: 3717 kb/s
 Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 81:80 DAR 27:20], 3560 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
 Metadata:
 handler_name : Apple Video Media Handler
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
 Metadata:
 handler_name : Apple Sound Media Handler
File '/Users/morgan/Movies/AVAA/TapeDamage01_echo.mov' already exists. Overwrite ? [y/N] y
Stream mapping:
 Stream #0:0 (h264) -> split
 format -> Stream #0:0 (prores)
Press [q] to stop, [?] for help
Output #0, mov, to '/Users/morgan/Movies/AVAA/TapeDamage01_echo.mov':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.29.100
 Stream #0:0: Video: prores (HQ) (apch / 0x68637061), yuv422p10le, 640x480 [SAR 81:80 DAR 27:20], q=2-31, 200 kb/s, 29.97 fps, 30k tbn, 29.97 tbc (default)
 Metadata:
 encoder : Lavc58.54.100 prores



Here's a sample of the input file :




and here's the pink output