as you said

I checked the testOnDemandRTSPServer demo application,

I also read the FAQ about liveInput-unicast several times.


I also implemented and checked a simple sample program.


1. Like the testOnDemandRTSPServer demo application, I implemented a file streaming demo program using the H264VideoFileServerMediaSubsession object and confirmed that it operates normally.


2. For real-time streaming, I followed the FAQ about liveInput-unicast.

I created a MyH264LiveServerMediaSubsession object that inherits OnDemandServerMediaSubsession and redefined two pure virtual functions.

The doGetNextFrame function should be called when the camera is connected properly, but it is not working.

Since doGetNextFrame is not called, camera frame data cannot be processed or transmitted.


No matter how much I think about it, I can't figure out what the problem is.

I sincerely ask for your help.
I am attaching a simplified sample code.


/************************ main ***************************************************/

#include "MyH264LiveServerMediaSubsession.h"


main(){

    TaskScheduler* scheduler = BasicTaskScheduler::createNew();

    UsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler);


    RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554);

    if (rtspServer == NULL) {

        *env << "Failed to create RTSP server: " << env->getResultMsg() << "\n";

        return -1;

    }


    ServerMediaSession* sms = ServerMediaSession::createNew(*env, "ggg", "Live Stream", "Live stream from webcam");

    sms->addSubsession(MyH264LiveServerMediaSubsession::createNew(*env));

    //sms->addSubsession(H264VideoFileServerMediaSubsession::createNew(*env, "D:\\1.264", false));

    rtspServer->addServerMediaSession(sms);


    *env << "RTSP stream ready at rtsp://localhost:8554/ggg\n";


    env->taskScheduler().doEventLoop();

    return 0;

}

/*********************** MyH264LiveServerMediaSubsession.h ****************************************************/

#include "MyH264LiveSource.h"



class MyH264LiveServerMediaSubsession : public OnDemandServerMediaSubsession {

public:

    static MyH264LiveServerMediaSubsession* createNew(UsageEnvironment& env) {

        return new MyH264LiveServerMediaSubsession(env);

    }


protected:

    MyH264LiveServerMediaSubsession(UsageEnvironment& env)

        : OnDemandServerMediaSubsession(env, true) {

    }


    virtual ~MyH264LiveServerMediaSubsession() {

    }


    virtual FramedSource* createNewStreamSource(unsigned /*clientSessionId*/, unsigned& estBitrate) {

        return MyH264LiveSource::createNew(envir());

    }


    virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, unsigned char rtpPayloadTypeIfDynamic, FramedSource* /*inputSource*/) {

        return H264VideoRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic);

        //return SimpleRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic, 90000, "video", "H264", 1, true, false);

    }

};


/*********************** MyH264LiveSource.h ****************************************************/

class MyH264LiveSource : public FramedSource {

public:

    static MyH264LiveSource* createNew(UsageEnvironment& env) {

        return new MyH264LiveSource(env);

    }


protected:

    MyH264LiveSource(UsageEnvironment& env)

        : FramedSource(env) {

    }


    virtual ~MyH264LiveSource() {}


    virtual void doGetNextFrame() {

        envir() << "Process Data\n";

        FramedSource::afterGetting(this);

    }


};

   

강현구

책임연구원 / S/W개발팀

Hyungu Kang

 

Senior Research Engineer / S/W R&D Team

www.autol.co.kr

T 070-4228-1071 F 031-702-5314 M 010-8584-8093 E hyungu.k...@autol.co.kr

13453 경기도 성남시 수정구 금토로 80번길 11, 판교이노베이션랩 지식산업센터 305

305, 11 Geumto-ro 80beon-gil, Sujeong-gu, Seongnam-si, Gyeonggi-do, 13453, Republic of Korea

이 메시지(첨부파일 포함)는 지정된 수신인에게만 전달될 목적으로 발송되었으며, 부정경쟁방지 및 영업비밀의 보호에 관한 법률 등 관계법령에 따라 법으로 보호되는 중요한 정보를 담고 있을 수 있습니다. 이 메시지와 첨부파일 등에 있어서, 공개, 복사, 배포 또는 기재된 내용을 근거로 한 일체의 행동 등의 2차 활용에 대해서는 메일 발신자에게 확인을 받아야 하며, 메일 발신자의 확인이 없는 2차 활용은 엄격히 금지되어 있음을 주지하시기 바랍니다. 만약 이 메시지가 잘못 전송되었을 경우, 발신인 또는 당사에 알려주시고, 본 메시지를 즉시 삭제하여 주시기 바랍니다.

This message (including attachments) contains confidential information intended for a specific individual and purpose and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.





----- Original Message -----------------------------------
From : "Ross Finlayson" <finlay...@live555.com>
To : "LIVE555 Streaming Media - development & use" <live-de...@us.live555.com>
Cc :
Sent : "2024-06-26T10:38:40"
Subject : "RE: Re: [Live-devel] Technical inquiry"



> On Jun 25, 2024, at 6:31 PM, 강현구 <hyungu.k...@autol.co.kr> wrote:
>
> Thank you for your quick reply.
>
> I want to stream via IP unicast.
> For this purpose, I am inheriting and using the OnDemandServerMediaSubsession object.
>
> You said I was using mixed code.
> Please explain what part is wrong or what part of the code is for multicast streaming.

The part of your code where you
- chose a random IP multicast address, and
- created a “Groupsock” object that uses that address
This code is useful only when you are streaming via multicast.


> P.S. I checked the testOnDemandRTSPServer demo program, but I didn't get the information I wanted because it was an example of streaming file data.

Nonetheless, you should use that code as a model for your application. See http://live555.com/liveMedia/faq.html#liveInput-unicast


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel



_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to