Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
which ffmpeg version for cobalt on arm ?
28 novembre 2016, par user7160805when we build cobalt with arm toolchain, we got some error compilation messages as below. ffmpeg_video_decoder.cc:41:33: error: 'PIX_FMT_YUV420P' was not declared in this scope ffmpeg_video_decoder.cc:61:10: error: 'AVFrame {aka struct AVFrame}' has no member named 'base'
ffmpeg version we try are "3.2" and "3.0.2" but they got above error message. we search ffmpeg header files for these error messages, seem ffmpeg check (LIBAVUTIL_VERSION_MAJOR < 53) in "libavutil/version.h".
could you give us some suggestion?
-
Finding library during compilation in mingw64 environment (libgcrypt and libgpg-error)
28 novembre 2016, par AlastairI'm a real beginner at this, so apologies in advance for obvious questions. I'm trying to compile a custom build of ffmpeg that has some extra dependencies the normal build does not. Among those is
libgcrypt
andlibgpg-error
- I know this, because when I runconfigure
, it fails, and the log contains:C:/workspace/windows/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcrypt C:/workspace/windows/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgpg-error
With this in mind, I cloned the repo for libgpg-error, ran
make
andmake install
, which createdlibgpg-error.dll.a
andlibgpg-error.la
in/home/myuser/w64root/lib
. I've tried adding this path to my$LIB
environment variable, but the configure run still says it can't find the library.How can I make it visible? I also have
pkg-config
available on the machine - would manually creating a.pc
file help me any?Thanks!
-
Inserting User Data in Mpeg stream
28 novembre 2016, par hzrariIs there any way to insert User Data (Start code = 0X1B2) in a MPEG stream? What I am looking for is a simple tool, script or some tips using and Hex Editor...
Or you may have a patch for ffmpeg (libavcodec and libavformat) that allows to do that?
-
Remuxing RTMP stream into mpegts using ffmpeg
28 novembre 2016, par maziar esfandiarpoorSo I'm trying to remux a live rtmp stream which is in flv format into mpegts. My code is working; however it stops after like an hour without any errors, it just stucks at av_read_frame! And I know for sure that there is nothing wrong with the rtmp stream beacause I can play it with ffplay for hours and it keeps running without any problems.
AVOutputFormat *ofmt = NULL; AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL; AVPacket pkt; int ret, i; //custom avio AVIOContext *avio_ctx = NULL; uint8_t *avio_ctx_buffer = NULL; av_register_all(); avformat_network_init(); ifmt_ctx = avformat_alloc_context(); av_dump_format(ifmt_ctx, 0, input_pipe_name.c_str(), 0); if ((ret = avformat_open_input(&ifmt_ctx,"rtmp_url", 0, NULL)) < 0) { printf( "Could not open rtmp url."); return 1; } if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0) { printf( "Failed to retrieve input stream information"); return 1; } av_dump_format(ifmt_ctx, 0, "rtmp_url", 0); avformat_alloc_output_context2(&ofmt_ctx, NULL, "mpegts", NULL); if (!ofmt_ctx) { printf( "Could not create output context\n"); ret = AVERROR_UNKNOWN; return 1; } ofmt = ofmt_ctx->oformat; for (i = 0; i < ifmt_ctx->nb_streams; i++) { //Create output AVStream according to input AVStream AVStream *in_stream = ifmt_ctx->streams[i]; AVStream *out_stream = avformat_new_stream(ofmt_ctx, in_stream->codec->codec); if (!out_stream) { printf( "Failed allocating output stream\n"); ret = AVERROR_UNKNOWN; return 1; } //Copy the settings of AVCodecContext if (avcodec_copy_context(out_stream->codec, in_stream->codec) < 0) { printf( "Failed to copy context from input to output stream codec context\n"); return 1; } out_stream->codec->codec_tag = 0; if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER) out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; } AVStream *in_stream, *out_stream; if (avformat_write_header(ofmt_ctx, NULL) < 0) { printf( "Error occurred when opening output file\n"); return 1; } while (!force_stop) { ret = av_read_frame(ifmt_ctx, &pkt); in_stream = ifmt_ctx->streams[pkt.stream_index]; out_stream = ofmt_ctx->streams[pkt.stream_index]; pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX)); pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX)); pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base); pkt.pos = -1; av_interleaved_write_frame(ofmt_ctx, &pkt) av_free_packet(&pkt); }
-
Finding library during compliation in mingw64 environment (libgcrypt and libgpg-error)
28 novembre 2016, par AlastairI'm a real beginner at this, so apologies in advance for obvious questions. I'm trying to compile a custom build of ffmpeg that has some extra dependencies the normal build does not. Among those is
libgcrypt
andlibgpg-error
- I know this, because when I runconfigure
, it fails, and the log contains:C:/workspace/windows/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcrypt C:/workspace/windows/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgpg-error
With this in mind, I cloned the repo for libgpg-error, ran
make
andmake install
, which createdlibgpg-error.dll.a
andlibgpg-error.la
in/home/myuser/w64root/lib
. I've tried adding this path to my$LIB
environment variable, but the configure run still says it can't find the library.How can I make it visible? I also have
pkg-config
available on the machine - would manually creating a.pc
file help me any?Thanks!