
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (100)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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
Sur d’autres sites (9287)
-
Setting individual pixels of an RGB frame for ffmpeg encoding
15 mai 2013, par Camille GoudeseuneI'm trying to change the test pattern of an ffmpeg streamer, Trouble syncing libavformat/ffmpeg with x264 and RTP , into familiar RGB format. My broader goal is to compute frames of a streamed video on the fly.
So I replaced its
AV_PIX_FMT_MONOWHITE
withAV_PIX_FMT_RGB24
, which is "packed RGB 8:8:8, 24bpp, RGBRGB..." according to http://libav.org/doxygen/master/pixfmt_8h.html .To stuff its pixel array called
data
, I've tried many variations onfor (int y=0; y/ const double j = y/double(HEIGHT);
rgb[0] = 255*i;
rgb[1] = 0;
rgb[2] = 255*(1-i);
}
}At
HEIGHT
xWIDTH
= 80x60, this version yields
, when I expect a single blue-to-red horizontal gradient.
640x480 yields the same 4-column pattern, but with far more horizontal stripes.
640x640, 160x160, etc, yield three columns, cyan-ish / magenta-ish / yellow-ish, with the same kind of horizontal stripiness.
Vertical gradients behave even more weirdly.
Appearance was unaffected by an
AV_PIX_FMT_RGBA
attempt (4 not 3 bytes per pixel, alpha=255). Also unaffected by a port from C to C++.The argument
srcStrides
passed tosws_scale()
is a length-1 array, containing the single intHEIGHT
.Access each Pixel of AVFrame asks the same question in less detail, so far unanswered.
The streamer emits one warning, which I doubt affects appearance :
[rtp @ 0x269c0a0] Encoder did not produce proper pts, making some up.
So. How do you set the RGB value of a pixel in a frame to be sent to sws_scale() (and then to x264_encoder_encode() and av_interleaved_write_frame()) ?
-
Pass individual frames as BGRA byte array and set the timestamps via pipe to FFmpeg
30 juillet 2023, par Nicke ManarinI have a set of images (as BGRA
byte[]
) with their respective timestamps in milliseconds and I want to pass it to FFmpeg to build an animation.

I'm using FFmpeg v6 right now and in this example I'm expecting a GIF as output, but I'm going to export to multiple formats later.


var arguments = "-vsync passthrough 
-f rawvideo 
-pix_fmt bgra 
-video_size {width}x{height} 
-i - 
-loop 0 
-lavfi palettegen=stats_mode=diff[pal],[0:v][pal]paletteuse=new=1:dither=sierra2_4a:diff_mode=rectangle 
-f gif 
-y \"C:\Users\User\Desktop\test.gif\"";

var process = new Process
{
 StartInfo = new ProcessStartInfo
 {
 FileName = "./ffmpeg.exe",
 Arguments = arguments.Replace("{width}", width.ToString()).Replace("{height}", height.ToString()),
 RedirectStandardInput = true,
 RedirectStandardOutput = true,
 UseShellExecute = false,
 CreateNoWindow = true
 }
};

_process.Start();




Then on my render loop, I'm trying to send the frames and their timestamps one by one.


public void EncodeFrame(IntPtr bufferAddress, int bufferStride, int width, int height, int index, long timestamp, int delay)
{
 var frameSize = height * bufferStride;
 var frameBytes = new byte[frameSize];
 System.Runtime.InteropServices.Marshal.Copy(bufferAddress, frameBytes, 0, frameSize);

 _process.StandardInput.BaseStream.Write(frameBytes, 0, frameSize);
 _process.StandardInput.BaseStream.Write(_delimiter, 0, _delimiter.Length);
 _process.StandardInput.BaseStream.Write(BitConverter.GetBytes(timestamp), 0, sizeof(long));
}



The issue is that I'm getting an IOException (The pipe has been ended), so probably I'm not sending the frames correctly (not sending the delimiter and timestamp doesn't help).


Is this even possible ?


-
Of ctors and dtors
18 février 2011, par Multimedia Mike — Programming, Sega DreamcastI haven’t given up on the Sega Dreamcast programming. I was able to compile a bunch of homebrew code for the DC many years ago and I can’t make it work anymore. Again, I was working with a purpose-built, open source RTOS named KallistiOS (or KOS). I can make the programs compile but not run. I had ELF files left over from years ago which still executed. But when I tried to build new ELF files, no luck— the programs crashed before even reaching my main() function.
I found the problem : ELF files are comprised of a number of sections and 2 of these sections are named ’.ctors’ and ’.dtors’ which stand for constructors and destructors. The KOS RTOS performs a manual traversal of .ctors section during program initialization and this is where things go bad. The traversal code doesn’t seem to account for a .ctors section that only contains a single entry. I commented out the function that does the traversal and programs started to work, at least until it was time to exit the program and return control to the program loader. That’s when the counterpart .dtors section traversal code ran and demonstrated the same problem. I’ll exhibit the problematic code at the end of this post.
So I’m finally tinkering with Sega Dreamcast programming once again and with a slightly better grasp of software engineering than the first time I did this.
Portable and Compatible C ?
If nothing else, this low-level embedded stuff exposes you to some serious toolchain arcana, the likes of which you will likely never see working strictly in the desktop arena.Still, this exercise makes me wonder why C code from a decade ago doesn’t compile reliably now. Part of it is because gcc has gotten stricter about the syntax it will accept. In the case of this specific crashing problem, I suspect it comes down to a difference in the way the linker generates the final ELF file. I’ve written a list of items I have had to modify in the KOS codebase in order to get it to compile on more recent gcc versions. I wonder if it would be worth publishing the specifics, or if anyone would ever find the information useful ? Oh, who am I kidding ? Of course I’ll write it up, perhaps publish a new version of the code, if only because that’s the best chance I have of finding my own work again some years down the road.
Problematic C Code
See if this code makes any sense to you. It somehow traverse a list of 32-bit function pointers (in different directions, depending on constructors or destructors), executing each in turn. However, it appears to fall over if the list of pointers consists of a single entry.
C :-
typedef void (*fptr)(void) ;
-
-
static fptr ctor_list[1] __attribute__((section(".ctors"))) = { (fptr) -1 } ;
-
static fptr dtor_list[1] __attribute__((section(".dtors"))) = { (fptr) -1 } ;
-
-
/* Call this to execute all ctors */
-
void arch_ctors() {
-
fptr *fpp ;
-
-
/* Run up to the end of the list (defined by crtend) */
-
for (fpp=ctor_list + 1 ; *fpp != 0 ; ++fpp)
-
;
-
-
/* Now run the ctors backwards */
-
while (—fpp> ctor_list)
-
(**fpp)() ;
-
}
-
-
/* Call this to execute all dtors */
-
void arch_dtors() {
-
fptr *fpp ;
-
-
/* Do the dtors forwards */
-
for (fpp=dtor_list + 1 ; *fpp != 0 ; ++fpp )
-
(**fpp)() ;
-
}
-