2

I'm trying to demux an RTSP stream and remux it into a TS file, using libavformat, libavcodec,etc., copying the video and transcoding the audio. If I use ffmpeg, the command is roughly like this:

ffmpeg -rtsp_transport tcp -re -fflags +genpts -i rtsp://10.0.0.42/channel1 -vcodec copy -copyts -bsf dump_extra -acodec libfdk_aac -b:a 16k -ac 1 -map 0:0 -map 0:1 -f mpegts out.ts

I've looked at the muxing/demuxing examples, but aside from having difficulty understanding how to make a stream copy, I can't find any mention of bitstream filters. I'm currently getting the following error:

[mpegts @ 0x7ff20c009600] H.264 bitstream malformed, no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_mp4toannexb)

How do I create a bitstream filter and how do I assign it? Do I assign it to the input stream, or the output stream?

4

2 回答 2

4

可悲的是,比特流过滤器的文档不足,但不应该那么难弄清楚。最简单的方法可能只是模拟 avconv 所做的事情—— setup,然后在混合之前过滤器应用于每个数据包。

于 2013-06-02T06:45:12.987 回答
0

您可以在此处找到 MPEG-2 TS 简短描述http://wiki.multimedia.cx/index.php?title=MPEG-2_Transport_Stream 示例 TS 文件(用于 h.264):http ://samples.mplayerhq.hu /V-编解码器/h264/

但是你的问题不清楚。你到底想做什么?您想为 TS 创建自己的复用器吗?

BR,亚历山大

于 2013-05-29T09:02:59.883 回答