
Recherche avancée
Médias (17)
-
Matmos - Action at a Distance
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
DJ Dolores - Oslodum 2004 (includes (cc) sample of “Oslodum” by Gilberto Gil)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Danger Mouse & Jemini - What U Sittin’ On ? (starring Cee Lo and Tha Alkaholiks)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Cornelius - Wataridori 2
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Rapture - Sister Saviour (Blackstrobe Remix)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Chuck D with Fine Arts Militia - No Meaning No
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (73)
-
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 ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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 (14256)
-
Video record with audio in wpf
5 août 2022, par Kostas KontarasI am developing a chat application in WPF .NET Framework 4.7.2.
I want to implement video recording functionality using the web camera of the PC.
Up to now, I have done this :
I use
AForge.Video
andAForge.Video.DirectShow
to use the webcam and get the frames.
Aforge creates a new thread for every frame. I'm receiving where I save the image and pass it on the UI thread to show the image.

private void Cam_NewFrame(object sender, NewFrameEventArgs eventArgs)
 {
 //handle frames from camera
 try
 {
 //New task to save the bitmap (new frame) into an image
 Task.Run(() =>
 {
 if (_recording)
 {
 
 currentreceivedframebitmap = (Bitmap)eventArgs.Frame.Clone();
 currentreceivedframebitmap.Save($@"{CurrentRecordingFolderForImages}/{imgNumber}-{guidName}.png", ImageFormat.Png);
 imgNumber++;
 }
 });
 //convert bitmap to bitmapImage to show it on the ui
 BitmapImage bi;
 CurrentFrame = new Bitmap(eventArgs.Frame);
 using (var bitmap = (Bitmap)eventArgs.Frame.Clone())
 {
 bi = new BitmapImage();
 bi.BeginInit();
 MemoryStream ms = new MemoryStream();
 bitmap.Save(ms, ImageFormat.Bmp);
 bi.StreamSource = ms;
 bi.CacheOption = BitmapCacheOption.OnLoad;
 bi.EndInit();

 }
 bi.Freeze();
 Dispatcher.BeginInvoke(new ThreadStart(delegate
 {
 imageFrames.Source = bi;
 }));
 }
 catch (Exception ex)
 {
 Console.WriteLine(ex.Message);
 }
 }



When the record finishes i take the image and make the video using ffmpeg.


public static void ImagesToVideo(string ffmpegpath, string guid, string CurrentRecordingFolderForImages, string outputPath, int frameRate, int quality, int avgFrameRate)
 {
 
 Process process;
 process = new Process
 {

 StartInfo = new ProcessStartInfo
 {
 FileName = $@"{ffmpegpath}",
 //-r framerate , vcodec video codec, -crf video quality 0-51
 Arguments = $@" -r {frameRate} -i {CurrentRecordingFolderForImages}\%d-{guid}.png -r {avgFrameRate} -vcodec libx264 -crf {quality} -pix_fmt yuv420p {outputPath}",
 UseShellExecute = false,
 RedirectStandardOutput = true,
 CreateNoWindow = true,
 RedirectStandardError = true
 },
 EnableRaisingEvents = true,

 };
 process.Exited += ExeProcess_Exited;
 process.Start();

 string processOutput = null;
 while ((processOutput = process.StandardError.ReadLine()) != null)
 {
 //TO-DO handle errors
 Debug.WriteLine(processOutput);
 }
 }



For the sound i use Naudio to record it and save it


waveSource = new WaveIn();
 waveSource.StartRecording();
 waveFile = new WaveFileWriter(AudioFilePath, waveSource.WaveFormat);

 waveSource.WaveFormat = new WaveFormat(8000, 1);
 waveSource.DataAvailable += new EventHandler<waveineventargs>(waveSource_DataAvailable);
 waveSource.RecordingStopped += new EventHandler<stoppedeventargs>(waveSource_RecordingStopped);

private void waveSource_DataAvailable(object sender, WaveInEventArgs e)
 {
 if (waveFile != null)
 {
 waveFile.Write(e.Buffer, 0, e.BytesRecorded);
 waveFile.Flush();
 }
 }
</stoppedeventargs></waveineventargs>


and then ffmpeg again to merge video with sound


public static void AddAudioToVideo(string ffmpegpath, string VideoPath, string AudioPath, string outputPath)
 {
 _videoPath = VideoPath;
 _audioPath = AudioPath;
 Process process;

 process = new Process
 {

 StartInfo = new ProcessStartInfo
 {
 FileName = $@"{ffmpegpath}",
 Arguments = $" -i {VideoPath} -i {AudioPath} -map 0:v -map 1:a -c:v copy -shortest {outputPath} -y",
 UseShellExecute = false,
 RedirectStandardOutput = true,
 CreateNoWindow = true,
 RedirectStandardError = true
 },
 EnableRaisingEvents = true,

 };
 process.Exited += ExeProcess_Exited;
 process.Start();

 string processOutput = null;
 while ((processOutput = process.StandardError.ReadLine()) != null)
 {
 // do something with processOutput
 Debug.WriteLine(processOutput);
 }

 }



Questions :


- 

- Is there a better approach to achieve what im trying to do ?
- My camera has 30 fps capability but i receive only 16 fps how could this happen ?
- Sometimes video and sound are not synchronized.








i created a sample project github.com/dinos19/WPFVideoRecorder


-
Web socket disconnects early when ffmpeg finishes proccess
26 septembre 2022, par seriouslyI am using ffmpeg to stream an mp4 video to an rtmp server then display in on the front end using websocket and the process works fine. The problem i'm having is once the video nears its end the web socket connection on the front end disconnects and video stops playing. This is happening because ffmpeg has finished pushing the stream but not all frames are displayed on the front end yet because of stream lag. How can I keep the web socket from disconnecting when ffmpeg finishes streaming so that the full video will be played ? Thanks in advance.




const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const fluent = require('fluent-ffmpeg');
fluent.setFfmpegPath(ffmpegPath);

const executeFfmpeg = args => {
 let command = fluent().output(' '); // pass "Invalid output" validation
 command._outputs[0].isFile = false; // disable adding "-y" argument
 command._outputs[0].target = ""; // bypass "Unable to find a suitable output format for ' '"
 command._global.get = () => { // append custom arguments
 return typeof args === "string" ? args.split(' ') : args;
 };
 return command;
};

function streamVideo() {
 executeFfmpeg(`-re -i ${path.join(__dirname, '..', 'test.mp4')} -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost:PORT/live/test`)
 .on('start', commandLine => console.log('start', commandLine))
 .on('codecData', codecData => console.log('codecData', codecData))
 .on('error', error => console.log('error', error))
 .on('stderr', stderr => console.log('error', error))
 .on('end', commandLine => console.log('video_live end', commandLine))
 .run();
}

streamVideo()


<code class="echappe-js"><script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>




<script>&#xA; if (flvjs.isSupported()) {&#xA; var streamElement = document.getElementById(&#x27;streamElement&#x27;);&#xA; var flvPlayer = flvjs.createPlayer({&#xA; type: &#x27;flv&#x27;,&#xA; url: &#x27;ws://localhost:PORT/live/test.flv&#x27;&#xA; });&#xA; flvPlayer.attachMediaElement(streamElement);&#xA; flvPlayer.load();&#xA; flvPlayer.play();&#xA; }&#xA;</script>







The node media server module starts an rtmp, http and web socket server.




const NodeMediaServer = require('node-media-server');

const config = {
 rtmp: {
 port: 1935,
 chunk_size: 60000,
 gop_cache: true,
 ping: 30,
 ping_timeout: 60
 },
 http: {
 port: 8000,
 allow_origin: '*'
 }
};

var nms = new NodeMediaServer(config)
nms.run();







-
How to record RTSP to mp4 10 mins segments directly into FTP server
31 octobre 2022, par HridyanshNarwal888I want to record a tcp RTSP stream in 10mins segments continuously which can be done with ffmpeg but i don't have enough storage on the actual device and i have many space on my FTP server


and i have no idea how to do it i've tried some codes which are recording it perfectly but cant sync to ftp at the same time


here the older code that i'm using


ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.3:10554/tcp/av0_0 -f mp4 -t 60 ftp://my_ftp_url/%Y-%m-%d/%H-%M-%S.mp4

but it gives the error

[mp4 @ 0x144ae00] muxer does not support non seekable output Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 -- Conversion failed! exit status 1


If this is not possible in this language or through ffmpeg then I've no problem to change language or packages.


Thanks in advance