
Recherche avancée
Autres articles (106)
-
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 -
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 (...) -
La gestion des forums
3 novembre 2011, parSi les forums sont activés sur le site, les administrateurs ont la possibilité de les gérer depuis l’interface d’administration ou depuis l’article même dans le bloc de modification de l’article qui se trouve dans la navigation de la page.
Accès à l’interface de modération des messages
Lorsqu’il est identifié sur le site, l’administrateur peut procéder de deux manières pour gérer les forums.
S’il souhaite modifier (modérer, déclarer comme SPAM un message) les forums d’un article particulier, il a à sa (...)
Sur d’autres sites (8379)
-
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.


-
Error submitting packet to decoder : Invalid data found when processing input FFMPG Python
14 janvier, par ilavarasanMy code outputs the following error while I read a .wav file using ffmpeg python.
Could someone please advise.


import ffmpeg
import subprocess
def find_corrupt_frames(mxf_file_path) :
corrupt_frames = []
command = [
'ffmpeg',
'-v', 'error', # Show only error messages
'-i', mxf_file_path, # Input file
'-f', 'null', # Output format (null for no actual output)
'-' # Use dash to indicate no output file
]


try:
 # Execute the ffmpeg command
 process = subprocess.run(command, capture_output=True, text=True)

 # Parse the error messages to find corrupt frames
 if process.stderr:
 for line in process.stderr.split('\n'):
 if 'error' in line.lower():
 print(f"Error found: {line}")
 # Extract frame information from the error message
 if 'fr ame=' in line:
 frame_info = line.split('frame=')[1].split()[0]
 corrupt_frames.append(int(frame_info))
except Exception as e:
 print(f"Failed to process MXF file: {e}")

return corrupt_frames



mxf_file_path = '\X1\Users13$\ijayaram\Down\f1.wav'
corrupt_frames = find_corrupt_frames(mxf_file_path)
if corrupt_frames :
print(f"Corrupt frames found at indices : corrupt_frames")
else :
print("No corrupt frames found.")


-
lsws/ppc/yuv2rgb_altivec : Fix build in non-VSX environments with Clang
18 août 2023, par Brad Smith