
Recherche avancée
Autres articles (77)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (11186)
-
avformat/aiffenc : Add deinit function
25 octobre 2019, par Andreas Rheinhardt -
Saving frames from a network camera (RTSP) to a mp4 file
24 novembre 2015, par Dídac PérezI am quite confused about how to save a video stream into a mp4 file. I am using ffmpeg. Let me explain the problem :
- I connect to a network camera via RTSP (H.264 stream) with avformat_open_input(), avformat_find_stream_info(), av_read_play(), and I get frames with av_read_frame().
- Each time I get a frame with av_read_frame(), I store the corresponding AVPacket in a circular buffer.
- In some points in my application, a range of this circular buffer is selected. I find a key frame used to start from.
- Once I have a list of AVPacket’s starting from a key frame, I write header, frames, and tail, as I described below in the code.
The problem is that the resulting mp4 video has artifacts if I try to watch it using VLC, Windows Media Player, or another one.
I have also realized that the pts of that packets are not continuous, while dts are continuous. I know about B frames, but is this a problem in my case ?
// Prepare the output
AVFormatContext* oc = avformat_alloc_context();
oc->oformat = av_guess_format(NULL, "video.mp4", NULL);
// Must write header, packets, and trailing
avio_open2(&oc->pb, "video.mp4", AVIO_FLAG_WRITE, NULL, NULL);
// Write header
AVStream* stream = avformat_new_stream(oc, (AVCodec*) context->streams[video_stream_index]->codec->codec);
avcodec_copy_context(stream->codec, context->streams[video_stream_index]->codec);
stream->sample_aspect_ratio = context->streams[video_stream_index]->codec->sample_aspect_ratio;
avformat_write_header(oc, NULL);
// FOR EACH FRAME...
... av_write_frame(oc, circular[k]); ...
// Write trailer and close the file
av_write_trailer(oc);
avcodec_close(stream->codec);
avio_close(oc->pb);
avformat_free_context(oc);Thank you so much,
-
Unable to find/write moov atom in the mp4 recorded stream
11 juillet 2014, par AnilJI have written the following code to write the webcam feed into a file (.mp4) on disk. The program is successful, but when I try to play the file using player, it says "moov atom not found" and player is not showing anything. The file however is a valid mp4 file according to ffmpeg command.
This is my main thread where I encode a picture every 30ms.
public void run() {
// Set the thread rolling.
mRunning = true;
while (mRunning) {
// and display it on the Java Swing window
Record();
}
// clean up resources
cleanup();
}
private void Record() {
IVideoPicture picture = null;
BufferedImage image = null;
picture = GetNextPicture();
image = Utils.videoPictureToImage(picture);
if (picture != null) {
// If recording is enabled, record the webcam stream.
if (mRecordStream) {
// convert to the right image type
BufferedImage bgrScreen = ConvertToType(image, BufferedImage.TYPE_3BYTE_BGR);
// encode the image to stream #0
mWriter.encodeVideo(0, bgrScreen, System.nanoTime() - mStartTime, TimeUnit.NANOSECONDS);
}
try {
Thread.sleep(30);
} catch (InterruptedException e) {
return;
}
}
}From the main thread, I do this when I want to stop the recording and close this recording thread. The cleanup() method is eventually called by the main thread to close the writer. The comment does says about writing the trailer (I guess moov atom), but it does not do it. Can someone please help me find where the problem is ?
public void stopRecording() {
// Stop the thread loop.
mRunning = false;
}
private void cleanup() {
// tell the writer to close and write the trailer if needed
if (mWriter != null) {
mWriter.close();
mWriter = null;
}
if (mVideoCoder != null) {
mVideoCoder.close();
mVideoCoder = null;
}
if (mContainer != null) {
mContainer.close();
mContainer = null;
}
}