
Recherche avancée
Autres articles (70)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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 (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (10992)
-
FFMPEG UDP MPEG2TS to Cable TV Channel - Video & Audio Problems
30 janvier 2019, par user2884023$ ffmpeg
-re
-i playlist1.txt
-b:v 15000k
-bufsize 15000k
-maxrate 16000k
-f mpegts "udp://XXX.XXX.X.XXX:XXXX"I have
mpeg2.ts
files encoded to CBR15mbs.
The files are set to different frame rates. Although initial testing was just playing 1 file.
They are currently 1080p I think without declaring the frame rate, they are defaulting to 30fps.
From the server locally via Port2 (that we are using to send our feed), everything plays fine viaFFPLAY
.
The final out put localCATV
is pixelated and distorted, the video is missing data playing slowly and the audio is choppy / distorted.
I even tried just a 192kps .mp2 and it played distorted on theCATV
channel.
They set me up with a cable modem. 2 ports, 1 WAN, 1 a dedicated port to feed their head end and I have a fiber synchronous 20/20 connection.I am guessing its a packet issue, perhaps on our end with our
FFMPEG
setup ? And maybeFFPLAY
isn’t as sensitive to the actual distro process.Perhaps the secret lies here, but there isn’t much info about them, even scouring the net.
?pkt_size=188&buffer_size=65535
For example what is this one :
broadcast=1|0
Explicitly allow or disallow UDP broadcasting.
I apologize if data is missing, please ask questions. I didn’t want to write a novel.
I am hoping some can provide the correct code so my signal is corrected. I assume the problem is on our end, and not the
CATV
end. At least I can try some solutions on our end first. I can make real-timeFFMPEG
changes to the server, and see the channel results instantly so that helps.Finally, the fact it wouldn’t even play a .mp2 audio file cleanly on the channel, does make me wonder, is there a problem on their end, or is it a config on our end, and we just need the correct answer ?
-
ffmpeg/libavcodec memory management
23 juillet 2015, par Jason CThe libavcodec documentation is not very specific about when to free allocated data and how to free it. After reading through documentation and examples, I’ve put together the sample program below. There are some specific questions inlined in the source but my general question is, am I freeing all memory properly in the code below ? I realize the program below doesn’t do any cleanup after errors — the focus is on final cleanup.
The testfile() function is the one in question.
extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
}
#include <cstdio>
using namespace std;
void AVFAIL (int code, const char *what) {
char msg[500];
av_strerror(code, msg, sizeof(msg));
fprintf(stderr, "failed: %s\nerror: %s\n", what, msg);
exit(2);
}
#define AVCHECK(f) do { int e = (f); if (e < 0) AVFAIL(e, #f); } while (0)
#define AVCHECKPTR(p,f) do { p = (f); if (!p) AVFAIL(AVERROR_UNKNOWN, #f); } while (0)
void testfile (const char *filename) {
AVFormatContext *format;
unsigned streamIndex;
AVStream *stream = NULL;
AVCodec *codec;
SwsContext *sws;
AVPacket packet;
AVFrame *rawframe;
AVFrame *rgbframe;
unsigned char *rgbdata;
av_register_all();
// load file header
AVCHECK(av_open_input_file(&format, filename, NULL, 0, NULL));
AVCHECK(av_find_stream_info(format));
// find video stream
for (streamIndex = 0; streamIndex < format->nb_streams && !stream; ++ streamIndex)
if (format->streams[streamIndex]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
stream = format->streams[streamIndex];
if (!stream) {
fprintf(stderr, "no video stream\n");
exit(2);
}
// initialize codec
AVCHECKPTR(codec, avcodec_find_decoder(stream->codec->codec_id));
AVCHECK(avcodec_open(stream->codec, codec));
int width = stream->codec->width;
int height = stream->codec->height;
// initialize frame buffers
int rgbbytes = avpicture_get_size(PIX_FMT_RGB24, width, height);
AVCHECKPTR(rawframe, avcodec_alloc_frame());
AVCHECKPTR(rgbframe, avcodec_alloc_frame());
AVCHECKPTR(rgbdata, (unsigned char *)av_mallocz(rgbbytes));
AVCHECK(avpicture_fill((AVPicture *)rgbframe, rgbdata, PIX_FMT_RGB24, width, height));
// initialize sws (for conversion to rgb24)
AVCHECKPTR(sws, sws_getContext(width, height, stream->codec->pix_fmt, width, height, PIX_FMT_RGB24, SWS_FAST_BILINEAR, NULL, NULL, NULL));
// read all frames fromfile
while (av_read_frame(format, &packet) >= 0) {
int frameok = 0;
if (packet.stream_index == (int)streamIndex)
AVCHECK(avcodec_decode_video2(stream->codec, rawframe, &frameok, &packet));
av_free_packet(&packet); // Q: is this necessary or will next av_read_frame take care of it?
if (frameok) {
sws_scale(sws, rawframe->data, rawframe->linesize, 0, height, rgbframe->data, rgbframe->linesize);
// would process rgbframe here
}
// Q: is there anything i need to free here?
}
// CLEANUP: Q: am i missing anything / doing anything unnecessary?
av_free(sws); // Q: is av_free all i need here?
av_free_packet(&packet); // Q: is this necessary (av_read_frame has returned < 0)?
av_free(rgbframe);
av_free(rgbdata);
av_free(rawframe); // Q: i can just do this once at end, instead of in loop above, right?
avcodec_close(stream->codec); // Q: do i need av_free(codec)?
av_close_input_file(format); // Q: do i need av_free(format)?
}
int main (int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "usage: %s filename\n", argv[0]);
return 1;
}
testfile(argv[1]);
}
</cstdio>Specific questions :
- Is there anything I need to free in the frame processing loop ; or will libav take care of memory management there for me ?
- Is
av_free
the correct way to free anSwsContext
? - The frame loop exits when
av_read_frame
returns < 0. In that case, do I still need toav_free_packet
when it’s done ? - Do I need to call
av_free_packet
every time through the loop or willav_read_frame
free/reuse the oldAVPacket
automatically ? - I can just
av_free
theAVFrame
s at the end of the loop instead of reallocating them each time through, correct ? It seems to be working fine, but I’d like to confirm that it’s working because it’s supposed to, rather than by luck. - Do I need to
av_free(codec)
theAVCodec
or do anything else afteravcodec_close
on theAVCodecContext
? - Do I need to
av_free(format)
theAVFormatContext
or do anything else afterav_close_input_file
?
I also realize that some of these functions are deprecated in current versions of libav. For reasons that are not relevant here, I have to use them.
-
Revision 32970 : On progresse doucement mais surement.
15 novembre 2009, par vxl@… — LogOn progresse doucement mais surement.