
Recherche avancée
Médias (3)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (60)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)
Sur d’autres sites (11769)
-
Why are Cb and Cr planes displaced differently from lum by the displace complex filter in ffmpeg ?
10 janvier 2024, par NebI have a video encoded with the yuv420p pixel format and I want to displace its pixels. I'm using ffmpeg and its new displace filter. The filter takes as inputs (the video to be displaced and) two displacement maps respectively for X and Y axis. I decided to create the displacement maps directly into ffmpeg using the nullsrc video source filter and the geq filter to specify the value of the three planes : lum, Cb, Cr. The script is the following :



ffmpeg INPUT.mp4 -f lavfi -i nullsrc=size=${WIDTH}x${HEIGHT}:d=0.1,geq='lum=128+30*sin(2*PI*X/400):Cb=128+30*sin(2*PI*X/400):Cr='128+30*sin(2*PI*X/400)' -f lavfi -i nullsrc=size=${WIDTH}x${HEIGHT}:d=0.1,geq='lum=128+30*sin(2*PI*X/400):Cb=128+30*sin(2*PI*X/400):Cr=128+30*sin(2*PI*X/400)' -lavfi '[0][1][2]displace' OUTPUT.mp4




I used the example provided in the documentation of ffmpeg, since the expression used in geq is irrelevant for the purposes of the problem.



At the and of the computation, I get the pixels of the input video not properly displaced, meaning that I can clearly see a sort of ghost carrying-color-information video under a displaced but b/w one.
After some tests, I noticed that the displacemnt map created had only the luma plane displaced correctly while the chrominance planes were displaced, but differently from luma, which is the origin of the planes disalignment in the intput video as you can see in the following extract frames :






I also noticed that the video describing the Cb and Cr planes of the displacement maps have half resolution of the luma plane.



My question is : how can i setup correctly the Cr and Cb planes in the geq definition so that they are exactly identical to the luma plane ?



It would be also great if someone could explain me why ffmpeg gives me an output so much different for luma and Cb, Cr planes even if the function provided is the same.



If, it can help, i'm using ffmpeg 3.3-static build.



Thanks for your time.


-
Copy C++ FFmpeg AVFrame to C# WritableBitmap
2 janvier 2023, par SpurigaI have a C++ function definition with ffmpeg scaler The last two parameter is my question (buffer and stride) :


int scale_decoded_video_frame(void* handle, void* scalerHandle, void* scaledBuffer, int scaledBufferStride) 

sws_scale(
 scalerContext->sws_context,
 srcData,
 context->frame->linesize,
 0, 
 scalerContext->source_height,
 reinterpret_cast(&scaledBuffer),
 &scaledBufferStride);



When I declared it in C# I use the following code :


[DllImport(LibraryName, EntryPoint = "scale_decoded_video_frame", CallingConvention = CallingConvention.Cdecl)]
public static extern int ScaleDecodedVideoFrame(IntPtr handle, IntPtr scalerHandle, IntPtr scaledBuffer, int scaledBufferStride);



And the C# call :


WriteableBitmap w = new WriteableBitmap(1920, 1080, 96, 96, PixelFormats.Pbgra32, null);
RenderOptions.SetBitmapScalingMode(w, BitmapScalingMode.NearestNeighbor);
w.Lock();

Int32Rect rect = new Int32Rect(0, 0, 1920, 1080);

resultCode = FFmpegVideoPInvoke.ScaleDecodedVideoFrame(decoderPtr, scalerHandle, w.BackBuffer, w.BackBufferStride);
if (resultCode == 0)
 w.AddDirtyRect(rect);

w.Unlock();



It works perfect, but I want to skip the scale function and only want to get the decoded image to the WritableBitmap buffer. I try to use this code, change the sws_scale function to memcpy, but it shows nothing. The context->frame is AVFrame*.


memcpy(scaledBuffer, context->frame->data, AV_NUM_DATA_POINTERS * sizeof(uint8_t));
memcpy(&scaledBufferStride, context->frame->linesize, AV_NUM_DATA_POINTERS * sizeof(int));



How can I copy the AVFrame buffer to the WritableBitmap buffer ?


-
Undefined references to swscale functions
22 novembre 2015, par rightaway717My app fails to link to swscale library at all. I mean that any swscale method I’m trying to use in my code becomes an undefined reference.
I know what this error means - a linker couldn’t find any definition of used functions.But the problem is that I made sure that :
-L/usr/local/Cellar/ffmpeg/2.8.2/lib -lswscale
is in linker output, and the linker actually finds the lib, otherwise it would complain about missingswscale
-
The library is really there :
$ll /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale*
output :
-r--r--r-- 1 myuser admin 519K Nov 20 19:33 /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale.3.1.101.dylib
lrwxr-xr-x 1 myuser admin 24B Nov 20 19:32 /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale.3.dylib -> libswscale.3.1.101.dylib
-r--r--r-- 1 myuser admin 607K Nov 20 19:32 /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale.a
lrwxr-xr-x 1 myuser admin 24B Nov 20 19:32 /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale.dylib -> libswscale.3.1.101.dylib-
The library is of the correct architecture :
$lipo -info /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale.3.dylib
output :
Non-fat file: /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale.3.dylib is architecture: x86_64
My machine architecture :
$uname -m
output :
x86_64
-
The symbols exist in the binary, for example :
$nm /usr/local/Cellar/ffmpeg/2.8.2/lib/libswscale.3.1.101.dylib | grep sws_alloc_context
output :
000000000004e3b4 T _sws_alloc_context
- I also tried a couple of different swscale binaries, not only the "brew" ones, but nothing changed. I also tried to do the same on my Ubuntu laptop, but it is still the same.
This is actually a QT app I’m trying to build. I should mention, that I don’t have issues with linking other libraries the same way.
I also compiled successfullyswscale-test.c
(which is in libwscale sources) using :clang swscale-test.c -lswscale -lavutil
Do you have any ideas what is wrong or what else can I try to find out the reason ?