
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (50)
-
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
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 -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (7528)
-
How does one correctly avoid the avcodec_alloc_context3 leak from avformat_new_stream ?
14 avril 2017, par Tom SeddonThis maddening thread describes the problem I’m having : a memory leak on shutdown due to some stuff allocated when
avformat_new_stream
is called.Here’s the valgrind stack trace from the leak :
- 1,447 (1,440 direct, 7 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 4
- at 0x4C2FFC6 : memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
- by 0x4C300D1 : posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
- by 0x690DEFF : av_malloc (mem.c:87)
- by 0x690E09D : av_mallocz (mem.c:224)
- by 0x533D28A : init_context_defaults (options.c:128)
- by 0x533D325 : avcodec_alloc_context3 (options.c:164)
- by 0x663D09E : avformat_new_stream (utils.c:4384)
- by 0x4204B6 : main (test_ffmpeg.cpp:918)
So clearly the problem is that when a
AVFormatContext
’s stream’s codec context’spriv_data
field is somehow not being freed.My code frees the
AVFormatContext
withavformat_free_context
. This callsff_free_stream
, which callsfree_stream
, which frees a few of the stream’s codec context fields itself - but not thepriv_data
field !Compared and contrast with the corresponding code in
avcodec_close
.The suggested solution to the problem from the thread : "close the codec firstly before calling
av_format_free_context
". Presumably this refers to callingavcodec_free_context
? - but I’m already doing this ! Roughly following the structure in the muxing example, I have an encoder context created by my code, that’s used to track the uncompressed input data. Then there’s another encoder context created internally byavformat_new_stream
(as above), which is used internally by FFmpeg. I close the former, because it was opened usingavcodec_open2
, but I don’t close the latter, because it wasn’t. I am following the maddening thread’s advice, and yet here I am.Furthermore, reading between the lines, using
avcodec_free_context
to free theAVStream
’s codec context is no good anyway, because when doing this (a)AVStream
’scodec
field is deprecated, so this gives a bunch of warnings, and (b) there are noNULL
checks infree_stream
, so this crashes at runtime.What I have done for now is drag in the appropriate bit of code from
avcodec_close
, and put it in my own code just ahead of the call toavformat_free_context
:#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
for(unsigned i=0;inb_streams;++i) {
AVStream *st=avf_context->streams[i];
if(st->codec->priv_data&&
st->codec->codec&&
st->codec->codec->priv_class)
{
av_opt_free(st->codec->priv_data);
}
av_freep(&st->codec->priv_data);
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endifSo that fixes the leak, and it’s clearly (to my eyes) a bug, and I need to file a bug report or something.
However the corresponding bug report is marked as fixed and closed... along with a link back to the maddening thread, and no further explanation. (This is why it is maddening !) So maybe I’m just using FFmpeg wrongly ?
Can anybody confirm whether this is actually a bug in FFmpeg or not ?
If it isn’t a bug, what’s the right sequence of calls to make ?
(I’m using FFmpeg built locally from commit 03eb0515c12637dbd20c2e3ca8503d7b47cf583a. I had similar-looking problems with the one you get from the Ubuntu 16 package manager, which prompted me to build it myself with symbols and so on.)
-
Process is being paused until I close the program
27 mai 2017, par user924I made a simple program and UI for it.
It has one button for starting ffmpeg.exe to decode a video :button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ProcessBuilder pb = new ProcessBuilder("D:\\ffmpeg.exe", "-i", "\"D:\\video\\input.mp4\"", "\"output.mp4\"");
try {
Process p = pb.start();
} catch (IOException error) {
//
}
}
}The problem is that after clicking the button ffmpeg starts but it doesn’t do anything (in task manager it doesn’t use cpu - 0%) until I close the program (UI) and then ffmpeg process starts to decode a video (only after closing the program ffmpeg starts using cpu - e.g. 24%)
It’s not duplicate : older questions proposed by Andy Thomas doesn’t have an answer (solution) for my problem
-
how to add text to the video in android ?
4 octobre 2024, par Sajad NorouziIn my app I record a video and I wanna overlay the url of my company on the right bottom of that video. I record video with MediaRecorder and there is no problem with the recording, but for adding text to the video I haven't been successful. I searched and found some library like FFmpeg and JavaCV which let user overlay a text on the video but I don't know if there is any way for using them in Android. after that found OnPreviewFrame which returns each frame of the camerapreivew. I want to get all frames after user touch record button and draw text using canvas to each frame and then save all those frame together until recording video stops, and videos duration are fix and 15 seconds. Is it a good solution ? if it is, how should I implement OnPreviewFrame function ? I know how to draw canvas but I don't know how to convert data[] to the bitmap.