
Recherche avancée
Autres articles (94)
-
Configuration spécifique pour PHP5
4 février 2011, parPHP5 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, parLes 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, parMediaspip 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 TheNeuronalCoderI 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() {
 if (recording_ == true)
 throw std::runtime_error(
 "you must close your camera before starting another recording"
 );
 recording_ = true;

 output_file_ = std::fopen(output_.c_str(), "wb");
 if (!output_file_)
 throw std::runtime_error("failed to open file");

 AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_H264);
 if (!codec)
 throw std::runtime_error("failed to find codec");

 context_ = avcodec_alloc_context3(codec);
 if (!context_)
 throw std::runtime_error("failed to allocate video codec context");

 packet_ = av_packet_alloc();
 if (!packet_)
 throw std::runtime_error("failed to allocate video packet");

 py::tuple size = py::globals()["main_scene"].attr("size");
 context_->width = size[0].cast<int>();
 context_->height = size[1].cast<int>();
 context_->bit_rate = 0.4 * fps_ * context_->width * context_->height;
 context_->time_base = (AVRational){ 1, fps_ };
 context_->framerate = (AVRational){ fps_, 1 };
 context_->gop_size = 10;
 context_->max_b_frames = 1;
 context_->pix_fmt = AV_PIX_FMT_YUV420P;

 if (avcodec_open2(context_, codec, NULL) < 0)
 throw std::runtime_error("failed to open codec");

 frame_ = av_frame_alloc();
 if (!frame_)
 throw std::runtime_error("failed to allocate video frame");

 frame_->width = context_->width;
 frame_->height = context_->height;
 frame_->format = AV_PIX_FMT_YUV420P;

 if (av_frame_get_buffer(frame_, 0) < 0)
 throw std::runtime_error("failed to allocate the video frame data");
}
</int></int>


-
gcc : Undefined Reference Error
26 octobre 2024, par jamie_yI would like to use a function 'ff_load_image' defined in ffmpeg/libavfilter/lavfutils.h.



program.c



#include "../ffmpeg/libavfilter/lavfutils.h"

int main ()
{
 uint8_t* data;

 int linesize, width, height, log_ctx;

 int i = ff_load_image(&data, &linesize, &width, &height, AV_PIX_FMT_RGB24, "blue.jpg", &log_ctx);
}




Running



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




gives undefined reference errors.



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




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" ?


-
avformat_seek_file timestamps not using the correct time base
19 juin 2021, par CharlieI 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.

avformat.avformat_seek_file(file.context, -1, 0, timestamp, timestamp, 0)



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 throughavformat_open_input
with a nullAVFormatContext
and a filename, this works as expected.

However when I create my own
AVIOContext
andAVFormatContext
throughavio_alloc_context
andavformat_alloc_context
respectively, the timestamps are no longer based onAV_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 onAV_TIME_BASE
?

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

data = fileobject.read()

 ld = len(data)

 buf = libavutil.avutil.av_malloc(ld)
 ptr_buf = cast(buf, c_char_p)

 ptr = ctypes.create_string_buffer(ld)
 memmove(ptr, data, ld)

 seeker = libavformat.ffmpeg_seek_func(seek_data)
 reader = libavformat.ffmpeg_read_func(read_data)
 writer = libavformat.ffmpeg_read_func(write_data)

 format = libavformat.avformat.avio_alloc_context(ptr_buf, buf_size, 0,
 ptr_data,
 reader,
 writer,
 seeker
 )

 file.context = libavformat.avformat.avformat_alloc_context()
 file.context.contents.pb = format
 file.context.contents.flags |= AVFMT_FLAG_CUSTOM_IO

 result = avformat.avformat_open_input(byref(file.context),
 b"",
 None,
 None)

 if result != 0:
 raise FFmpegException('avformat_open_input in ffmpeg_open_filename returned an error opening file '
 + filename.decode("utf8")
 + ' Error code: ' + str(result))

 result = avformat.avformat_find_stream_info(file.context, None)
 if result < 0:
 raise FFmpegException('Could not find stream info')

 return file




Here is the filename code that does work :


result = avformat.avformat_open_input(byref(file.context),
 filename,
 None,
 None)
 if result != 0:
 raise FFmpegException('avformat_open_input in ffmpeg_open_filename returned an error opening file '
 + filename.decode("utf8")
 + ' Error code: ' + str(result))

 result = avformat.avformat_find_stream_info(file.context, None)
 if result < 0:
 raise FFmpegException('Could not find stream info')

 return file



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