
Recherche avancée
Autres articles (88)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
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
Sur d’autres sites (6339)
-
FPV-Camera Input in Black and White / losses Color on conversion with FFMPEG [closed]
22 décembre 2023, par LyffLyffso we're working on our end-of-school project and it's an FPV-Drone with an Analogue Camera on it. Plan is to send the video feed to a Raspberry Pi running an RTMP-Server from where a Phone-Application can view the live Video of the camera.


To convert this analogue Data from the camera we use a USB2.0 Grabber (this one).


To create the RTMP Stream from the converted USB-Input we use FFMPEG with the following command :




fmpeg -f v4l2 -input_format yuyv422 -i /dev/video0 -c:v libx264 -crf 20 -preset ultrafast -b:v 2000k -fflags nobuffer -rtmp_live live -f flv rtmp ://192.168.8.107:554/live/stream




It works fine, but the main problems at the moment are :


- 

- the video is in Black and White
B&W Image Stream
- the stream has a delay of 10-20s depending on the network






When I'm using the official Software provided by the Reseller I had the same problem, but as soon as it set PAL/BDGHI in the Settings the colour was shown correctly :


Settings and Color Image in official software


the video is in Black and White


Does anyone know what settings there are to correctly decode the feed from the Camera and send the video with the colour over RTMP ? I don't know if this is the right place to ask this question, but I'm running out of ideas and every single decoder I have tried apart from the ones I'm currently using does not work.


Any help is greatly appreciated :)


-
Single-threaded demuxer with FFmpeg API
7 décembre 2023, par yaskovdevI am trying to create a demuxer using FFmpeg API with the next interface :


interface IDemuxer
{
 void WriteMediaChunk(byte[] chunk);

 byte[] ReadAudioOrVideoFrame();
}



The plan is to use it in a single thread like this :


IDemuxer demuxer = new Demuxer();

while (true)
{
 byte[] chunk = ReceiveNextChunkFromInputStream();
 
 if (chunk.Length == 0) break; // Reached the end of the stream, exiting.
 
 demuxer.WriteMediaChunk(chunk);
 
 while (true)
 {
 var frame = demuxer.ReadAudioOrVideoFrame()

 if (frame.Length == 0) break; // Need more chunks to produce the frame. Let's add more chunks and try produce it again.

 WriteFrameToOutputStream(frame);
 }
}



I.e., I want the demuxer to be able to notify me (by returning an empty result) that it needs more input media chunks to produce the output frames.


It seems like FFmpeg can read the input chunks that I send to it using the read callback.


The problem with this approach is that I cannot handle a situation when more input chunks are required using only one thread. I can handle it in 3 different ways in the read callback :


- 

- Simply be honest that there is no data yet and return an empty buffer to FFmpeg. Then add more data using
WriteMediaChunk()
, and then retryReadAudioOrVideoFrame()
. - Return
AVERROR_EOF
to FFmpeg to indicate that there is no data yet. - Block the thread and do not return anything. Once the data arrives, unblock the thread and return the data.








But all these options are far from ideal :


The 1st one leads to FFmpeg calling the callback again and again in an infinite loop hoping to get more data, essentially blocking the main thread and not allowing me to send the data.


The 2nd leads to FFmpeg stopping the processing at all. Even if the data appears finally, I won't be able to receive more frames. The only option is to start demuxing over again.


The 3rd one kind of works, but then I need at least 2 threads : first is constantly putting new data to a queue, so that FFmpeg could then read it via the callback, and the second is reading the frames via
ReadAudioOrVideoFrame()
. The second thread may occasionally block if the first one is not fast enough and there is no data available yet. Having to deal with multiple threads makes implementation and testing more complex.

Is there a way to implement this using only one thread ? Is the read callback even the right direction ?


- Simply be honest that there is no data yet and return an empty buffer to FFmpeg. Then add more data using
-
When MP4 files encoded with H264 are set to slices=n, where can I find out how many slices the current NALU is ?
17 novembre 2023, par Gaowan LiangI am doing an experiment on generating thumbnails for web videos. I plan to extract I-frames from the binary stream by simulating the working principle of the decoder, and add the PPS and SPS information of the original video to form the H264 raw information, which is then handed over to ffmpeg to generate images. I have almost solved many problems, and even wrote a demo to implement my function, but I can't find any information about where there is an identifier when multiple NALUs form one frame (strictly speaking, there is a little, but it can't solve my problem, I will talk about it later).


You can use the following command to generate the type of video I mentioned :


ffmpeg -i input.mp4 -c:v libx264 -x264-params slices=8 output.mp4



This will generate a video with 8 slices per frame. Since I will use this file later, I will also generate the H264 raw information file with the following command :


ffmpeg -i output.mp4 -vcodec copy -an output.h264



When I put it into the analysis program, I can see multiple IDR NALUs connected together, where the first_mb_in_slice in the Slice Header of the non-first IDR NALU is not 0 :



But when I go back to the mdat in MP4 and look at the NALU, all the first_mb_in_slice become 0 :



0x9a= 1001 1010, according to the exponential Golomb coding, first_mb_in_slice == 0( ueg(1B) == 0 ), slice_type == P frame (ueg(00110B) == 5), but using the same algorithm in the H264 raw file, the result is the same as the program gives.


Is there any other place where there is an identifier for this information ? Assuming I randomly get a NALU, can I know if this video is sliced or not, or is my operation wrong ?


PS : Putting only one NALU into the decoder is feasible, but only 1/8 of the image can be parsed



If you need a reference, the address of the demo program I wrote is : https://github.com/gaowanliang/web-video-thumbnailer