
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (21)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
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) (...)
Sur d’autres sites (4353)
-
avformat/matroskaenc : Simplify writing Cues
30 décembre 2019, par Andreas Rheinhardtavformat/matroskaenc : Simplify writing Cues
When the Matroska muxer writes the Cues (the index), it groups index
entries with the same timestamp into the same CuePoint to save space.
But given Matroska's variable-length length fields, it either needs
to have an upper bound of the final size of the CuePoint before writing it
or the CuePoint has to be assembled in a different buffer, so that after
having assembled the CuePoint (when the real size is known), the CuePoint's
header can be written and its data copied after it.The first of these approaches is the currently used one. This entails
finding out the number of entries in a CuePoint before starting the
CuePoint and therefore means that the list is read at least twice.
Furthermore, a worst-case upper-bound for the length of a single entry
was used, so that sometimes bytes are wasted on length fields.This commit switches to the second approach. This is no longer more
expensive than the current approach if one only resets the dynamic
buffer used to write the CuePoint's content instead of opening a new
buffer for every CuePoint : Writing the trailer of a file with 540.000
CuePoints improved actually from 219054414 decicycles to 2164379394
decicycles (based upon 50 iterations).Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Save RTSP to mp4 with ffmpeg/libav ? Video is not of the right length, possibly too fast ?
20 décembre 2022, par David Bensoussaninspired by other stackoverflow answers, I wrote a code to get an rtps stream into an mp4 file. I tried commenting as much as possible :


#include 
#include 
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libavformat></libavformat>avio.h>
#include <sys></sys>time.h>

time_t get_time()
{
 struct timeval tv;

 gettimeofday(&tv, NULL);

 return tv.tv_sec;
}

int main(int argc, char* argv[])
{
 AVFormatContext* ifcx = NULL;
 AVCodecContext* iccx;
 AVStream* ist;
 int i_index;
 time_t timenow, timestart;

 AVFormatContext* ofcx;
 AVOutputFormat* ofmt;
 AVStream* ost;

 AVPacket pkt;

 int ix;

 const char* sProg = argv[0];
 const char* sFileInput;
 const char* sFileOutput;
 int bRunTime;

 if (argc != 4)
 {
 printf("Usage: %s url outfile runtime\n", sProg);
 return EXIT_FAILURE;
 }
 sFileInput = argv[1];
 sFileOutput = argv[2];
 bRunTime = atoi(argv[3]);

 // Initialize library
 av_log_set_level(AV_LOG_ERROR);
 avformat_network_init();

 //
 // Input
 //

 // open rtsp
 AVDictionary* opts = 0;
 av_dict_set(&opts, "rtsp_transport", "tcp", 0);
 if (avformat_open_input(&ifcx, sFileInput, 0, &opts) != 0)
 {
 printf("ERROR: Cannot open input file\n");
 return EXIT_FAILURE;
 }

 if (avformat_find_stream_info(ifcx, NULL) < 0)
 {
 printf("ERROR: Cannot find stream info\n");
 avformat_close_input(&ifcx);
 return EXIT_FAILURE;
 }

 snprintf(ifcx->url, sizeof(ifcx->url), "%s", sFileInput);

 // search video stream
 i_index = -1;
 AVCodecParameters* iccx_par;
 for (ix = 0; ix < ifcx->nb_streams; ix++)
 {
 iccx_par = ifcx->streams[ix]->codecpar;
 if (iccx_par->codec_type == AVMEDIA_TYPE_VIDEO)
 {
 ist = ifcx->streams[ix];
 i_index = ix;
 break;
 }
 }
 if (i_index < 0)
 {
 printf("ERROR: Cannot find input video stream\n");
 avformat_close_input(&ifcx);
 return EXIT_FAILURE;
 }

 // Allocate codec context and convert codec parameters to codec context
 iccx = avcodec_alloc_context3(NULL);
 avcodec_parameters_to_context(iccx, iccx_par);

 // set output format
 ofmt = av_guess_format("mp4", NULL, NULL);

 // create output context
 if (avformat_alloc_output_context2(&ofcx, ofmt, NULL, sFileOutput) < 0)
 {
 printf("ERROR: Cannot create output context\n");
 avformat_close_input(&ifcx);
 return EXIT_FAILURE;
 }

 // add video stream
 ost = avformat_new_stream(ofcx, NULL);
 if (!ost)
 {
 printf("ERROR: Cannot add output stream\n");
 avformat_close_input(&ifcx);
 avformat_free_context(ofcx);
 return EXIT_FAILURE;
 }

 // copy codec context
 if (avcodec_parameters_from_context(ost->codecpar, iccx) < 0)
 {
 printf("ERROR: Cannot copy codec context\n");
 avformat_close_input(&ifcx);
 avformat_free_context(ofcx);
 return EXIT_FAILURE;
 }

 // open output file
 if (!(ofmt->flags & AVFMT_NOFILE))
 {
 if (avio_open(&ofcx->pb, sFileOutput, AVIO_FLAG_WRITE) < 0)
 {
 printf("ERROR: Cannot open output file\n");
 avformat_close_input(&ifcx);
 avformat_free_context(ofcx);
 return EXIT_FAILURE;
 }
 }

 // write output file header
 if (avformat_write_header(ofcx, NULL) < 0)
 {
 printf("ERROR: Cannot write output file header\n");
 avformat_close_input(&ifcx);
 avio_close(ofcx->pb);
 avformat_free_context(ofcx);
 return EXIT_FAILURE;
 }

 //
 // Write data
 //
 AVRational time_base = ist->time_base;
 timestart = get_time();
 int64_t pts = 0;
 while (av_read_frame(ifcx, &pkt) >= 0)
 {
 if (get_time() - timestart > bRunTime)
 {
 break;
 }
 if (pkt.stream_index == i_index)
 {
 pkt.stream_index = ost->id;

 pkt.pts = pkt.duration * pts;
 pkt.dts = pkt.pts;

 if (av_interleaved_write_frame(ofcx, &pkt) < 0)
 {
 printf("ERROR: Cannot write packet\n");
 av_packet_unref(&pkt);
 break;
 }
 pts++;
 }
 }

 // write output file trailer
 if (av_write_trailer(ofcx) < 0)
 {
 printf("ERROR: Cannot write output file trailer\n");
 }

 //
 // Close
 //

 avformat_close_input(&ifcx);
 avio_close(ofcx->pb);
 avformat_free_context(ofcx);

 avformat_network_deinit();

 return EXIT_SUCCESS;
}



Compile :


gcc test.c -Wunused-variable -lavcodec -lavformat -lavfilter -lavdevice -lswresample -lswscale -lavutil -o a.out



Run :


./a.out rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4 out.mp4 5



Then using ffprobe, the video will last different time every time :
5.875000
6.500000


If i run the CLI


ffmpeg -t 5 -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4 -vcodec copy -acodec copy -map 0 -f mp4 out.mp4



It will always give 5.124000


What am I doing wrong ?


Thanks !


-
lavfi/vf_fieldmatch : keep fields as-is if not matched properly
3 novembre 2022, par mail@nodoa.melavfi/vf_fieldmatch : keep fields as-is if not matched properly
Makes it possible to use deinterlacers which output one frame for each field as fallback if field
matching fails (combmatch=full).Currently, the documented example with fallback on a post-deinterlacer will only work in case the
deinterlacer outputs one frame per first field (as yadif=mode=0). The reason for that is that
fieldmatch will attempt to match the second field regardless of whether it recognizes the end
result is still interlaced. This produces garbled output with for example mixed telecined 24fps and
60i content combined with a field-based deinterlaced such as yadif=mode=1.
This patch orders fieldmatch to revert to using the second field of the current frame in case the
end result is still interlaced and a post-deinterlacer is assumed to be used.Signed-off-by : lovesyk <lovesyk@users.noreply.github.com>