FFmpeg How to write video to a file

后端 未结 3 982
走了就别回头了
走了就别回头了 2020-12-24 15:38

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

相关标签:
3条回答
  • 2020-12-24 16:08

    you need to write an encoder to convert raw data to required video format

    ffmpeg encoding sample wanted?

    Encode audio to aac with libavcodec

    0 讨论(0)
  • 2020-12-24 16:14

    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

    0 讨论(0)
  • 2020-12-24 16:16

    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().

    0 讨论(0)
提交回复
热议问题