
Recherche avancée
Médias (91)
-
999,999
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Demon seed (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
The four of us are dying (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Corona radiata (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Lights in the sky (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (40)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (4465)
-
How to record frames with ffmpeg and finish the recording
20 février 2024, par Jorge Augusto WilchenIn the following code, i trying to create a class to record frames from an IP camera (RTSP), save frames on a .avi file and finish the record, but, when i kill the operation, the video file may be corrupted. Have any other more safely way to stop the ffmpeg recording ?


.cpp file :


#include "videorecorder.h"


VideoRecorder::VideoRecorder(const std::string& rtspUrl) :
 url(rtspUrl),
 recording(false)
{

}

VideoRecorder::~VideoRecorder()
{
 end_record();
}

bool VideoRecorder::start_record(const std::string &fileName)
{
 if (recording) {
 std::cerr << "Already recording." << std::endl;
 return false;
 }

 std::string command = "ffmpeg -rtsp_transport udp -i " + url
 + " -c:v mjpeg -preset fast -qp 0 " + fileName;

 videoWriter = popen(command.c_str(), "w");
 if (!videoWriter) {
 std::cerr << "Error opening ffmpeg process." << std::endl;
 return false;
 }

 recording = true;
 ffmpegProcessId = getpid();
 std::cout << "Recording started." << std::endl;
 return true;
}

bool VideoRecorder::end_record()
{
 if (recording) {
 if (videoWriter) {
 pid_t ffmpegPID = fileno(videoWriter);

 if (kill(ffmpegPID, SIGTERM) == 0) {
 std::cout << "Recording terminated successfully." << std::endl;
 } else {
 std::cerr << "Error terminating recording." << std::endl;
 return false;
 }

 int status = pclose(videoWriter);

 if (status == 0) {
 std::cout << "Recording ended successfully." << std::endl;
 } else {
 std::cerr << "Error ending recording. pclose status: " << status << std::endl;
 return false;
 }
 } else {
 std::cerr << "Error ending recording. videoWriter is nullptr." << std::endl;
 return false;
 }

 recording = false;
 return true;
 }

 return false;
}



.h file :


#ifndef VIDEORECORDER_H
#define VIDEORECORDER_H

#include <string>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <csignal>
#include <sys></sys>wait.h>

extern "C" {
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libavutil></libavutil>avutil.h>
#include <libavutil></libavutil>opt.h>
#include <libswscale></libswscale>swscale.h>
#include 
}

#include <linux></linux>videodev2.h>

#include <opencv2></opencv2>opencv.hpp>
#include <opencv2></opencv2>videoio.hpp>
#include <opencv2></opencv2>highgui/highgui.hpp>


class VideoRecorder
{
public:
 VideoRecorder(const std::string& rtspUrl);
 ~VideoRecorder();
 bool start_record(const std::string& fileName);
 bool end_record();

private:
 std::string url;
 AVFormatContext *formatContext;
 AVStream *videoStream;
 AVCodecContext *codecContext;
 AVCodec *codec;
 SwsContext *swsContext;
 AVFrame *frame;
 AVPacket packet;
 bool recording;
 pid_t ffmpegProcessId;
 FILE* videoWriter;
};

#endif // VIDEORECORDER_H
</csignal></cstdlib></fstream></iostream></string>


I'm using the ffmpeg lib becouse i need max speed on frames recording, and OpenCV and AV Lib is much slowness than ffmpeg.


This my terminal output after recording during 10 seconds (generated a file with 23 seconds duration) :


Recording started.
ffmpeg version 4.3.6-0+deb11u1+rpt5 Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 10 (Debian 10.2.1-6)
 configuration: --prefix=/usr --extra-version=0+deb11u1+rpt5 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-mmal --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --enable-sand --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, rtsp, from 'rtsp://admin:[password]@[ip]:[port]/live/0/MAIN':
 Metadata:
 title : RTSP Server
 Duration: N/A, start: 0.280000, bitrate: N/A
 Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc
Codec AVOption preset (Configuration preset) specified for output file #0 (/home/guardian-tech/Pictures/output_frame.avi) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Codec AVOption qp (Constant quantization parameter rate control method) specified for output file #0 (/home/guardian-tech/Pictures/output_frame.avi) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
Output #0, avi, to '/home/guardian-tech/Pictures/output_frame.avi':
 Metadata:
 INAM : RTSP Server
 ISFT : Lavf58.45.100
 Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p(pc), 1920x1080, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
 Metadata:
 encoder : Lavc58.91.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
[rtsp @ 0x5592e7bb00] max delay reached. need to consume packet
[rtsp @ 0x5592e7bb00] RTP: missed 212 packets
[h264 @ 0x5592ebb790] concealing 2192 DC, 2192 AC, 2192 MV errors in I frame
rtsp://admin:[password]@[ip]:[port]/live/0/MAIN: corrupt decoded frame in stream 0
[rtsp @ 0x5592e7bb00] max delay reached. need to consume packet
[rtsp @ 0x5592e7bb00] RTP: missed 6 packets
[rtsp @ 0x5592e7bb00] max delay reached. need to consume packet
[rtsp @ 0x5592e7bb00] RTP: missed 14 packets
[h264 @ 0x5592f1bd30] cabac decode of qscale diff failed at 42 29
[h264 @ 0x5592f1bd30] error while decoding MB 42 29, bytestream 0
[h264 @ 0x5592f1bd30] concealing 4687 DC, 4687 AC, 4687 MV errors in I frame
rtsp://admin:[password]@[ip]:[port]/live/0/MAIN: corrupt decoded frame in stream 0
Error terminating recording.



-
Why I became a HTML5 co-editor
1er janvier 2014, par silviaA few weeks ago, I had the honor to be appointed as part of the editorial team of the W3C HTML5 specification.
Since Ian Hickson had recently decided to focus solely on editing the WHATWG HTML living standard specification, the W3C started looking for other editors to take the existing HTML5 specification to REC level. REC level is what other standards organizations call a “ratified standard”.
But what does REC level really mean for HTML ?
In my probably somewhat subjective view, recommendation level means that a snapshot is taken of the continuously evolving HTML spec, which has a comprehensive feature set, that is implemented in a cross-browser interoperable way, has a complete test set for the features, and has received wide review. The latter implies that other groups in the W3C have had a chance to look at the specification and make sure it satisfies their basic requirements, which include e.g. applicability to all users (accessibility, internationalization), platforms, and devices (mobile, TV).
Basically it means that we stop for a “moment”, take a deep breath, polish the feature set that we’ve been working on this far, and make sure we all agree on it, before we get back to changing the world with cool new stuff. In a software project we would call it a release branch with feature freeze.
Now, as productive as that may sound for software – it’s not actually that exciting for a specification. Firstly, the most exciting things happen when writing new features. Secondly, development of browsers doesn’t just magically stop to get the release (REC) happening. And lastly, if we’ve done our specification work well, there should be only little work to do. Basically, it’s the unthankful work of tidying up that we’re looking at here.
So, why am I doing it ? I am not doing this for money – I’m currently part-time contracting to Google’s accessibility team working on video accessibility and this editor work is not covered by my contract. It wasn’t possible to reconcile polishing work on a specification with the goals of my contract, which include pushing new accessibility features forward. Therefore, when invited, I decided to offer my spare time to the W3C.
I’m giving this time under the condition that I’d only be looking at accessibility and video related sections. This is where my interest and expertise lie, and where I’m passionate to get things right. I want to make sure that we create accessibility features that will be implemented and that we polish existing video features. I want to make sure we don’t digress from implementations which continue to get updated and may follow the WHATWG spec or HTML.next or other needs.
I am not yet completely sure what the editorship will entail. Will we look at tests, too ? Will we get involved in HTML.next ? This far we’ve been preparing for our work by setting up adequate version control repositories, building a spec creation process, discussing how to bridge to the WHATWG commits, and analysing the long list of bugs to see how to cope with them. There’s plenty of actual text editing work ahead and the team is shaping up well ! I look forward to the new experiences.
-
Java ProcessBuilder : space within quotation marks
29 mai 2014, par ZahliiI am using ProcessBuilder to run FFMPEG to convert and label some of my MP3-Files.
Manually using the following in a .bat file works as expected :
"E:\Dokumente\workspace\MusicBot\ffmpeg\bin\ffmpeg.exe"
-i "The Glitch Mob - We Can Make The World Stop.mp4"
-metadata author="The Glitch Mob"
-metadata title="We Can Make The World Stop"
-ab 320k "mob.mp3"Now what i am trying to achieve using java’s ProcessBuilder
ProcessBuilder pr = new ProcessBuilder(FFMPEG_PATH,
"-i", target.getAbsolutePath(),
"-metadata", "title=\"We Can Make The World Stop\"",
"-metadata", "author=\"The Glitch Mob\"",
"-ab", "320k",
tar.getAbsolutePath());results in a
[NULL @ 000000000032f680] Unable to find a suitable output format for 'Can'
.
Using title and author without spaces in them works, however.