
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 (111)
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras. -
Que fait exactement ce script ?
18 janvier 2011, parCe script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
Installation de dépendances de MediaSPIP
Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...)
Sur d’autres sites (11664)
-
Merge commit ’458446acfa1441d283dacf9e6e545beb083b8bb0’
15 novembre 2013, par Michael NiedermayerMerge commit ’458446acfa1441d283dacf9e6e545beb083b8bb0’
* commit ’458446acfa1441d283dacf9e6e545beb083b8bb0’ :
lavc : Edge emulation with dst/src linesizeConflicts :
libavcodec/cavs.c
libavcodec/h264.c
libavcodec/hevc.c
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_motion.c
libavcodec/rv34.c
libavcodec/svq3.c
libavcodec/vc1dec.c
libavcodec/videodsp.h
libavcodec/videodsp_template.c
libavcodec/vp3.c
libavcodec/vp8.c
libavcodec/wmv2.c
libavcodec/x86/videodsp.asm
libavcodec/x86/videodsp_init.cChanges to the asm are not merged, they are left for volunteers or
in their absence for later.
The changes this merge introduces are reordering of the function
argumentsSee : face578d56c2d1375e40d5e2a28acc122132bc55
Merged-by : Michael Niedermayer <michaelni@gmx.at>- [DH] libavcodec/cavs.c
- [DH] libavcodec/diracdec.c
- [DH] libavcodec/h264.c
- [DH] libavcodec/hevc.c
- [DH] libavcodec/mpegvideo.c
- [DH] libavcodec/mpegvideo_enc.c
- [DH] libavcodec/mpegvideo_motion.c
- [DH] libavcodec/rv34.c
- [DH] libavcodec/snow.c
- [DH] libavcodec/svq3.c
- [DH] libavcodec/vc1dec.c
- [DH] libavcodec/videodsp.h
- [DH] libavcodec/videodsp_template.c
- [DH] libavcodec/vp3.c
- [DH] libavcodec/vp56.c
- [DH] libavcodec/vp8.c
- [DH] libavcodec/vp9.c
- [DH] libavcodec/wmv2.c
- [DH] libavcodec/x86/dsputil_mmx.c
- [DH] libavcodec/x86/videodsp_init.c
-
VLC RTSP HTML5 transcoding
30 mai 2022, par PierogiI'm trying to get audio streaming on an HTML page from an RTSP server.


The RTSP server is the rtsp-simple-server running a command line below.

./rtsp-simple-server rtsp-simple-server.yml
.

The configure file is the default.

The stream player is FFmpeg running a command line below.

ffmpeg -re -stream_loop -1 -i myaudio.mp3 -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/mystream


The console log at the time the rtsp-simple-server and the ffmpeg are started is below.


2022/05/29 19:06:38 INF rtsp-simple-server v0.18.4
2022/05/29 19:06:38 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2022/05/29 19:06:38 INF [RTMP] listener opened on :1935
2022/05/29 19:06:38 INF [HLS] listener opened on :8888
2022/05/29 19:09:16 INF [RTSP] [conn [::1]:62737] opened
2022/05/29 19:09:16 INF [RTSP] [session 271690815] created by [::1]:62737
2022/05/29 19:09:16 INF [RTSP] [session 271690815] is publishing to path 'mystream', 1 track with TCP



And the time the rtsp path(rtsp ://localhost:8554/mystream) is opened by VLC, the contents can be played properly. The additional console log at the time is below.


2022/05/29 19:13:19 INF [RTSP] [conn 127.0.0.1:62780] opened
2022/05/29 19:13:19 INF [RTSP] [session 734209460] created by 127.0.0.1:62780
2022/05/29 19:13:19 INF [RTSP] [session 734209460] is reading from path 'mystream', 1 track with UDP
2022/05/29 19:13:29 INF [RTSP] [session 734209460] destroyed (teared down by 127.0.0.1:62780)
2022/05/29 19:13:29 INF [RTSP] [conn 127.0.0.1:62780] closed (EOF)
2022/05/29 19:13:29 INF [RTSP] [conn 127.0.0.1:62781] opened
2022/05/29 19:13:29 INF [RTSP] [session 445756113] created by 127.0.0.1:62781
2022/05/29 19:13:29 INF [RTSP] [session 445756113] is reading from path 'mystream', 1 track with TCP



However, I open the rtsp streaming from the VLC's "Network" tab like below,



and configure the "Stream output" like below,



and I tried to get this streaming from an HTML page like below,




 
 
 
 
 
 <h1>transcode test</h1>
 <audio src="http://localhost:9999/mystream" autoplay="autoplay"></audio>
 




the browser console displays
Failed to load resource: the server responded with a status of 404 (Not found)
. I've already tried other ports(etc. 8080).

So, how can I get the rtsp stream from the RTSP server on an HTML page.
Any idea ?


My environment.


- 

- Browser : Microsoft edge
- OS : MacOS 11.6.5
- rtsp-simple-server : 0.18.4
- FFmpeg : 5.0.1
- VLC : 3.0.17.3












-
Why is the last frame not showing in an MP4 generated by libav ?
31 octobre 2023, par BenNote : I have a working example of the problem here.


I'm using the libav/ffmpeg API to generate an MP4 with the h264 codec. In my specific situation I'm generating the files with a max number of 2 "B" frames. I'm able to generate an Mp4 with the right number of frames so that a single, lone "B" frame is the very last frame being written. When this happens, the encoder sets that frame's packet to be discarded (I've verified this with ffprobe). The net result is that some players (say, when dropping the MP4 into Edge or Chrome) will display only n-1 total frames (ignoring the discarded packet). Other players, such as VLC, will play the full n frames (not ignoring the discarded packet). So, the result is inconsistent.


ffmpeg.exe itself doesn't appear to have this problem. Instead, it will set what would be the lone "B" frame to a "P" frame. This means the file will play the same regardless of what player is used.


The problem is : I don't know how to mimic ffmpeg's behavior using the SDK so the last frame will play regardless of the player. As far as I can tell I'm closing out the file properly by flushing out the encoder buffers. I must be doing something wrong somewhere.


I provided a link to the full source above, but at a high level I'm initializing the codec context and stream like this :


newStream->codecpar->codec_id = AV_CODEC_ID_H264;
newStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
newStream->codecpar->width = Width;
newStream->codecpar->height = Height;
newStream->codecpar->format = AV_PIX_FMT_YUV420P;
newStream->time_base = { 1, 75 };
avcodec_parameters_to_context(codecContext, newStream->codecpar);


codecContext->time_base = { 1, 75 };
codecContext->gop_size = 30;



I then sit in a loop and use OpenCV to generate frames (each frame has its frame number drawn on it) :


auto matrix = cv::Mat(Height, Width, CV_8UC3, cv::Scalar(0, 0, 0));

std::stringstream ss;
ss << f; 

cv::putText(matrix, ss.str().c_str(), textOrg, fontFace, fontScale, cv::Scalar(255, 255, 255), thickness, 8);



I then write out the frame like this (looping if more data is needed) :


if ((ret = avcodec_send_frame(codecContext, frame)) == 0) {

 ret = avcodec_receive_packet(codecContext, &pkt); 

 if (ret == AVERROR(EAGAIN))
 {
 continue; 
 }
 else
 {
 av_interleaved_write_frame(pFormat, &pkt);
 }
 av_packet_unref(&pkt);
}



And finally I flush out the file at the end like this :


if ((ret = avcodec_send_frame(codecContext, NULL)) == 0)
{
 for (;;)
 {
 if ((ret = avcodec_receive_packet(codecContext, &pkt)) == AVERROR_EOF)
 {
 break;
 }
 else
 {
 ret = av_interleaved_write_frame(pFormat, &pkt);
 av_packet_unref(&pkt);
 }
 }

 av_write_trailer(pFormat);
 avio_close(pFormat->pb);
}



Yet when I play in Chrome, the player ends on frame 6758,




And in VLC, the player ends on frame 6759.




What am I doing wrong ?