简体   繁体   English

从live555开始并与LIBMAD解码器集成

[英]Starting with live555 and integrating with LIBMAD decoder

I am completely new to MP3 streaming and starting a project with live555 library. 我对MP3流媒体和使用live555库启动项目完全陌生。 I've been able to compile the library with VS 2010 and tried out the example testMP3Streamer. 我已经能够使用VS 2010编译该库,并试用了示例testMP3Streamer。 I can listen to the stream using VLC, and can receive it with the other test program testMP3Receiver. 我可以使用VLC收听流,并可以使用其他测试程序testMP3Receiver接收流。

I am now trying to incorporate a decoder in the live555 MP3 receiver (and eventually an audio player), but can't figure out where to start. 我现在正在尝试在live555 MP3接收器(最终是音频播放器)中加入解码器,但不知道从哪里开始。 I downloaded the libmad decoder, but am not sure how to incorporate it into live555. 我下载了libmad解码器,但不确定如何将其合并到live555中。

I am looking for tips or examples on how to do this 我正在寻找有关如何执行此操作的提示或示例

Any help would be greatly appreciated. 任何帮助将不胜感激。

A starting point could be to remplace the FileSink of testMP3Receiver.cpp with the DummySink from testRTSPClient.cpp. 一个开始可能是用testRTSPClient.cpp中的DummySink替换testMP3Receiver.cpp的FileSink。

Doing this, you will get data implementing the method 这样做,您将获得实现该方法的数据

void DummySink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes,
struct timeval presentationTime, unsigned durationInMicroseconds);

I have been using extensively live555 this year , starting from scratch. 我从头开始一直在广泛使用live555。

I truly think that one of the best place to read some working code for several types of stream (video , Audio ) and several encoders is in the test programs folder that you can find here 我确实认为,针对几种类型的流(视频,音频)和几种编码器,阅读一些工作代码的最佳地方之一是测试程序文件夹,您可以在这里找到

Then it is really easy when you start understanding how this library works. 然后,当您开始了解该库的工作原理时,这真的很容易。

Typically , if you want to insert a decoder you are on a client. 通常,如果要插入解码器,则您在客户端上。 You must know that all the data received (actual data , not the RTSP commands) ends up in the "sink" 您必须知道,所有收到的数据(实际数据,不是RTSP命令)最终都在“接收器”中

You can then subclass this sink (several example are presents in the link that i gave you) and implement your decoder here. 然后,您可以对该接收器进行子类化(在我给您的链接中提供了几个示例),并在此处实现您的解码器。

Take a look at the video decoders example in testRTSPClient for example , i know it is for video but it is some self explaining code , you should have a good starting point there. 以testRTSPClient中的视频解码器示例为例,我知道它是用于视频的,但是它是一些自解释代码,您应该在那里有一个很好的起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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