Recherche avancée

Médias (91)

Autres articles (21)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP 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, par

    Pour 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 2011

    Contrairement à 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 Rheinhardt
    avformat/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>

    • [DH] libavformat/matroskaenc.c
  • Save RTSP to mp4 with ffmpeg/libav ? Video is not of the right length, possibly too fast ?

    20 décembre 2022, par David Bensoussan

    inspired by other stackoverflow answers, I wrote a code to get an rtps stream into an mp4 file. I tried commenting as much as possible :

    &#xA;

    #include &#xA;#include &#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavformat></libavformat>avio.h>&#xA;#include <sys></sys>time.h>&#xA;&#xA;time_t get_time()&#xA;{&#xA;  struct timeval tv;&#xA;&#xA;  gettimeofday(&amp;tv, NULL);&#xA;&#xA;  return tv.tv_sec;&#xA;}&#xA;&#xA;int main(int argc, char* argv[])&#xA;{&#xA;  AVFormatContext* ifcx = NULL;&#xA;  AVCodecContext* iccx;&#xA;  AVStream* ist;&#xA;  int i_index;&#xA;  time_t timenow, timestart;&#xA;&#xA;  AVFormatContext* ofcx;&#xA;  AVOutputFormat* ofmt;&#xA;  AVStream* ost;&#xA;&#xA;  AVPacket pkt;&#xA;&#xA;  int ix;&#xA;&#xA;  const char* sProg = argv[0];&#xA;  const char* sFileInput;&#xA;  const char* sFileOutput;&#xA;  int bRunTime;&#xA;&#xA;  if (argc != 4)&#xA;  {&#xA;    printf("Usage: %s url outfile runtime\n", sProg);&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;  sFileInput = argv[1];&#xA;  sFileOutput = argv[2];&#xA;  bRunTime = atoi(argv[3]);&#xA;&#xA;  // Initialize library&#xA;  av_log_set_level(AV_LOG_ERROR);&#xA;  avformat_network_init();&#xA;&#xA;  //&#xA;  // Input&#xA;  //&#xA;&#xA;  // open rtsp&#xA;  AVDictionary* opts = 0;&#xA;  av_dict_set(&amp;opts, "rtsp_transport", "tcp", 0);&#xA;  if (avformat_open_input(&amp;ifcx, sFileInput, 0, &amp;opts) != 0)&#xA;  {&#xA;    printf("ERROR: Cannot open input file\n");&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;&#xA;  if (avformat_find_stream_info(ifcx, NULL) &lt; 0)&#xA;  {&#xA;    printf("ERROR: Cannot find stream info\n");&#xA;    avformat_close_input(&amp;ifcx);&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;&#xA;  snprintf(ifcx->url, sizeof(ifcx->url), "%s", sFileInput);&#xA;&#xA;  // search video stream&#xA;  i_index = -1;&#xA;  AVCodecParameters* iccx_par;&#xA;  for (ix = 0; ix &lt; ifcx->nb_streams; ix&#x2B;&#x2B;)&#xA;  {&#xA;    iccx_par = ifcx->streams[ix]->codecpar;&#xA;    if (iccx_par->codec_type == AVMEDIA_TYPE_VIDEO)&#xA;    {&#xA;      ist = ifcx->streams[ix];&#xA;      i_index = ix;&#xA;      break;&#xA;    }&#xA;  }&#xA;  if (i_index &lt; 0)&#xA;  {&#xA;    printf("ERROR: Cannot find input video stream\n");&#xA;    avformat_close_input(&amp;ifcx);&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;&#xA;  // Allocate codec context and convert codec parameters to codec context&#xA;  iccx = avcodec_alloc_context3(NULL);&#xA;  avcodec_parameters_to_context(iccx, iccx_par);&#xA;&#xA;  // set output format&#xA;  ofmt = av_guess_format("mp4", NULL, NULL);&#xA;&#xA;  // create output context&#xA;  if (avformat_alloc_output_context2(&amp;ofcx, ofmt, NULL, sFileOutput) &lt; 0)&#xA;  {&#xA;    printf("ERROR: Cannot create output context\n");&#xA;    avformat_close_input(&amp;ifcx);&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;&#xA;  // add video stream&#xA;  ost = avformat_new_stream(ofcx, NULL);&#xA;  if (!ost)&#xA;  {&#xA;    printf("ERROR: Cannot add output stream\n");&#xA;    avformat_close_input(&amp;ifcx);&#xA;    avformat_free_context(ofcx);&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;&#xA;  // copy codec context&#xA;  if (avcodec_parameters_from_context(ost->codecpar, iccx) &lt; 0)&#xA;  {&#xA;    printf("ERROR: Cannot copy codec context\n");&#xA;    avformat_close_input(&amp;ifcx);&#xA;    avformat_free_context(ofcx);&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;&#xA;  // open output file&#xA;  if (!(ofmt->flags &amp; AVFMT_NOFILE))&#xA;  {&#xA;    if (avio_open(&amp;ofcx->pb, sFileOutput, AVIO_FLAG_WRITE) &lt; 0)&#xA;    {&#xA;      printf("ERROR: Cannot open output file\n");&#xA;      avformat_close_input(&amp;ifcx);&#xA;      avformat_free_context(ofcx);&#xA;      return EXIT_FAILURE;&#xA;    }&#xA;  }&#xA;&#xA;  // write output file header&#xA;  if (avformat_write_header(ofcx, NULL) &lt; 0)&#xA;  {&#xA;    printf("ERROR: Cannot write output file header\n");&#xA;    avformat_close_input(&amp;ifcx);&#xA;    avio_close(ofcx->pb);&#xA;    avformat_free_context(ofcx);&#xA;    return EXIT_FAILURE;&#xA;  }&#xA;&#xA;  //&#xA;  // Write data&#xA;  //&#xA;  AVRational time_base = ist->time_base;&#xA;  timestart = get_time();&#xA;  int64_t pts = 0;&#xA;  while (av_read_frame(ifcx, &amp;pkt) >= 0)&#xA;  {&#xA;    if (get_time() - timestart > bRunTime)&#xA;    {&#xA;      break;&#xA;    }&#xA;    if (pkt.stream_index == i_index)&#xA;    {&#xA;      pkt.stream_index = ost->id;&#xA;&#xA;      pkt.pts = pkt.duration * pts;&#xA;      pkt.dts = pkt.pts;&#xA;&#xA;      if (av_interleaved_write_frame(ofcx, &amp;pkt) &lt; 0)&#xA;      {&#xA;        printf("ERROR: Cannot write packet\n");&#xA;        av_packet_unref(&amp;pkt);&#xA;        break;&#xA;      }&#xA;      pts&#x2B;&#x2B;;&#xA;    }&#xA;  }&#xA;&#xA;  // write output file trailer&#xA;  if (av_write_trailer(ofcx) &lt; 0)&#xA;  {&#xA;    printf("ERROR: Cannot write output file trailer\n");&#xA;  }&#xA;&#xA;  //&#xA;  // Close&#xA;  //&#xA;&#xA;  avformat_close_input(&amp;ifcx);&#xA;  avio_close(ofcx->pb);&#xA;  avformat_free_context(ofcx);&#xA;&#xA;  avformat_network_deinit();&#xA;&#xA;  return EXIT_SUCCESS;&#xA;}&#xA;

    &#xA;

    Compile :

    &#xA;

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

    &#xA;

    Run :

    &#xA;

    ./a.out rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4 out.mp4 5&#xA;

    &#xA;

    Then using ffprobe, the video will last different time every time :&#xA;5.875000&#xA;6.500000

    &#xA;

    If i run the CLI

    &#xA;

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

    &#xA;

    It will always give 5.124000

    &#xA;

    What am I doing wrong ?

    &#xA;

    Thanks !

    &#xA;

  • lavfi/vf_fieldmatch : keep fields as-is if not matched properly

    3 novembre 2022, par mail@nodoa.me
    lavfi/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>

    • [DH] libavfilter/vf_fieldmatch.c