Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (94)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (7092)

  • How do you specify container format in FFmpeg ?

    15 avril 2021, par TheNeuronalCoder

    I am trying to encode mp4 video, but it doesn't open on my macbook because while it has the supported H264 codec, the container format is not MP4. So all I ask is how you would go about specifying the container format so I can generate video that is actually playable without using ffplay.

    


    ffprobe version N-101948-g870bfe1 Copyright (c) 2007-2021 the FFmpeg developers
  built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
  configuration: --disable-asm --enable-shared --enable-libx264 --enable-gpl
  libavutil      56. 72.100 / 56. 72.100
  libavcodec     58.136.101 / 58.136.101
  libavformat    58. 78.100 / 58. 78.100
  libavdevice    58. 14.100 / 58. 14.100
  libavfilter     7.111.100 /  7.111.100
  libswscale      5. 10.100 /  5. 10.100
  libswresample   3. 10.100 /  3. 10.100
  libpostproc    55. 10.100 / 55. 10.100
Input #0, h264, from 'animation.mp4':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 24.33 fps, 24 tbr, 1200k tbn, 48 tbc


    


    void imagine::Camera::Record() {&#xA;  if (recording_ == true)&#xA;    throw std::runtime_error(&#xA;      "you must close your camera before starting another recording"&#xA;    );&#xA;  recording_ = true;&#xA;&#xA;  output_file_ = std::fopen(output_.c_str(), "wb");&#xA;  if (!output_file_)&#xA;    throw std::runtime_error("failed to open file");&#xA;&#xA;  AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;  if (!codec)&#xA;    throw std::runtime_error("failed to find codec");&#xA;&#xA;  context_ = avcodec_alloc_context3(codec);&#xA;  if (!context_)&#xA;    throw std::runtime_error("failed to allocate video codec context");&#xA;&#xA;  packet_ = av_packet_alloc();&#xA;  if (!packet_)&#xA;    throw std::runtime_error("failed to allocate video packet");&#xA;&#xA;  py::tuple size = py::globals()["main_scene"].attr("size");&#xA;  context_->width = size[0].cast<int>();&#xA;  context_->height = size[1].cast<int>();&#xA;  context_->bit_rate = 0.4 * fps_ * context_->width * context_->height;&#xA;  context_->time_base = (AVRational){ 1, fps_ };&#xA;  context_->framerate = (AVRational){ fps_, 1 };&#xA;  context_->gop_size = 10;&#xA;  context_->max_b_frames = 1;&#xA;  context_->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;&#xA;  if (avcodec_open2(context_, codec, NULL) &lt; 0)&#xA;    throw std::runtime_error("failed to open codec");&#xA;&#xA;  frame_ = av_frame_alloc();&#xA;  if (!frame_)&#xA;    throw std::runtime_error("failed to allocate video frame");&#xA;&#xA;  frame_->width  = context_->width;&#xA;  frame_->height = context_->height;&#xA;  frame_->format = AV_PIX_FMT_YUV420P;&#xA;&#xA;  if (av_frame_get_buffer(frame_, 0) &lt; 0)&#xA;    throw std::runtime_error("failed to allocate the video frame data");&#xA;}&#xA;</int></int>

    &#xA;

  • gcc : Undefined Reference Error

    26 octobre 2024, par jamie_y

    I would like to use a function 'ff_load_image' defined in ffmpeg/libavfilter/lavfutils.h.

    &#xA;&#xA;

    program.c

    &#xA;&#xA;

    #include "../ffmpeg/libavfilter/lavfutils.h"&#xA;&#xA;int main ()&#xA;{&#xA;  uint8_t* data;&#xA;&#xA;  int linesize, width, height, log_ctx;&#xA;&#xA;  int i = ff_load_image(&amp;data, &amp;linesize, &amp;width, &amp;height, AV_PIX_FMT_RGB24, "blue.jpg", &amp;log_ctx);&#xA;}&#xA;

    &#xA;&#xA;

    Running

    &#xA;&#xA;

    gcc -I$HOME/ffmpeg/include program.c -L$HOME/ffmpeg/lib -lavfilter -lavcodec -lavutil&#xA;

    &#xA;&#xA;

    gives undefined reference errors.

    &#xA;&#xA;

    program.c: In function \u2018main\u2019:&#xA;program.c:9: warning: passing argument 1 of \u2018ff_load_image\u2019 from incompatible pointer type&#xA;../ffmpeg/libavfilter/lavfutils.h:39: note: expected \u2018uint8_t **\u2019 but argument is of type \u2018uint8_t *\u2019&#xA;program.c:9: warning: passing argument 2 of \u2018ff_load_image\u2019 makes pointer from integer without a cast&#xA;../ffmpeg/libavfilter/lavfutils.h:39: note: expected \u2018int *\u2019 but argument is of type \u2018int\u2019&#xA;program.c:9: warning: passing argument 3 of \u2018ff_load_image\u2019 makes pointer from integer without a cast&#xA;../ffmpeg/libavfilter/lavfutils.h:39: note: expected \u2018int *\u2019 but argument is of type \u2018int\u2019&#xA;program.c:9: warning: passing argument 4 of \u2018ff_load_image\u2019 makes pointer from integer without a cast&#xA;../ffmpeg/libavfilter/lavfutils.h:39: note: expected \u2018int *\u2019 but argument is of type \u2018int\u2019&#xA;program.c:9: warning: passing argument 5 of \u2018ff_load_image\u2019 makes pointer from integer without a cast&#xA;../ffmpeg/libavfilter/lavfutils.h:39: note: expected \u2018enum AVPixelFormat *\u2019 but argument is of type \u2018int\u2019&#xA;program.c:9: warning: passing argument 7 of \u2018ff_load_image\u2019 makes pointer from integer without a cast&#xA;../ffmpeg/libavfilter/lavfutils.h:39: note: expected \u2018void *\u2019 but argument is of type \u2018int\u2019&#xA;/home/jamiey/ffmpeg/lib/libavfilter.a(lavfutils.o): In function `ff_load_image&#x27;:&#xA;/home/jamiey/ffmpeg/libavfilter/lavfutils.c:38: undefined reference to `av_register_all&#x27;&#xA;/home/jamiey/ffmpeg/libavfilter/lavfutils.c:40: undefined reference to `av_find_input_format&#x27;&#xA;/home/jamiey/ffmpeg/libavfilter/lavfutils.c:41: undefined reference to `avformat_open_input&#x27;&#xA;/home/jamiey/ffmpeg/libavfilter/lavfutils.c:66: undefined reference to `av_read_frame&#x27;&#xA;/home/jamiey/ffmpeg/libavfilter/lavfutils.c:92: undefined reference to `avformat_close_input&#x27;&#xA;/home/jamiey/ffmpeg/libavfilter/lavfutils.c:92: undefined reference to `avformat_close_input&#x27;&#xA;/home/jamiey/ffmpeg/libavfilter/lavfutils.c:92: undefined reference to `avformat_close_input&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavcodec.a(frame_thread_encoder.o): In function `ff_frame_thread_encoder_free&#x27;:&#xA;/home/jamiey/ffmpeg/libavcodec/frame_thread_encoder.c:225: undefined reference to `pthread_join&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavcodec.a(frame_thread_encoder.o): In function `ff_frame_thread_encoder_init&#x27;:&#xA;/home/jamiey/ffmpeg/libavcodec/frame_thread_encoder.c:200: undefined reference to `pthread_create&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavcodec.a(pthread_frame.o): In function `ff_frame_thread_free&#x27;:&#xA;/home/jamiey/ffmpeg/libavcodec/pthread_frame.c:575: undefined reference to `pthread_join&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavcodec.a(pthread_frame.o): In function `ff_frame_thread_init&#x27;:&#xA;/home/jamiey/ffmpeg/libavcodec/pthread_frame.c:705: undefined reference to `pthread_create&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavcodec.a(pthread_slice.o): In function `ff_slice_thread_init&#x27;:&#xA;/home/jamiey/ffmpeg/libavcodec/pthread_slice.c:220: undefined reference to `pthread_create&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavcodec.a(pthread_slice.o): In function `ff_slice_thread_free&#x27;:&#xA;/home/jamiey/ffmpeg/libavcodec/pthread_slice.c:118: undefined reference to `pthread_join&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavutil.a(rational.o): In function `av_d2q&#x27;:&#xA;/home/jamiey/ffmpeg/libavutil/rational.c:115: undefined reference to `log&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/rational.c:118: undefined reference to `floor&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavutil.a(eval.o): In function `eval_expr&#x27;:&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:183: undefined reference to `trunc&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:182: undefined reference to `ceil&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:181: undefined reference to `floor&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:241: undefined reference to `pow&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:177: undefined reference to `exp&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:176: undefined reference to `exp&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:287: undefined reference to `pow&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:278: undefined reference to `floor&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavutil.a(eval.o): In function `av_strtod&#x27;:&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:112: undefined reference to `pow&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:103: undefined reference to `pow&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:109: undefined reference to `pow&#x27;&#xA;/home/jamiey/ffmpeg/lib/libavutil.a(eval.o): In function `parse_primary&#x27;:&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:394: undefined reference to `sinh&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:395: undefined reference to `cosh&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:396: undefined reference to `tanh&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:397: undefined reference to `sin&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:398: undefined reference to `cos&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:399: undefined reference to `tan&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:400: undefined reference to `atan&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:401: undefined reference to `asin&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:402: undefined reference to `acos&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:403: undefined reference to `exp&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:404: undefined reference to `log&#x27;&#xA;/home/jamiey/ffmpeg/libavutil/eval.c:405: undefined reference to `fabs&#x27;&#xA;collect2: ld returned 1 exit status&#xA;

    &#xA;&#xA;

    However, I was successful in running functions in other library, such as the ones in "ffmpeg/libavcodec/avcodec.h". Why is this happening to "ffmpeg/libavfilter/lavfutils.h" ?

    &#xA;

  • avformat_seek_file timestamps not using the correct time base

    19 juin 2021, par Charlie

    I am in the process of creating a memory loader for ffmpeg to add more functionality. I have audio playing and working, but am having an issue with avformat_seek_file timestamps using the wrong format.

    &#xA;

    avformat.avformat_seek_file(file.context, -1, 0, timestamp, timestamp, 0)&#xA;

    &#xA;

    From looking at the docs it says if the stream index is -1 that the time should be based on AV_TIME_BASE. When I load the file through avformat_open_input with a null AVFormatContext and a filename, this works as expected.

    &#xA;

    However when I create my own AVIOContext and AVFormatContext through avio_alloc_context and avformat_alloc_context respectively, the timestamps are no longer based on AV_TIME_BASE. When testing I received an access violation when I first tried seeking, and upon investigating, it seems that the timestamps are based on actual seconds now. How can I make these custom contexts time based on AV_TIME_BASE ?

    &#xA;

    The only difference between the two are the custom loading of AVIOContext and AVFormatContext :

    &#xA;

        data = fileobject.read()&#xA;&#xA;    ld = len(data)&#xA;&#xA;    buf = libavutil.avutil.av_malloc(ld)&#xA;    ptr_buf = cast(buf, c_char_p)&#xA;&#xA;    ptr = ctypes.create_string_buffer(ld)&#xA;    memmove(ptr, data, ld)&#xA;&#xA;    seeker = libavformat.ffmpeg_seek_func(seek_data)&#xA;    reader = libavformat.ffmpeg_read_func(read_data)&#xA;    writer = libavformat.ffmpeg_read_func(write_data)&#xA;&#xA;    format = libavformat.avformat.avio_alloc_context(ptr_buf, buf_size, 0,&#xA;                                                     ptr_data,&#xA;                                                     reader,&#xA;                                                     writer,&#xA;                                                     seeker&#xA;                                                     )&#xA;&#xA;    file.context = libavformat.avformat.avformat_alloc_context()&#xA;    file.context.contents.pb = format&#xA;    file.context.contents.flags |= AVFMT_FLAG_CUSTOM_IO&#xA;&#xA;    result = avformat.avformat_open_input(byref(file.context),&#xA;                                          b"",&#xA;                                          None,&#xA;                                          None)&#xA;&#xA;    if result != 0:&#xA;        raise FFmpegException(&#x27;avformat_open_input in ffmpeg_open_filename returned an error opening file &#x27;&#xA;                              &#x2B; filename.decode("utf8")&#xA;                              &#x2B; &#x27; Error code: &#x27; &#x2B; str(result))&#xA;&#xA;    result = avformat.avformat_find_stream_info(file.context, None)&#xA;    if result &lt; 0:&#xA;        raise FFmpegException(&#x27;Could not find stream info&#x27;)&#xA;&#xA;    return file&#xA;&#xA;

    &#xA;

    Here is the filename code that does work :

    &#xA;

        result = avformat.avformat_open_input(byref(file.context),&#xA;                                          filename,&#xA;                                          None,&#xA;                                          None)&#xA;    if result != 0:&#xA;        raise FFmpegException(&#x27;avformat_open_input in ffmpeg_open_filename returned an error opening file &#x27;&#xA;                              &#x2B; filename.decode("utf8")&#xA;                              &#x2B; &#x27; Error code: &#x27; &#x2B; str(result))&#xA;&#xA;    result = avformat.avformat_find_stream_info(file.context, None)&#xA;    if result &lt; 0:&#xA;        raise FFmpegException(&#x27;Could not find stream info&#x27;)&#xA;&#xA;    return file&#xA;

    &#xA;

    I am new to ffmpeg, but any help fixing this discrepancy is greatly appreciated.

    &#xA;