Questions tagged [libavcodec]

libavcodec is a free software/open source LGPL-licensed library of codecs for encoding and decoding video and audio data.

509 questions
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

libavcodec get video duration and framerate

I have a video encoded in .3gp h.264 and I am looking to get its framerate and duration in C. Here is the code I use after opening the file and finding the appropriate codecs: AVRational rational = gVideoCodecCtx->time_base; LOGI(10, "numerator is…
tishu
  • 998
  • 15
  • 29
5
votes
1 answer

Why decoding frames from avi container and encode them to h264/mp4 doesn't work?

I started using ffmpeg and I want to convert avi file to mp4/h264 file. I've read many posts including this, but I couldn't find any good example how to save frames to mp4 file. The code below is simplified one that decodes frames from avi file and…
theateist
  • 13,879
  • 17
  • 69
  • 109
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
1 answer

Inserting User Data in Mpeg stream

Is 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?
hzrari
  • 1,803
  • 1
  • 15
  • 26
4
votes
1 answer

Convert raw image buffer into JPEG using LIBAVCODEC

I have a raw image buffer (in memory) captured from a camera that I want to convert into JPEG (for reducing size). The problem is that saving these images into .pgm format results into a huge file size that I can't afford due to the memory…
user846400
  • 1,061
  • 1
  • 17
  • 25
4
votes
4 answers

Tell libavcodec/ffmpeg to drop frame

I'm building an app in which I create a video. Problem is, sometime (well... most of the time) the frame acquisition process isn't quick enough. What I'm currently doing is to skip the current frame acquisition if I'm late, however FFMPEG/libavcodec…
chouquette
  • 971
  • 1
  • 7
  • 12
4
votes
0 answers

ffmpeg CMAF support for mpeg-dash

All, I am trying remux an mp4 as a segmented mpeg-dash stream. I am using libavcodec and the code is exactly like leandromoreira's example, updated to C++14. By setting av_dict_set(&opts, "movflags", "frag_keyframe+empty_moov+default_base_moof",…
Hobo Joe
  • 125
  • 1
  • 7
4
votes
1 answer

Seeking by bytes in FFmpeg

I will appreciate your advice on the following. I'am developing a video converter which based on FFmpeg's libavformat, and I need to implement an accurate seeking API. First of all, I developed an indexer of video stream which just saves a…
Yury
  • 1,169
  • 2
  • 16
  • 29
4
votes
3 answers

How can I determine if a codec / container combination is compatible with FFmpeg?

I'm looking at re-muxing some containers holding audio and video such that I extract the best, first audio stream, and store it in a new container where e.g. only the audio stream is present. The output context for FFmpeg is created like…
Dan
  • 1,258
  • 1
  • 10
  • 22
4
votes
1 answer

Wma decoding with ffmpeg

I am new to ffmpeg and I tried using api-example.c to decode wma files. However when I run the program, it gave me an error saying "frame_len overflow". Does anyone know how to fix this error? Here is my code: extern "C" { #include…
Izak
  • 41
  • 1
  • 3
4
votes
1 answer

Decoding opus using libavcodec from FFmpeg

I am trying to decode opus using libavcodec. I am able to do it using libopus library alone. But I am trying to acheive same using libavcodec. I am trying to figure it out Why its not working in my case. I have an rtp stream and trying to decode it.…
Abu
  • 213
  • 5
  • 14
4
votes
1 answer

How to write AVFrame out as JPEG image

I'm writing a program to extract images from a video stream. So far I have figured out how to seek to the correct frames, decode the video stream, and gather the relevant data into an AVFrame struct. I'm now trying to write the data out as a JPEG…
John Allard
  • 3,564
  • 5
  • 23
  • 42
4
votes
0 answers

Can't detect bad/corrupted video frames when reading video file with ffmpeg libraries

I recently started to use ffmpeg C libraries in order to analyze the integrity of video frames in a file. I started (like a lot of people) with Dranger's tutorials, then I made my own research from them. But I have a problem: I can't detect…
Nextor
  • 95
  • 1
  • 1
  • 7
4
votes
2 answers

FFmpeg decoding .mp4 video file

I'm working on a project that needs to open .mp4 file format, read it's frames 1 by 1, decode them and encode them with better type of lossless compression and save them into a file. Please correct me if i'm wrong with order of doing things, because…
Sir DrinksCoffeeALot
  • 593
  • 2
  • 11
  • 20