简体   繁体   中英

Re-encode with ffmpeg

I am trying to do following work in C code with the help of ffmpeg library

  1. Decode a mp2 audio file.
  2. Write decoded data to a file named test.sw
  3. Read data from test.sw and re-encode it to mp2 audio file.

For 1 and 2, i followed example given in decoding_encoding.c which is working fine. While reading and re-encoding, i can't understand how to read from test.sw file and encode it. Can anybody help me with that? It will help me a lot if anybody can provide me any tutorial regarding this topic.

As I understood your question you want to encode to mp2 format.I suggest to use the encoding technique used for mp2 format and use the library ,You have one library ffmpeg just check is it having for encoding .If yes then just use that function and pass your decoded file.

You can check it

http://ffmpeg.org/doxygen/trunk/encoding-example_8c-source.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM