开发者

Using ffmpeg to convert video in c++ streaming server

开发者 https://www.devze.com 2023-03-16 21:23 出处:网络
I can\'t understand how use libavcodec to convert, for example, from avi to h.26开发者_C百科4. Can I convert video in my C++ program in this way:

I can't understand how use libavcodec to convert, for example, from avi to h.26开发者_C百科4. Can I convert video in my C++ program in this way:

file=popen("ffmpeg -i file.avi file.m4v");

Can I use this function to dynamically stream without waiting to finish a video converting process?


You can not stream a m4v file while it is being transcoded. ffmpeg writes metadata at the end of the transcoding process which is needed to stream a video. After finished conversion you have to use MP4Box or qt-fatsstart to put this metadata at the beginning. If you still want to stream video while conversion going on, I think you have to convert the video to MPEG transport stream (mpeg-ts) format.

0

精彩评论

暂无评论...
验证码 换一张
取 消