
Recherche avancée
Autres articles (112)
-
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) (...)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
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 (...)
Sur d’autres sites (5872)
-
Livestream not reaching AWS endpoint
13 août 2024, par NoobAmII'm trying to stream my live video into Amazon IVS and I don't see it on the live channels.


Is it possible I have a mistake in my FFMPEG configuration ?
I'm expecting to see this in my playback url or on the console screen for playback but I see nothing at the moment.


As I understand it, shouldn't I see some kind of playback in the live channels if a stream is being sent that channel ?


async ivsStreamingService(payload: any): Promise<void> {
 const injestServer = '***.global-contribute.live-video.net:443/app/';
 const streamKey = 'sk_us-east-1_*****';
 const ffmpeg = spawn('ffmpeg', [
 '-re',
 '-i', '-',
 '-r', '30',
 '-c:v', 'libx264',
 '-pix_fmt', 'yuv420p',
 '-profile:v', 'main',
 '-preset', 'veryfast',
 '-x264opts', 'nal-hrd=cbr:no-scenecut',
 '-minrate', '3000k',
 '-maxrate', '3000k',
 '-g', '60',
 '-c:a', 'aac',
 '-b:a', '160k',
 '-ac', '2',
 '-ar', '44100',
 '-f', 'flv',
 `rtmps://${ingestServer}${streamKey}`
 ]);
 
 ffmpeg.stdin.write(payload, (err) => {
 console.log(payload)
 if (err) console.error('Error writing payload to FFmpeg stdin:', err);
 });
 
 ffmpeg.on('close', (code) => {
 console.log(`FFmpeg process exited with code ${code}`);
 });
 
 ffmpeg.stdin.on('error', (err) => {
 console.error('Error writing to FFmpeg stdin:', err);
 });
 
 ffmpeg.stderr.on('data', (data) => {
 console.error(`FFmpeg error: ${data}`);
 });
 }
</void>




I'm not quite sure why it wouldn't receive the stream, as it would appear everything is correct.


-
ffmpeg remote url not working in lambda function
9 septembre 2024, par KomalI have created lambda function to trim video.


I run this command :


/opt/bin/ffmpeg -protocol_whitelist file,http,https,tcp,tls -i 'https://source-bucket.s3.amazonaws.com/1.mp4' -ss 5 -t 10 -loglevel 48 -y -avoid_negative_ts 1 -acodec copy /tmp/output.mp4



It gives following output :


"ffmpeg version 7.0.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2024 the FFmpeg developers\n built with gcc 8 (Debian 8.3.0-6)\n configuration: --enable-gpl --enable-version3
--enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg\n libavutil 59. 8.100 / 59. 8.100\n libavcodec 61. 3.100 / 61. 3.100\n libavformat 61. 1.100 / 61. 1.100\n libavdevice 61. 1.100 /
61. 1.100\n libavfilter 10. 1.100 / 10. 1.100\n libswscale 8. 1.100 / 8. 1.100\n libswresample 5. 1.100 / 5. 1.100\n libpostproc 58. 1.100 / 58. 1.100\nSplitting the commandline.\nReading option '-protocol_whitelist' ... matched as AVOption 'protocol_whitelist' with argument 'file,http,https,tcp,tls'.\nReading option '-i' ... matched as input url with argument 'https://source-bucket.s3.amazonaws.com/1.mp4'.\nReading option '-ss' ... matched as option 'ss' (start transcoding at specified time) with argument '50'.\nReading option '-t' ... matched as option 't' (stop transcoding after specified duration) with argument '100'.\nReading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '48'.\nReading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.\nReading option '-avoid_negative_ts' ... matched as AVOption 'avoid_negative_ts' with argument '1'.\nReading option '-acodec' ... matched as option 'acodec' (alias for -c:a (select encoder/decoder for audio streams)) with argument 'copy'.\nReading option '/tmp/output.mp4' ... matched as output url.\nFinished splitting the commandline.\nParsing a group of options: global .\nApplying option loglevel (set logging level) with argument 48.\nApplying option y (overwrite output files) with argument
1.\nSuccessfully parsed a group of options.\nParsing a group of options: input url https://source-bucket.s3.amazonaws.com/1.mp4.\nSuccessfully parsed a group of options.\nOpening an input file: https://source-bucket.s3.amazonaws.com/1.mp4.\n[AVFormatContext @ 0x70ea0c0] Opening 'https://source-bucket.s3.amazonaws.com/1.mp4' for reading\n"



So, its not going beyond this : 'Opening 'https://source-bucket.s3.amazonaws.com/1.mp4' ; for reading\n'


And after this, it immediately gets out. Need suggestions, where its going wrong. Same command working fine on local computer.


I tried cloudfront and signed url as well, as mentioned in this post : How to read remote video on Amazon S3 using ffmpeg. But it doesnt work with url. Only working when downloaded into tmp folder.


Following is the final log, which you can see is no timeout. It actually finish function execution within 2-3 seconds. I have timeout set for 15 mins to the function which is maximum :



REPORT RequestId: 4acd7b38-017c-4dce-bb65-8f6fd3cf37e0 Duration: 1297.93 ms Billed Duration: 1298 ms Memory Size: 1024 MB Max Memory Used: 103 MB Init Duration: 328.76 ms 



-
Record video stream in rust
19 novembre 2024, par El_LocoI have bought a stereo camera with global shutter and a frame rate of at most 120 fps. https://www.amazon.com/dp/B0D8T3ZSL4?ref_=pe_386300_442618370_TE_sc_as_ri_0#


My next step is to write a program that can show and record a video with desired fps and resolution.


use opencv::{
 core, highgui,
 prelude::*,
 videoio::{self, VideoCapture},
 Result,
};

fn open_camera() -> Result<videocapture> {
 let capture = videoio::VideoCapture::new(2, videoio::CAP_ANY)?;
 return Ok(capture);
}
fn main() -> Result<()> {
 let window = "video capture";
 highgui::named_window(window, highgui::WINDOW_AUTOSIZE)?;
 let mut cam = open_camera()?;
 let opened = videoio::VideoCapture::is_opened(&cam)?;
 if !opened {
 panic!("Unable to open default camera!");
 }
 let width = 3200.0;
 let height = 1200.0;
 cam.set(videoio::CAP_PROP_FRAME_WIDTH, width)?;
 cam.set(videoio::CAP_PROP_FRAME_HEIGHT, height)?;

 // Set the frame rate (FPS)
 let fps = 60.0;
 
 let fourcc = videoio::VideoWriter::fourcc('M', 'J', 'P', 'G')?;
 let mut writer = videoio::VideoWriter::new(
 "video_output.avi",
 fourcc,
 fps,
 core::Size::new(width as i32, height as i32),
 true,
 )?;

 if !writer.is_opened()? {
 println!("Error: Could not open the video writer.");
 }

 let mut frame = core::Mat::default();
 let mut ctr = 0;
 while cam.read(&mut frame)? {
 if frame.empty() {
 break;
 }
 writer.write(&frame)?;
 highgui::imshow(window, &frame)?;
 
 let key = highgui::wait_key(1)?;
 if key > 0 {
 break;
 }
 ctr += 1;
 if ctr == 600 {
 break;
 }
 }
 cam.release()?;
 writer.release()?;
 Ok(())
}
</videocapture>


When I run this code the frame rate is terrible. Like 1 fps or something. For debugging I tried to run in cheese. There I got 30 fps with full resolution
3200x1200
. But I cannot change the fps to 60 fps what I can see.

Then I tried to capture a video using ffmpeg :


ffmpeg -f v4l2 -framerate 60 -video_size 3200x1200 -i /dev/video2 output.mp4


With the following output :


[video4linux2,v4l2 @ 0x5a72cbbd1400] The driver changed the time per frame from 1/60 to 1/2
Input #0, video4linux2,v4l2, from '/dev/video2':
 Duration: N/A, start: 2744.250608, bitrate: 122880 kb/s
 Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 3200x1200, 122880 kb/s, 2 fps, 2 tbr, 1000k tbn
File 'output.mp4' already exists. Overwrite? [y/N]



The frame rate is lowered to 2 fps.


Then I tried to run
v4l2-ctl --list-formats-ext -d 2
with the following output :

ioctl: VIDIOC_ENUM_FMT
 Type: Video Capture

 [0]: 'MJPG' (Motion-JPEG, compressed)
 Size: Discrete 3200x1200
 Interval: Discrete 0.017s (60.000 fps)
 Interval: Discrete 0.033s (30.000 fps)
 Interval: Discrete 0.040s (25.000 fps)
 Interval: Discrete 0.050s (20.000 fps)
 Interval: Discrete 0.067s (15.000 fps)
 Interval: Discrete 0.100s (10.000 fps)
 Size: Discrete 2560x720
 Interval: Discrete 0.017s (60.000 fps)
 Interval: Discrete 0.033s (30.000 fps)
 Interval: Discrete 0.040s (25.000 fps)
 Interval: Discrete 0.050s (20.000 fps)
 Interval: Discrete 0.067s (15.000 fps)
 Interval: Discrete 0.100s (10.000 fps)
 Size: Discrete 1600x600
 Interval: Discrete 0.008s (120.000 fps)
 Interval: Discrete 0.017s (60.000 fps)
 Interval: Discrete 0.033s (30.000 fps)
 Interval: Discrete 0.040s (25.000 fps)
 Interval: Discrete 0.050s (20.000 fps)
 Interval: Discrete 0.067s (15.000 fps)



I then tried to open the camera using
qv4l
and there it seemed to work. Does not seem like I can record a video though.

I am using Rust to learn. I want to be able to programmatically be able to record a video somehow and then do computer vision. The easiest would be to do it in Rust. But other solutions are ok.


Edit
I have found some more this morning :


v4l2-ctl -d 2 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
 Type: Video Capture

 [0]: 'MJPG' (Motion-JPEG, compressed)
 Size: Discrete 3200x1200
 Interval: Discrete 0.017s (60.000 fps)
 Interval: Discrete 0.033s (30.000 fps)
 Interval: Discrete 0.040s (25.000 fps)
 Interval: Discrete 0.050s (20.000 fps)
 Interval: Discrete 0.067s (15.000 fps)
 Interval: Discrete 0.100s (10.000 fps)

 [1]: 'YUYV' (YUYV 4:2:2)
 Size: Discrete 3200x1200
 Interval: Discrete 0.500s (2.000 fps)
 Size: Discrete 2560x720
 Interval: Discrete 0.500s (2.000 fps)
 Size: Discrete 1600x600
 Interval: Discrete 0.100s (10.000 fps)



I also found here that order of flags was important for
ffmpeg
. Running this I can actually record a video with 60 fps :

ffmpeg -framerate 60 -f v4l2 -video_size 3200x1200 -input_format mjpeg -i /dev/video2 output.avi


A drawback is that the images does not look very sharp. You can clearly see the pixels. (I am new to video formats etc as well. Before it has just worked.)


If I change from
avi
tomkv
it is slow again.

In the link above I also saw a suggestion to first do :


ffmpeg -framerate 60 -f v4l2 -video_size 3200x1200 -input_format mjpeg -i /dev/video2 -c copy mjpeg.mkv


and then :


ffmpeg -i mjpeg.mkv -c:v libx264 -crf 23 -preset medium -pix_fmt yuv420p out.mkv


which worked. But I am not sure those flags are ideal for the camera I have. I think it is a good start to make it run as expected using command line and ffmpeg. So I know what format to use and that it actually works as intended before doing it programmatically.