libavformat

Error inclunding <libavformat/avformat.h> in FFMPEG project on a Mac using clang

跟風遠走 提交于 2019-12-24 21:42:35
问题 I'm having trouble running the remuxing.c example code. I get the following error. I have confirmed that the files can be found in /usr/local/include . I am running macOS Sierra 10.12.6. $ cc -v playground/remuxing.c Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecat ed-objc-isa-usage

How to convert YUV420P image to JPEG using ffmpeg's libraries?

南笙酒味 提交于 2019-12-20 04:15:28
问题 I'm trying to convert a YUV420P image ( AV_PIX_FMT_YUV420P ) to a JPEG using ffmpeg's libavformat and libavcodec . This is my code so far: AVFormatContext* pFormatCtx; AVOutputFormat* fmt; AVStream* video_st; AVCodecContext* pCodecCtx; AVCodec* pCodec; uint8_t* picture_buf; AVFrame* picture; AVPacket pkt; int y_size; int got_picture=0; int size; int ret=0; FILE *in_file = NULL; //YUV source int in_w = 720, in_h = 576; //YUV's width and height const char* out_file = "encoded_pic.jpg"; //Output

FFMpeg copy streams without transcode

旧街凉风 提交于 2019-12-19 03:58:27
问题 I'm trying to copy all streams from several files into one file without transcoding streams. Something you usually do with ffmpeg utility by ffmpeg -i “file_with_audio.mp4” -i “file_with_video.mp4” -c copy -shortest file_with_audio_and_video.mp4 This is the code: int ffmpegOpenInputFile(const char* filename, AVFormatContext **ic) { int ret; unsigned int i; *ic = avformat_alloc_context(); if (!(*ic)) return -1; // Couldn't allocate input context if((ret = avformat_open_input(ic, filename, NULL

How can I turn libavformat error messages off

感情迁移 提交于 2019-12-18 22:14:17
问题 By default, libavformat writes error messages to stderr , Like: Estimating duration from bitrate, this may be inaccurate How can I turn it off? or better yet, pipe it to my own neat logging function? Edit: Redirecting stderr to somewhere else is not acceptable since I need it for other logging purposes, I just want libavformat to not write to it. 回答1: Looking through the code, it appears you can change the behavior by writing your own callback function for the av_log function. From the

Linking libavformat in Visual Studio 2010

≡放荡痞女 提交于 2019-12-18 18:12:32
问题 I'm attempting to build some video-reading code around libavformat. After getting the compiled DLLs and .lib files here, I go to build my code, and the linker can't find any of the libavformat symbols even though I've linked in the provided .lib files. Inspecting libavformat.lib with dumpbin -headers reveals that it exports the desired functions with an underscore prefix. For example, while I want to call avformat_open_input , the .lib file gives _avformat_open_input . Why is this, and why

H.264 muxed to MP4 using libavformat not playing back

南笙酒味 提交于 2019-12-17 22:35:52
问题 I am trying to mux H.264 data into a MP4 file. There appear to be no errors in saving this H.264 Annex B data out to an MP4 file, but the file fails to playback. I've done a binary comparison on the files and the issue seems to be somewhere in what is being written to the footer (trailer) of the MP4 file. I suspect it has to be something with the way the stream is being created or something. Init: AVOutputFormat* fmt = av_guess_format( 0, "out.mp4", 0 ); oc = avformat_alloc_context(); oc-

Unable to store pcm audio in .mp4 container file

北战南征 提交于 2019-12-12 09:35:21
问题 Is it possible to store a pcm audio file into .mp4 file? I used ffmpeg command "ffmpeg -i tempA.wav -acodec copy temp.mp4" but unable to store it in mp4 container file. Input #0, wav, from 'tempA.wav': Duration: 00:01:36.51, bitrate: 128 kb/s Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, s16, 128 kb/s [mp4 @ 0x7d70e0] Tag [1][0][0][0]/0x00000001 incompatible with output codec id '65536' Output #0, mp4, to 'temp.mp4': Stream #0.0: Audio: pcm_s16le, 8000 Hz, 1 channels, 128 kb/s Stream

How to install libavformat.so.56 along with libavformat.so.57?

左心房为你撑大大i 提交于 2019-12-11 11:59:13
问题 I used pip to install opencv3 with the following command on an Anaconda virtual environment. install opencv-python I successfully installed it because I can see the package in pip list. (olfatf)rover@rover_pi:/usr/lib/arm-linux-gnueabihf $ pip list | grep opencv opencv-python 3.4.0.14 However, when I do import cv2, I get the following error: (olfatf)rover@rover_pi:/usr/lib/arm-linux-gnueabihf $ python Python 3.4.3 |Continuum Analytics, Inc.| (default, Aug 21 2015, 00:53:08) [GCC 4.6.3] on

ffmpeg record change color

时间秒杀一切 提交于 2019-12-11 01:28:03
问题 Im try record video from screen, for write to video file im use ffmpeg(libavcodec). But on result i see other colors, my example: AVCodec *codec; AVCodecContext *c= NULL; AVStream *video_stream; AVOutputFormat *out; AVFormatContext *out_context; int i, ret, x, y, got_output; AVFrame *frame; AVPacket pkt; uint8_t endcode[] = { 0, 0, 1, 0xb7 }; printf("Encode video file %s\n", filename); out = av_guess_format(NULL, filename, NULL); if (!out) { std::cout << "Could not deduce output format from

Muxing a H.264 Annex B & AAC stream using libavformat with vcopy/acopy

我与影子孤独终老i 提交于 2019-12-10 11:52:29
问题 I'm doing some integration work with video (H.264) and audio (AAC) from an IP camera. I've made a bit of progress and I can store the video & audio streams individually with the ability to play it back using VLC player. The H.264 is being stored in Annex B format and the audio is using an adts formatted file. I'm now trying to mux the streams into an MP4 file without doing any decoding or encoding but so far haven't managed to find the answer. I can do this manually with ffmpeg: ffmpeg -i