I am using ffmpeg to send ts file via udp. Command used for FFMPEG is :
ffmpeg -i output.ts -f mpegts udp://127.0.0.1:1135

And i have used TestOnDemandRTSPServer.cpp which is attached. But when recieved RTSP on "rtsp://192.168.100.217:8554/mpeg2Ts" via openRTSP , the resultant output file is not valid.

Kindly suggest me, if i am doing something wrong.

Please find attachment.


Regards
Taha

Mohammad Taha; Sr. Software Developer;
Wow Vision India Pvt. Ltd;

On 2017-01-06 15:54, Ross Finlayson wrote:
Yes i am using “mpeg2TransportStreamFromUDPSourceTest” example code(i.e., lines 404-430 of “testOnDemandRTSPServer.cpp”) and my input source is MPEG Transport Stream data. When i set inputStreamIsRawUDP = False i got that warning, but when i set inputStreamIsRawUDP = True no warning message displayed and no data is displayed on VLC with
RTSP : "rtsp://192.168.100.217:8554/mpeg2Ts”.

We can’t help you with problems with VLC; it is not our software.

However, I suggest that you first use “openRTSP”
<http://www.live555.com/openRTSP/> as your RTSP client.  If you do
this, you should receive (from “openRTSP”) a file that contains the
Transport Stream data that was being sent.  (If you rename that file
to have a “.ts” filename suffix, then you should be able to play it.)


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
// TestOnDemandRTSPServer.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"


UsageEnvironment* env;

int main(int argc, char** argv) {
  // Begin by setting up our usage environment:
  TaskScheduler* scheduler = BasicTaskScheduler::createNew();
  env = BasicUsageEnvironment::createNew(*scheduler);

  UserAuthenticationDatabase* authDB = NULL;
#ifdef ACCESS_CONTROL
  // To implement client access control to the RTSP server, do the following:
  authDB = new UserAuthenticationDatabase;
  authDB->addUserRecord("username1", "password1"); // replace these with real strings
  // Repeat the above with each <username>, <password> that you wish to allow
  // access to the server.
#endif

  // Create the RTSP server:
  RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554, authDB);
  if (rtspServer == NULL) {
    *env << "Failed to create RTSP server: " << env->getResultMsg() << "\n";
    exit(1);
  }

  char const* descriptionString
    = "Session streamed by \"testOnDemandRTSPServer\"";


  // A MPEG-2 Transport Stream, coming from a live UDP (raw-UDP or RTP/UDP) source:
  {
    char const* streamName = "mpeg2Ts";
    char const* inputAddressStr = NULL;//"127.0.0.1";
        // This causes the server to take its input from the stream sent by the "testMPEG2TransportStreamer" demo application.
        // (Note: If the input UDP source is unicast rather than multicast, then change this to NULL.)
    portNumBits const inputPortNum = 1135;
        // This causes the server to take its input from the stream sent by the "testMPEG2TransportStreamer" demo application.
    Boolean const inputStreamIsRawUDP = True; 
    ServerMediaSession* sms
      = ServerMediaSession::createNew(*env, streamName, streamName,
				      descriptionString);
    sms->addSubsession(MPEG2TransportUDPServerMediaSubsession
		       ::createNew(*env, inputAddressStr, inputPortNum, inputStreamIsRawUDP));
    rtspServer->addServerMediaSession(sms);

    char* url = rtspServer->rtspURL(sms);
    *env << "\n\"" << streamName << "\" stream, from a UDP Transport Stream input source \n\t(";
    if (inputAddressStr != NULL) {
      *env << "IP multicast address " << inputAddressStr << ",";
    } else {
      *env << "unicast;";
    }
    *env << " port " << inputPortNum << ")\n";
    *env << "Play this stream using the URL \"" << url << "\"\n";
    delete[] url;
  }

  // Also, attempt to create a HTTP server for RTSP-over-HTTP tunneling.
  // Try first with the default HTTP port (80), and then with the alternative HTTP
  // port numbers (8000 and 8080).

  if (rtspServer->setUpTunnelingOverHTTP(80) || rtspServer->setUpTunnelingOverHTTP(8000) || rtspServer->setUpTunnelingOverHTTP(8080)) {
    *env << "\n(We use port " << rtspServer->httpServerPortNum() << " for optional RTSP-over-HTTP tunneling.)\n";
  } else {
    *env << "\n(RTSP-over-HTTP tunneling is not available.)\n";
  }

  env->taskScheduler().doEventLoop(); // does not return

  return 0; // only to prevent compiler warning
}
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to