
Recherche avancée
Autres articles (58)
-
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Soumettre bugs et patchs
10 avril 2011Un logiciel n’est malheureusement jamais parfait...
Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
Si vous pensez avoir résolu vous même le bug (...) -
Installation en mode standalone
4 février 2011, parL’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
[mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)
Sur d’autres sites (7142)
-
How to grab ffmpeg's output as binary and write it to a file on the fly such that video players can play it in real time ?
29 décembre 2022, par Mister MystèreI want to stream a RTSP-streaming device to a video player such as VLC but the catch is that, in between, the binary data needs to go through a custom high-speed serial link. I control what goes in this link from a C++ program.


I was happily surprised to see that the following line allowed me to watch the RTSP stream by just opening "out.bin" from VLC which was a good lead for fast and efficient binary transmission of the stream :


ffmpeg -i "rtsp://admin:password@X.X.X.X:554/h264Preview_01_main" -c:v copy -c:a copy -f mpegts out.bin



I already wondered how ffmpeg manages to allow VLC to read that file, while itself writing to it at the same time. Turns out I was right to wonder, see below.


I told myself I could make this command pipe its output to the standard output, and then in turn pipe the standard output to a file that I can read, (later, slice it, transmit the chunks and reconstruct it) and then write to an output file. However, this does not work :


#include 
#include 
#include 

#define BUFSIZE 188 //MPEG-TS packet size

int main()
{
 char *cmd = (char*)"ffmpeg -i \"rtsp://admin:password@X.X.X.X:554/h264Preview_01_main\" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet";
 char buf[BUFSIZE];
 FILE *ptr, *file;

 file = fopen("./out.bin", "w");

 if (!file)
 {
 printf("Failed to open output file for writing, aborting");
 abort();
 }

 if ((ptr = popen(cmd, "r")) != NULL) {
 printf("Writing RTSP stream to file...");

 while (!kbhit())
 {
 if(fread(&buf, sizeof(char), BUFSIZE, ptr) != 0)
 {
 fwrite(buf, sizeof(char), BUFSIZE, file);
 }
 else
 {
 printf("No data\n");
 }
 }
 pclose(ptr);
 }
 else
 {
 printf("Failed to open pipe from ffmpeg command, aborting");
 }

 printf("End of program");

 fclose(file);
 return 0;
}



Since VLC says "your input can't be opened" - whereas this works just fine :


ffmpeg -i "rtsp://admin:password@X.X.X.X:554/h264Preview_01_main" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet > out.bin



This is what ends up in the file after I close the program, versus the result of the command immediately above :



The file is always 2kB regardless of how long I run the program : "No data" is shown repeatedly in the console output.


Why doesn't it work ? If it is not just a bug, how can I grab the stream as binary at some point, and write it at the end to a file that VLC can read ?


Update


New code after applying Craig Estey's fix to my stupid mistake. The end result is that the MPEG-TS frames don't seem to shift anymore but the file writing stops partway into one of the first few frames (the console only shows a few ">" symbols and then stays silent, c.f. code).


#include 
#include 
#include 

#define BUFSIZE 188 // MPEG-TS packet size

int
main()
{
 char *cmd = (char *) "ffmpeg -i \"rtsp://127.0.0.1:8554/test.sdp\" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet";
 char buf[BUFSIZE];
 FILE *ptr,
 *file;

 file = fopen("./out.ts", "w");

 if (!file) {
 printf("Failed to open output file for writing, aborting");
 abort();
 }

 if ((ptr = popen(cmd, "r")) != NULL) {
 printf("Writing RTSP stream to file...");

 while(!kbhit()) {
 ssize_t rlen = fread(&buf, sizeof(char), BUFSIZE, ptr);
 if(rlen != 0)
 {
 printf(">");
 fwrite(buf, sizeof(char), rlen, file);
 fflush(file);
 }
 }
 pclose(ptr);
 }
 else {
 printf("Failed to open pipe from ffmpeg command, aborting");
 }

 printf("End of program");

 fclose(file);
 return 0;
}



This can be tested on any computer with VLC and a webcam : open VLC, open capture device, capture mode directshow, (switch "play" for "stream"), next, display locally, select RTSP, Add, path=/test.sdp, next, transcoding=H264+MP3 (TS), replace rtsp ://:8554/ with rtsp ://127.0.0.1:8554/ in the generated command line, stream.


To test that streaming is ok, you can just open a command terminal and enter "ffmpeg -i "rtsp ://127.0.0.1:8554/test.sdp" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet", the terminal should fill up with binary data.


To test the program, just compile, run, and open out.ts after the program has run.


-
How the ffmpeg is fixing Handle page termination with same page number ...? [closed]
11 avril 2024, par adarshIm working on the teletext subtitle feature and faced with subs not clearing issue.
the subtitle lines remain displayed until being replaced by a new version of the specific line. So the subtitles never disappear and often an old line is still displayed, after another, more recent line is displayed/updated.
take a look at the issue in this sample video file : https://code.videolan.org/videolan/vlc/uploads/58c2e1660e94e2df5e8cdb75edf531d9/GODFATHER__03_.ts
Issue reported : https://sourceforge.net/p/zapping/bugs/203/


The player is using ffmpeg and libzvbi library.


At first I suspected that the Erase Page Flag (C4) in the Page Header was not set, but the flag was indeed set (at least once between two LOPs with subtitles). After further debugging it turned out that the Teletext service in the two issues consists of just a single Teletext page - which is the reason here :


The Teletext spec defines the Magazine Serial Flag (C11) in Table 2 (ETSI EN 300 706 v1.2.1) as (bold font by me) :


When set to '1' the service is designated to be in Serial mode and the transmission of a page is terminated by the next page header with a different page number.
When set to '0' the service is designated to be in Parallel mode and the transmission of a page is terminated by the next page header with a different page number but the same magazine number.
The same setting shall be used for all page headers in the service.
(BTW it doesn't really matter, but in these two cases this flag is always 0)


In vbi_decode_teletext in /src/packet.c, storing the page is aborted, if the condition "page terminated" in the C11 definition is not met. But as the service here consists of only one page, this condition is never met !


Luckily, this issue was fixed in ffmpeg- https://github.com/FFmpeg/FFmpeg/commit/b1e0e216462a989a39e7b413aef6d32f8cedc154


and also in zvbi :
https://github.com/zapping-vbi/zvbi/commit/40a6ab0200c46b67b059b5b1fb15793ce780892a


I understand the root cause and fix in zvbi library, and how it is ignoring c4 flag in case the same page no.


But i want to understand how the ffmpeg fix is working ?
ffmpeg fix : https://github.com/FFmpeg/FFmpeg/commit/b1e0e216462a989a39e7b413aef6d32f8cedc154


what is the rule for repeated page headers ?


-
Is there a way to change the ffplay playback speed while running
20 mai 2024, par richjhartI am trying to modify ffplay 7.0 to allow us to modify the playback speed while running. Our use-case only involves basic video-only mp4 files.


We can set the playback speed with something like the following :


ffplay -i ..\Video\SampleVideoLong.mp4 -vf "setpts=5.0*PTS" -loglevel debug -sync video


But I don't know how to change that option "live" (note if I don't choose
-sync video
, it gets very laggy - but that's fine as our use-case is video only.

I have tried the following (with just a fixed rate at the moment) :


{
 static double l_CurrentSpeed = 1.0;
 double l_NewSpeed = 2.0;
 double l_Diff = l_NewSpeed / l_CurrentSpeed;
 double l_ClockSpeed = cur_stream->extclk.speed;
 double l_NewClockSpeed = l_ClockSpeed * l_Diff;
 av_log(NULL, AV_LOG_DEBUG,
 "Changing speed from %f to %f\n",
 l_ClockSpeed, l_NewClockSpeed
 );

 set_clock_speed(&cur_stream->vidclk, l_NewClockSpeed);
 //set_clock(&cur_stream->vidclk, l_NewClockSpeed, cur_stream->extclk.serial);
 l_CurrentSpeed = l_NewSpeed;
 }



I've set both the pts (
set_clock()
) and the "speed" (set_clock_speed()
), but neither of these had any effect.

Would I need to something extra, or is there a way to update the
setpts
expression in the video filter from ffplay ?

Note the metadata of the file we are trying with is :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '..\Video\SampleVideoLong.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf61.1.100
 Duration: 00:18:10.56, start: 0.160000, bitrate: 1755 kb/s
 Stream #0:0[0x1](und), 1, 1/90000: Video: mpeg2video (Main), 1 reference frame (mp4v / 0x7634706D), yuv420p(tv, bt709, progressive, left), 1920x1080 [SAR 1:1 DAR 16:9], 0/1, 1754 kb/s, 25 fps, 25 tbr, 90k tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 encoder : XDCAM EX 1080p25
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 278528 vbv_delay: N/A



I believe the files we'll be using should have identical or similar metadata.