
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (79)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (5802)
-
rtmp : Set correct message stream id when writing as server
31 mars 2022, par Jonathan Murrayrtmp : Set correct message stream id when writing as server
rtmp_write is used both for writing outputs as a server. The
rt->listen flag determines which mode we're running in.Previously, when running as a server, the message stream id would
always be set to 0 for media/metadata messages. This is surprising
given that we have both responded to "createStream()" with a value
of 1 and sent a "Stream Begin 1" to the client. Furthermore, some
client libraries (Red5) seem to trip up on receiving
"@setDataFrame" on stream 0 (and may be correct to assume that
this message would be sent on stream 1). -
avcodec/aacenc : Correct option description for aac_coder fast
14 juillet 2024, par Marth64 -
How to improve the fluency of rtsp streaming through ffmpeg (processing 16 pictures at the same time)
21 décembre 2024, par Ling YunWhen the button is clicked, I create 16 threads in Qt, and then pass the rtsp data address and the label to be rendered to the process, and then the process does this :
run :



void rtspthread::run()
{

 while(!shouldStop){
 openRtspStream(rtspUrl.toUtf8().constData(),index);
 }

 qDebug() << "RTSP stream stopped.";
 emit finished(); 
}




open input stream :


void rtspthread::openRtspStream(const char* rtspUrl,int index)

{

 AVDictionary *options = nullptr;
 AVFrame *pFrameRGB = nullptr;
 uint8_t *pOutBuffer = nullptr;
 struct SwsContext *swsContext;
 AVFormatContext *pFormatCtx = nullptr;
 pFormatCtx = avformat_alloc_context();
 av_dict_set(&options, "rtsp_transport", "tcp", 0);
 av_dict_set(&options, "maxrate", "4000k", 0);
 if (avformat_open_input(&pFormatCtx, rtspUrl, nullptr, &options) != 0) {
 printf("Couldn't open stream file.\n");
 return;
 }

 if (avformat_find_stream_info(pFormatCtx, NULL)<0)
 {
 printf("Couldn't find stream information.\n");
 return;
 }
 int videoStreamIndex = -1;
 for (int i = 0; i < pFormatCtx->nb_streams; i++) {
 if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
 videoStreamIndex = i;
 break;
 }
 }
 if (videoStreamIndex!=-1){
 AVStream* videoStream = pFormatCtx->streams[videoStreamIndex];
 
 AVCodecParameters* codecpar = videoStream->codecpar;
 const AVCodec* videoCodec = avcodec_find_decoder(codecpar->codec_id);

 AVCodecContext* videoCodecContext = avcodec_alloc_context3(videoCodec);

 avcodec_parameters_to_context(videoCodecContext,codecpar);

 avcodec_open2(videoCodecContext,videoCodec,nullptr);

 AVPixelFormat srcPixFmt = videoCodecContext->pix_fmt;
 QLabel* label = this->parentWidget->findChild("videoLabel");
 int targetWidth = label->width();
 int targetHeight = label->height();
 
 pOutBuffer = (uint8_t*)av_malloc(av_image_get_buffer_size(AV_PIX_FMT_RGB32,
 videoCodecContext->width,
 videoCodecContext->height, 1));

 
 pFrameRGB = av_frame_alloc();
 av_image_fill_arrays(pFrameRGB->data, pFrameRGB->linesize, pOutBuffer,
 AV_PIX_FMT_RGB32, videoCodecContext->width, videoCodecContext->height, 1);


 swsContext= sws_getContext(
 videoCodecContext->width,videoCodecContext->height,srcPixFmt,
 targetWidth, targetHeight,AV_PIX_FMT_RGB32,
 SWS_BICUBIC,nullptr,nullptr,nullptr
 );
 
 AVPacket packet;
 AVFrame* frame = av_frame_alloc();
 int frameCounter = 0;
 while (av_read_frame(pFormatCtx, &packet) >= 0) {
 if (shouldStop) {
 break;
 }
 if (packet.stream_index == videoStreamIndex) {
 
 int ret = avcodec_send_packet(videoCodecContext,&packet);
 int rets = avcodec_receive_frame(videoCodecContext, frame);
 if (rets < 0) {
 qDebug() << "Error receiving frame from codec context";
 }
 
 sws_scale(swsContext, frame->data, frame->linesize, 0, videoCodecContext->height,
 pFrameRGB->data, pFrameRGB->linesize);

 
 QImage img(pFrameRGB->data[0], targetWidth, targetHeight,
 pFrameRGB->linesize[0], QImage::Format_RGB32);
 
 qDebug() << index;

 emit frameReady(img.copy(),index);


 QThread::msleep(30); // 控制帧率
 }
 av_packet_unref(&packet);

 }
 av_frame_free(&frame);
 av_frame_free(&pFrameRGB);
 sws_freeContext(swsContext);
 avcodec_free_context(&videoCodecContext);
 avformat_close_input(&pFormatCtx);
 avformat_free_context(pFormatCtx);

 }


}




The video is stuck and has snow screen. I want to lower the resolution and reduce the snow screen. The server cannot change the resolution.