Questions tagged [libav]

libav (or libav*) is the collective name of the FFmpeg libraries: libavcodec, libavformat, libavfilter, libavutil, etc. The name has also been appropriated by the Libav project–a fork of FFmpeg.

591 questions
5
votes
1 answer

How do I pre-allocate the memory for libavcodec to write decoded frame data?

I am trying to decode a video with libav by following the demo code: here I need to be able to control where the frame data in pFrame->data[0] is stored. I have tried setting pFrame->data to my own buffer as follows: // Determine required buffer…
gurugulu
  • 101
  • 8
5
votes
1 answer

ffmpeg Resource temporarily unavailable

I'm trying to encode an audio frame using ffmpeg library and Opus codec but i faced with this error : Resource temporarily unavailable My source code : void encode_audio(uint8_t *frame , int frame_size , void (*onPacket)(uint8_t *packet , int…
KoLiBer
  • 194
  • 4
  • 15
5
votes
2 answers

Cleaning up after av_frame_get_buffer

There are two aspects of my question. I'm using libav, ffmpeg, 3.1. First, how do you appropriately dispose of a frame whose buffer has been allocated with av_frame_get_buffer? E.g.: AVFrame *frame = av_frame_alloc(); frame->width =…
Jason C
  • 38,729
  • 14
  • 126
  • 182
5
votes
3 answers

Streaming audio and video in sync for mp4 container using Gstreamer framework

I am new to gstreamer and I want to stream a mp4 video which is having audio and video both from my Host(Ubuntu PC) to target board. I have successfully streamed only video. But streaming both(audio and video) is not happening. Pipeline to stream…
Sandeep Kumar
  • 336
  • 1
  • 3
  • 9
5
votes
0 answers

Transcoding videos with LibAvFormat for playback on iOS devices

I’m trying to transcode a video on my iOS app using FFMpeg/LibAv. What I’m trying to accomplish is to transcode a video in order to resize each frame and possibly lower the bitrate in order to save valuable MB in the device. The resulting video…
user361526
  • 3,333
  • 5
  • 25
  • 36
5
votes
1 answer

How to trim a file with FFMpeg programmatically? (libavformat, avutils, ...)

I'm building an iOS app where re-encoding and trimming a video in the background is necessary. I can not use iOS libraries (AVFoundation) since they rely on the GPU and no app can access the GPU if it's backgrounded. Due to this issue I switched to…
user361526
  • 3,333
  • 5
  • 25
  • 36
5
votes
1 answer

Ffmpeg, avconv and sameq

Earlier I wrote so: ffmpeg -i input.mp4 -sameq output.mp3 ...and thus receive audio from video file. Ffmpeg just taken out or converted audio to mp3 with an appropriate quality. All thanks to key: -sameq [use same quantizer as source] Now in…
xiaose
  • 616
  • 1
  • 7
  • 19
5
votes
4 answers

How to decode AAC using avcodec_decode_audio4?

I changed in my code avcodec_decode_audio3 to avcodec_decode_audio4 and added the frame handling. But now I cannot decode AAC frames anymore. Why does avcodec_decode_audio4 return -22 (invalid argument)? Following the answer below, does this have…
user2212461
  • 3,105
  • 8
  • 49
  • 87
5
votes
2 answers

Muxing AVPackets into mp4 file

I am developing a tool which receives a h.264 live stream from the network (the sender is a hardware encoder), buffers the last x-minutes and creates a video file of the last x-minutes if triggered. My tool is able to receive the live stream and…
Olgen2013
  • 51
  • 1
  • 1
  • 5
5
votes
2 answers

Files created with a direct stream copy using FFmpeg's libavformat API play back too fast at 3600 fps

I am working on a libavformat API wrapper that converts MP4 files with H.264 and AAC to MPEG-TS segments suitable for streaming. I am just doing a simple stream copy without re-encoding, but the files I produce play the video back at 3600 fps…
Chris Ballinger
  • 796
  • 8
  • 20
5
votes
1 answer

ffmpeg/libavcodec memory management

The libavcodec documentation is not very specific about when to free allocated data and how to free it. After reading through documentation and examples, I've put together the sample program below. There are some specific questions inlined in the…
Jason C
  • 38,729
  • 14
  • 126
  • 182
5
votes
2 answers

Segmentation fault while avcodec_encode_video2

I have some problems while trying to encode a AVFrame to a packet. Before reading the whole code, the input stuff is working, I tested it. The output stuff is from an example here. I think there is the problem. But the segmentation fault occurs in…
user1810087
  • 5,146
  • 1
  • 41
  • 76
5
votes
1 answer

Extracting text subtitles using ffmpeg libraries

I'm writing a C program that uses the ffmpeg's libav* libs, and using Dranger's tutorial, I can decode both audio and video correctly. Currently, I'm trying to extract subtitles. I actually don't want to decode them on time and display them on the…
John Smith
  • 396
  • 1
  • 3
  • 10
5
votes
4 answers

Linker error when unit testing: ld: illegal text-relocation to cstring in ... from _av_image_check_size in .../libavutil.a(imgutils.o)

In Xcode 4.3.2, building an iPad app, which includes libavutil.a from the ffmpeg distribution, it builds and runs correctly but when I try to run unit tests (Cmd-U) I get the following linker error: ld: illegal text-relocation to cstring in…
user1499742
  • 161
  • 1
  • 5
4
votes
1 answer

FFMPEG API (compiling with specific formats)

I am trying to compile FFMPEG to support a single video type (*.mp4). I have everything working when I compile for all, but I do not want the extra over-head when I will only use a single format. Here's my compile FLAGS now (non-working for MP4). I…
JS.
  • 171
  • 4
  • 15