What i want is
1. Get video packet from stream source
2. Decode it
3. And write that decoded data as video file(avi, mpeg etc)
I can ab
you need to write an encoder to convert raw data to required video format
ffmpeg encoding sample wanted?
Encode audio to aac with libavcodec
Now there's a new example of video transcoding in doc/examples/transcoding.c of FFmpeg trunk, and it does exactly what you need: API example for demuxing, decoding, filtering, encoding and muxing.
This is for the current ffmpeg 2.4.4
I did something like this at some point using libx264 and vorbis.
A code example. https://github.com/Themaister/SSNES/blob/master/record/ffemu.c
The basic idea is that you have to set timestamps yourself in the AVFrame
when you want to encode it. Then you can take that packet and write it with av_interleaved_write()
.