
Recherche avancée
Médias (3)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (60)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (7917)
-
Capturing RTP Timestamps
10 septembre 2019, par m00ncakeI was trying a little experiment in order to get the timestamps of the RTP packets using the VideoCapture class from Opencv’s source code in python, also had to modify FFmpeg to accommodate the changes in Opencv.
Since I read about the RTP packet format.Wanted to fiddle around and see if I could manage to find a way to get the NTP timestamps. Was unable to find any reliable help in trying to get RTP timestamps. So tried out this little hack.
Credits to ryantheseer on github for the modified code.
Version of FFmpeg : 3.2.3
Version of Opencv : 3.2.0In Opencv source code :
modules/videoio/include/opencv2/videoio.hpp :
Added two getters for the RTP timestamp :
.....
/** @brief Gets the upper bytes of the RTP time stamp in NTP format (seconds).
*/
CV_WRAP virtual int64 getRTPTimeStampSeconds() const;
/** @brief Gets the lower bytes of the RTP time stamp in NTP format (fraction of seconds).
*/
CV_WRAP virtual int64 getRTPTimeStampFraction() const;
.....modules/videoio/src/cap.cpp :
Added an import and added the implementation of the timestamp getter :
....
#include <cstdint>
....
....
static inline uint64_t icvGetRTPTimeStamp(const CvCapture* capture)
{
return capture ? capture->getRTPTimeStamp() : 0;
}
...
</cstdint>Added the C++ timestamp getters in the VideoCapture class :
....
/**@brief Gets the upper bytes of the RTP time stamp in NTP format (seconds).
*/
int64 VideoCapture::getRTPTimeStampSeconds() const
{
int64 seconds = 0;
uint64_t timestamp = 0;
//Get the time stamp from the capture object
if (!icap.empty())
timestamp = icap->getRTPTimeStamp();
else
timestamp = icvGetRTPTimeStamp(cap);
//Take the top 32 bytes of the time stamp
seconds = (int64)((timestamp & 0xFFFFFFFF00000000) / 0x100000000);
return seconds;
}
/**@brief Gets the lower bytes of the RTP time stamp in NTP format (seconds).
*/
int64 VideoCapture::getRTPTimeStampFraction() const
{
int64 fraction = 0;
uint64_t timestamp = 0;
//Get the time stamp from the capture object
if (!icap.empty())
timestamp = icap->getRTPTimeStamp();
else
timestamp = icvGetRTPTimeStamp(cap);
//Take the bottom 32 bytes of the time stamp
fraction = (int64)((timestamp & 0xFFFFFFFF));
return fraction;
}
...modules/videoio/src/cap_ffmpeg.cpp :
Added an import :
...
#include <cstdint>
...
</cstdint>Added a method reference definition :
...
static CvGetRTPTimeStamp_Plugin icvGetRTPTimeStamp_FFMPEG_p = 0;
...Added the method to the module initializer method :
...
if( icvFFOpenCV )
...
...
icvGetRTPTimeStamp_FFMPEG_p =
(CvGetRTPTimeStamp_Plugin)GetProcAddress(icvFFOpenCV, "cvGetRTPTimeStamp_FFMPEG");
...
...
icvWriteFrame_FFMPEG_p != 0 &&
icvGetRTPTimeStamp_FFMPEG_p !=0)
...
icvGetRTPTimeStamp_FFMPEG_p = (CvGetRTPTimeStamp_Plugin)cvGetRTPTimeStamp_FFMPEG;Implemented the getter interface :
...
virtual uint64_t getRTPTimeStamp() const
{
return ffmpegCapture ? icvGetRTPTimeStamp_FFMPEG_p(ffmpegCapture) : 0;
}
...In FFmpeg’s source code :
libavcodec/avcodec.h :
Added the NTP timestamp definition to the AVPacket struct :
typedef struct AVPacket {
...
...
uint64_t rtp_ntp_time_stamp;
}libavformat/rtpdec.c :
Store the ntp time stamp in the struct in the finalize_packet method :
static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp)
{
uint64_t offsetTime = 0;
uint64_t rtp_ntp_time_stamp = timestamp;
...
...
/*RM: Sets the RTP time stamp in the AVPacket */
if (!s->last_rtcp_ntp_time || !s->last_rtcp_timestamp)
offsetTime = 0;
else
offsetTime = s->last_rtcp_ntp_time - ((uint64_t)(s->last_rtcp_timestamp) * 65536);
rtp_ntp_time_stamp = ((uint64_t)(timestamp) * 65536) + offsetTime;
pkt->rtp_ntp_time_stamp = rtp_ntp_time_stamp;libavformat/utils.c :
Copy the ntp time stamp from the packet to the frame in the read_frame_internal method :
static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
{
...
uint64_t rtp_ntp_time_stamp = 0;
...
while (!got_packet && !s->internal->parse_queue) {
...
//COPY OVER the RTP time stamp TODO: just create a local copy
rtp_ntp_time_stamp = cur_pkt.rtp_ntp_time_stamp;
...
#if FF_API_LAVF_AVCTX
update_stream_avctx(s);
#endif
if (s->debug & FF_FDEBUG_TS)
av_log(s, AV_LOG_DEBUG,
"read_frame_internal stream=%d, pts=%s, dts=%s, "
"size=%d, duration=%"PRId64", flags=%d\n",
pkt->stream_index,
av_ts2str(pkt->pts),
av_ts2str(pkt->dts),
pkt->size, pkt->duration, pkt->flags);
pkt->rtp_ntp_time_stamp = rtp_ntp_time_stamp; #Just added this line in the if statement.
return ret;My python code to utilise these changes :
import cv2
uri = 'rtsp://admin:password@192.168.1.67:554'
cap = cv2.VideoCapture(uri)
while True:
frame_exists, curr_frame = cap.read()
# if frame_exists:
k = cap.getRTPTimeStampSeconds()
l = cap.getRTPTimeStampFraction()
time_shift = 0x100000000
#because in the getRTPTimeStampSeconds()
#function, seconds was multiplied by 0x10000000
seconds = time_shift * k
m = (time_shift * k) + l
print("Imagetimestamp: %i" % m)
cap.release()What I am getting as my output :
Imagetimestamp: 0
Imagetimestamp: 212041451700224
Imagetimestamp: 212041687629824
Imagetimestamp: 212041923559424
Imagetimestamp: 212042159489024
Imagetimestamp: 212042395418624
Imagetimestamp: 212042631348224
...What astounded me the most was that when i powered off the ip camera and powered it back on, timestamp would start from 0 then quickly increments. I read NTP time format is relative to January 1, 1900 00:00. Even when I tried calculating the offset, and accounting between now and 01-01-1900, I still ended up getting a crazy high number for the date.
Don’t know if I calculated it wrong. I have a feeling it’s very off or what I am getting is not the timestamp.
-
Identification of Frame Type using Xuggle
1er décembre 2012, par SamveenI'm trying to extract just the I-Frames from a video using the Xuggle API. I took the first example from the Xuggle source from here and removing the display code, added the following code snippet to identify the frame type of the current frame :
// Decode loop {
if (picture.isComplete()) {
com.xuggle.xuggler.IVideoPicture.PictType type = picture.getPictureType()
if(type == com.xuggle.xuggler.IVideoPicture.PictType.I_TYPE)
System.out.println("(I-Frame)\n");
else if(type == com.xuggle.xuggler.IVideoPicture.PictType.B_TYPE)
System.out.println("(B-Frame)\n");
else if(type == com.xuggle.xuggler.IVideoPicture.PictType.P_TYPE)
System.out.println("(P-Frame)\n");
else if(type == com.xuggle.xuggler.IVideoPicture.PictType.S_TYPE)
System.out.println("(S-Frame)\n");
else if(type ==com.xuggle.xuggler.IVideoPicture.PictType.DEFAULT_TYPE)
System.out.println("(Default)\n");
else
System.out.println("(Other)\n");
}
// }Using this code, I never get an I-Frame in my test video, which by definition of being it being a video is impossible (every video's first frame MUST be an I-Frame) and every frame is identified as
When I use mplayer to extract the I-Frames from the same video using :
mplayer video20.mp4 -benchmark -nosound -noaspect -noframedrop -ao null \
-vo png:z=6 -vf framestep=II correctly get a set of I-Frames.
The number of frames displayed by my code is identical to that extracted by mplayer without the framestep filter
mplayer video20.mp4 -benchmark -nosound -noaspect -noframedrop -ao null \
-vo png:z=6The input video in question is an H264 encoded video.
My question is that what can I do to correctly get the I-Frames from the video using xuggle
I picked up the method from Java - Keyframe extraction from a video
-
lavf : Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlink
17 novembre 2014, par Martin Storsjölavf : Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlink
This makes sure that the internal utf8 path names are handled
properly - the normal file handling functions assume path names
are in the native codepage, which isn’t utf8.This assumes that the tools outside of lavf don’t use the mkdir
definition. (The tools don’t do the same reading of command line
parameters as wchar either - they probably won’t handle all possible
unicode file parameters properly, but at least work more predictably
if no utf8/wchar conversion is involved.)This is moved further down in os_support.h, since windows.h shouldn’t
be included before winsock2.h, while io.h needs to be included before
the manual defines for lseek functions.Signed-off-by : Martin Storsjö <martin@martin.st>