Recherche avancée

Médias (0)

Mot : - Tags -/presse-papier

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (48)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque 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 (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (4692)

  • How to set up ffmpeg options for HLS ?

    19 février 2015, par user1816574

    I have a streaming device that streams mpegts video and audio. I am trying to capture those streams and save them multiple .ts file using HLS of ffmpeg.

    So, I have been successful in capturing and saving the streams in a single .ts file. It seems like when I send the output file to be .m3u8, ffmpeg automatically chooses hls demuxer. But, doing so I get a floating point exception.
    Here is my simple code...

    static int ipcam_streaming_main_configure_input_parameters(const char *p_ifilename, AVFormatContext **ppx_ifmt_ctx)

    {
      AVStream *px_istream          = NULL;
      AVCodecContext *px_icodec_ctx = NULL;
      int ret                       = -1;
      unsigned int i                = 0;
      enum AVCodecID input_codec_id = AV_CODEC_ID_NONE;
      AVCodec *p_decoder            = NULL;


      if (avformat_open_input(ppx_ifmt_ctx, p_ifilename, NULL, NULL) < 0)

      {
         printf("%s(): avformat_open_input() failed\n", __FUNCTION__);

      }
      else if (avformat_find_stream_info(*ppx_ifmt_ctx, NULL) < 0)
      {
         printf("%s(): avformat_find_stream_info() failed\n", __FUNCTION__);
      }
      else
      {
         /* find the input streams to be remuxed */
         for (i = 0; i < (*ppx_ifmt_ctx)->nb_streams; i++)
         {
            /* get the stream, codec context for the stream */
            px_istream = (*ppx_ifmt_ctx)->streams[i];
            px_icodec_ctx = px_istream->codec;

            if ((AVMEDIA_TYPE_VIDEO == px_icodec_ctx->codec_type)
                || (AVMEDIA_TYPE_AUDIO == px_icodec_ctx->codec_type))
            {
               /* get the codec_id for the audio/video stream */
               input_codec_id = px_icodec_ctx->codec_id;

               /* get the decoder for the input codec id */
               p_decoder = avcodec_find_decoder(px_icodec_ctx->codec_id);

               /* Open decoder for the input codec audio/video */
               ret = avcodec_open2(px_icodec_ctx,
                                   p_decoder,
                                   NULL);
               if (ret < 0)
               {
                  printf("%s(): avcodec_open2() failed\n", __FUNCTION__);
               }
               else
               {
                  printf("Input stream type <%d> with codec_id <%d> found and decoder opened\n", px_icodec_ctx->codec_type, input_codec_id);
               }
            }
         }
      }

      /* dump the data into stdout */
      av_dump_format(*ppx_ifmt_ctx, 0, p_ifilename, 0);

      return ret;
    }

    static int ipcam_streaming_main_configure_output_parameters(const char *p_ofilename,
                                                               AVFormatContext *px_ifmt_ctx,
                                                               AVFormatContext **ppx_ofmt_ctx)
    {
      AVStream *px_ostream       = NULL;
      AVStream *px_istream       = NULL;
      AVCodecContext *px_dec_ctx = NULL;
      AVCodecContext *px_enc_ctx = NULL;
      int ret                    = -1;
      unsigned int i             = 0;

      if ((NULL == p_ofilename) || (NULL == px_ifmt_ctx) || (NULL == ppx_ofmt_ctx))
      {
         printf("%s(): NULL arg(s) <%p, %p, %p>", __FUNCTION__, p_ofilename, px_ifmt_ctx, ppx_ofmt_ctx);
         return -1;
      }

      /* remove the output file if already exists */
      remove(p_ofilename);

      /* allocate the output format context */
      if (avformat_alloc_output_context2(ppx_ofmt_ctx, NULL, NULL, p_ofilename) < 0)
      {
         printf("%s(): avformat_alloc_output_context2() failed\n", __FUNCTION__);
      }
      else
      {
         for (i = 0; i < px_ifmt_ctx->nb_streams; i++)
         {
            if ((AVMEDIA_TYPE_VIDEO == px_ifmt_ctx->streams[i]->codec->codec_type)
                || (AVMEDIA_TYPE_AUDIO == px_ifmt_ctx->streams[i]->codec->codec_type))
            {
               printf("Stream <%d> is type <%d>: Adding to output stream\n", i, px_ifmt_ctx->streams[i]->codec->codec_type);

               /* create a new output stream */
               px_ostream = avformat_new_stream(*ppx_ofmt_ctx, NULL);
               if (NULL == px_ostream)
               {
                  printf("%s(): avformat_new_stream() failed\n", __FUNCTION__);
               }
               else
               {
                  px_istream = px_ifmt_ctx->streams[i];
                  px_dec_ctx = px_istream->codec;
                  px_enc_ctx = px_ostream->codec;

                  /* Since, we do not need to encode the video stream, it is just remuxing
                     just copying the input codec context to output is sufficient */
                  ret = avcodec_copy_context((*ppx_ofmt_ctx)->streams[i]->codec,
                                             px_ifmt_ctx->streams[i]->codec);

                  if ((*ppx_ofmt_ctx)->oformat->flags & AVFMT_GLOBALHEADER)
                  {
                     px_enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
                  }
               }
            }
            else
            {
               printf("Stream <%d> is Unknown: Ignore it \n", i);
            }
         }

         /* dump the output media file into stdout */
         av_dump_format(*ppx_ofmt_ctx, 0, p_ofilename, 1);

         if (0 == ((*ppx_ofmt_ctx)->oformat->flags & AVFMT_NOFILE))
         {
            /* open the output media file so that we can write the data into it */
            ret = avio_open(&(*ppx_ofmt_ctx)->pb, p_ofilename, AVIO_FLAG_WRITE);
            if (ret < 0)
            {
               printf("%s(): avio_open() failed\n", __FUNCTION__);
            }
            else
            {
               /* init muxer, write output file header */
               ret = avformat_write_header((*ppx_ofmt_ctx), NULL);
               if (ret < 0)
               {
                  printf("%s(): avformat_write_header() failed\n", __FUNCTION__);
               }
            }
         }
      }

      return ret;
    }


    int main(int argnum, char **argv)
    {
      AVFormatContext *px_ifmt_ctx = NULL;
      AVFormatContext *px_ofmt_ctx = NULL;
      AVPacket packet              = {0};
      enum AVMediaType type        = AVMEDIA_TYPE_UNKNOWN;
      unsigned int stream_index    = -1;
      unsigned int i               = 0;
      int ret                      = -1;

      if (argnum != 3)
      {
         printf("Please enough number of parameters\n");
         return -1;
      }

      /* register all the services requred */
      av_register_all();
      avformat_network_init();

      if (0 != ipcam_streaming_main_configure_input_parameters(argv[1],
                                                               &px_ifmt_ctx))
      {
         printf("%s(): ipcam_streaming_main_configure_iput_parameters() failed\n", __FUNCTION__);
      }
      else if (0 != ipcam_streaming_main_configure_output_parameters(argv[2],
                                                                     px_ifmt_ctx,
                                                                     &px_ofmt_ctx))
      {
         printf("%s(): ipcam_streaming_main_configure_output_parameters() failed\n", __FUNCTION__);
      }
      else
      {
         printf("Input and output configuration done successfully: Now reading packets\n");
         while (true)
         {
            if ((ret = av_read_frame(px_ifmt_ctx, &packet)) < 0)
            {
               printf("av_read_frame() failed with error <%d>: Exit\n", ret);
               break;
            }

            /* get the stream index and codec type of the packet read */
            stream_index = packet.stream_index;
            type = px_ifmt_ctx->streams[stream_index]->codec->codec_type;

            /* remux only if the type is video, otherwise ignore it */
            if ((AVMEDIA_TYPE_VIDEO == type)
                || (AVMEDIA_TYPE_AUDIO == type))
            {
               printf("Remuxing the stream type <%d>, frame with stream index <%d>\n", type, stream_index);

               /* remux this frame without reencoding */
               packet.dts = av_rescale_q_rnd(packet.dts,
                                             px_ifmt_ctx->streams[stream_index]->time_base,
                                             px_ofmt_ctx->streams[stream_index]->time_base,
                                             AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX);

               packet.pts = av_rescale_q_rnd(packet.pts,
                                             px_ifmt_ctx->streams[stream_index]->time_base,
                                             px_ofmt_ctx->streams[stream_index]->time_base,
                                             AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX);

               /* write the frame into the output media file */
               ret = av_write_frame(px_ofmt_ctx, &packet);

               if (ret < 0)
               {
                  printf("Ignoring video packet stream index <%d>\n", packet.stream_index);
               }

               /* free the packet for next use */
               av_free_packet(&packet);
            }
            else
            {
               printf("Ignoring stream index <%d>, type <%d>\n", packet.stream_index, type);
            }
         }
      }

      /* write the trailer */
      av_write_trailer(px_ofmt_ctx);

      av_free_packet(&packet);

      for (i = 0; i < px_ifmt_ctx->nb_streams; i++)
      {
         /* close the input codec that has been opened */
         avcodec_close(px_ifmt_ctx->streams[i]->codec);

         if ((NULL != px_ofmt_ctx) && (px_ofmt_ctx->nb_streams > i) &&
             (NULL != px_ofmt_ctx->streams[i]) && ( NULL != px_ofmt_ctx->streams[i]->codec))
         {
            /* close the output code */
            avcodec_close(px_ofmt_ctx->streams[i]->codec);
         }
      }

      /* close the input */
      avformat_close_input(&px_ifmt_ctx);

      if ((NULL != px_ofmt_ctx) && (0 == (px_ofmt_ctx->oformat->flags & AVFMT_NOFILE)))
      {
         /* close the output context */
         avio_close(px_ofmt_ctx->pb);
      }

      /* free the output context */
      avformat_free_context(px_ofmt_ctx);

      return ret;
    }

    So, If i pass the output filename to be .m3u8 file, it gives a floating point exception.

  • checkasm : Explicitly declare function prototypes

    16 août 2015, par Henrik Gramner
    checkasm : Explicitly declare function prototypes
    

    Now we no longer have to rely on function pointers intentionally
    declared without specified argument types.

    This makes it easier to support functions with floating point parameters
    or return values as well as functions returning 64-bit values on 32-bit
    architectures. It also avoids having to explicitly cast strides to
    ptrdiff_t for example.

    • [DH] tests/checkasm/Makefile
    • [DH] tests/checkasm/bswapdsp.c
    • [DH] tests/checkasm/checkasm.c
    • [DH] tests/checkasm/checkasm.h
    • [DH] tests/checkasm/h264pred.c
    • [DH] tests/checkasm/h264qpel.c
    • [DH] tests/checkasm/x86/checkasm.asm
  • avcodec/aacsbr_template : Deduplicate VLCs

    24 septembre 2023, par Andreas Rheinhardt
    avcodec/aacsbr_template : Deduplicate VLCs
    

    The VLCs, their init code and the tables used for initialization
    are currently duplicated for the floating- and fixed-point decoders.
    This commit stops doing so and moves this stuff to aacdec_common.c.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavcodec/aacdec_common.c
    • [DH] libavcodec/aacdectab.h
    • [DH] libavcodec/aacsbr.c
    • [DH] libavcodec/aacsbr.h
    • [DH] libavcodec/aacsbr_fixed.c
    • [DH] libavcodec/aacsbr_template.c
    • [DH] libavcodec/aacsbrdata.h