
Recherche avancée
Autres articles (27)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
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 (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (7112)
-
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
-
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 :)


-
How to read frames of a video and write them on another video output using FFMPEG and nodejs
29 décembre 2023, par AviatoI am working on a project where I need to process video frames one at a time in Node.js. I aim to avoid storing all frames in memory or the filesystem due to resource constraints. I plan to use the ffmpeg from child processes for video processing.
I tried reading a video file and then output frames of it in the filesystem first for testing purposes :-


const ffmpegProcess = spawn('ffmpeg', [
 '-i', videoFile,
 'testfolder/%04d.png' // Output frames to stdout
]);



and the above code works fine, it saves the video frames as png files in the filesystem. Now instead of saving them in the file system, I want to read the frames on at a time and use a image manipulation library and than write the final edited frames to another video as output


I tried this :-


const ffmpegProcess = spawn('ffmpeg', [
 '-i', videoFile,
 'pipe:1' // Output frames to stdout
]);

const ffmpegOutputProcess = spawn('ffmpeg', [
 '-i', '-',
 'outputFileName.mp4'
 ]);

ffmpegProcess.stdout.on('data', (data) => {
 // Process the frame data as needed
 console.log('Received frame data:');
 ffmpegOutputProcess.stdin.write(data)
});

ffmpegProcess.on('close', (code) => {
 if (code !== 0) {
 console.error(`ffmpeg process exited with code ${code}`);
 } else {
 console.log('ffmpeg process successfully completed');
 
 }
});

// Handle errors
ffmpegProcess.on('error', (err) => {
 console.error('Error while spawning ffmpeg:', err);
});



But when I tried above code and also some other modifications in the input and output suffix in the command I got problems as below :-


- 

- ffmpeg process exited with code 1
- The final output video was corrupted when trying to initializing the filters for commands :-







const ffmpegProcess = spawn('ffmpeg', [
 '-i', videoFile,
 '-f', 'rawvideo',
 '-pix_fmt', 'rgb24',
 'pipe:1' // Output frames to stdout
]);

const ffmpegOutputCommand = [
 '-f', 'rawvideo',
 '-pix_fmt', 'rgb24',
 '-s', '1920x1080',
 '-r', '30',
 '-i', '-',
 '-c:v', 'libx264',
 '-pix_fmt', 'yuv420p',
 outputFileName
];



Thank you so much in advance :)