libavcodec

Encode audio to aac with libavcodec

夙愿已清 提交于 2019-11-27 13:08:28
问题 I'm using libavcodec (latest git as of 3/3/10) to encode raw pcm to aac (libfaac support enabled). I do this by calling avcodec_encode_audio repeatedly with codec_context->frame_size samples each time. The first four calls return successfully, but the fifth call never returns. When I use gdb to break, the stack is corrupt. If I use audacity to export the pcm data to a .wav file, then I can use command-line ffmpeg to convert to aac without any issues, so I'm sure it's something I'm doing wrong

Raw H264 frames in mpegts container using libavcodec

天大地大妈咪最大 提交于 2019-11-27 10:28:10
I would really appreciate some help with the following issue: I have a gadget with a camera, producing H264 compressed video frames, these frames are being sent to my application. These frames are not in a container, just raw data. I want to use ffmpeg and libav functions to create a video file, which can be used later. If I decode the frames, then encode them, everything works fine, I get a valid video file. (the decode/encode steps are the usual libav commands, nothing fancy here, I took them from the almighty internet, they are rock solid)... However, I waste a lot of time by decoding and

Problem to Decode H264 video over RTP with ffmpeg (libavcodec)

旧街凉风 提交于 2019-11-27 09:38:19
问题 I set profile_idc, level_idc, extradata et extradata_size of AvCodecContext with the profile-level-id et sprop-parameter-set of the SDP. I separate the decoding of Coded Slice, SPS, PPS and NAL_IDR_SLICE packet : Init: uint8_t start_sequence[]= {0, 0, 1}; int size= recv(id_de_la_socket,(char*) rtpReceive,65535,0); Coded Slice : char *z = new char[size-16+sizeof(start_sequence)]; memcpy(z,&start_sequence,sizeof(start_sequence)); memcpy(z+sizeof(start_sequence),rtpReceive+16,size-16);

FFmpeg decode raw buffer with avcodec_decode_video2

旧巷老猫 提交于 2019-11-27 05:46:02
问题 I am receiving a h264 stream where I at least know the size of one frame. The stream is coming in right as I can store it in a file and playback with vlc. Playing back a file is no problem for me as I include the libavformat. But libavformat gives me back an AVPacket which I can directly give to avcodec_decode_video2. In this case I got a bytestream. How can I give the raw h264 stream to the avcodec_decode_video2? How can I wrap my data into a AVPacket. VLC does not need to guess any data.

Can FFmpeg be used as a library, instead of a standalone program?

耗尽温柔 提交于 2019-11-26 19:32:40
I'd like to add video conversion capabilities to a program I'm writing. FFmpeg's command line interface for doing this is simply ffmpeg -i InputFile OutputFile , but is there a way to make use of it as a library, so I can do something like ffmpeg_convert(InputFile, OutputFile) ? I'm hoping I won't have to use libavcodec directly, as I imagine it will be far more complex than a one-line function to convert between formats. If FFmpeg can't be easily retrofitted to do this, is there perhaps another library based on it that does? I've heard of libvlc, but that seems to only expose a video playing

Raw H264 frames in mpegts container using libavcodec

不打扰是莪最后的温柔 提交于 2019-11-26 17:56:52
问题 I would really appreciate some help with the following issue: I have a gadget with a camera, producing H264 compressed video frames, these frames are being sent to my application. These frames are not in a container, just raw data. I want to use ffmpeg and libav functions to create a video file, which can be used later. If I decode the frames, then encode them, everything works fine, I get a valid video file. (the decode/encode steps are the usual libav commands, nothing fancy here, I took

Can FFmpeg be used as a library, instead of a standalone program?

拟墨画扇 提交于 2019-11-26 06:16:49
问题 I\'d like to add video conversion capabilities to a program I\'m writing. FFmpeg\'s command line interface for doing this is simply ffmpeg -i InputFile OutputFile , but is there a way to make use of it as a library, so I can do something like ffmpeg_convert(InputFile, OutputFile) ? I\'m hoping I won\'t have to use libavcodec directly, as I imagine it will be far more complex than a one-line function to convert between formats. If FFmpeg can\'t be easily retrofitted to do this, is there