Discussion:
[Live-devel] testOnDemandRTSPServer always stream audio/MPA and video/MPV ?
e***@fibertel.com.ar
2011-01-26 13:00:37 UTC
Permalink
Hello,

I'm seeing something that I consider weird.
I downloaded a lot of .mpg files which I'm streaming using testOnDemandRTSPServer. I run it and then launch openRTSP with '-q' arg to obtain a mov file.
When openRTSP open the stream I see:

Created receiver for "video/MPV" subsession (client ports 53502-53503)
Created receiver for "audio/MPA" subsession (client ports 42830-42831)
Setup "video/MPV" subsession (client ports 53502-53503)
Setup "audio/MPA" subsession (client ports 42830-42831)
Warning: We don't implement a QuickTime Video Media Data Type for the "MPV" track, so we'll insert a dummy "????" Media Data Atom instead. A separate, codec-specific editing pass will be needed before this track can be played.
Warning: We don't implement a QuickTime Audio Media Data Type for the "MPA" track, so we'll insert a dummy "????" Media Data Atom instead. A separate, codec-specific editing pass will be needed before this track can be played.
Started playing session
Receiving streamed data (signal with "kill -HUP 22469" or "kill -USR1 22469" to terminate)...

Which result in a .mov file that cannot be playable, afaik because openRTSP insert a dummy media atom instead correct one. This happen with ALL mpg files I tried.


If I do a ffmpeg -i test.mpg:
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Mar 4 2010 12:35:30, gcc: 4.4.3
Input #0, mpegvideo, from 'test.mpg':
Duration: 00:00:00.00, bitrate: 104867 kb/s
Stream #0.0: Video: mpeg1video, yuv420p, 400x400 [PAR 1:1 DAR 1:1], 104857 kb/s, 30 tbr, 1200k tbn, 30 tbc

This happen with a lot of mpg that I tried.
My question is, what do I need to do to stream a mpg file and then be able to open it with openRTSP and obtain a valid .mov file?

Thanks in advance,

Jonathan
Ross Finlayson
2011-01-29 08:16:02 UTC
Permalink
Post by e***@fibertel.com.ar
I'm seeing something that I consider weird.
There's nothing "weird" about this. The diagnostic output is quite
clear about what the software is doing (or more precisely, is not
doing) in this case.
Post by e***@fibertel.com.ar
Warning: We don't implement a QuickTime Video Media Data Type for
the "MPV" track, so we'll insert a dummy "????" Media Data Atom
instead. A separate, codec-specific editing pass will be needed
before this track can be played.
Our "QuickTimeFileSink" code (which implements the writing of ".mov"
and ".mp4" files) currently doesn't include a mechanism for properly
storing MPEG-1 or 2 video or audio tracks. (It supports several
other codecs - including MPEG-4 and H.264 video, and MPEG-4 (AAC),
PCM, GSM and QCELP audio - but not (yet) MPEG-1 or 2 video or audio.
Post by e***@fibertel.com.ar
My question is, what do I need to do to stream a mpg file and then
be able to open it with openRTSP and obtain a valid .mov file?
You would need to update the "QuickTimeFileSink" code to implement
MPEG-1 or 2 video and audio. If you do this, feel free to contribute
a patch.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
e***@fibertel.com.ar
2011-01-31 14:24:43 UTC
Permalink
Ross,

Thanks for your answer.

I understand what you say, after sending that mail I start checking the 'stream process' and I found the codecs problems and also why it's using always MPA/MPV.

My question now changes, I need to stream a video+audio file, I have a .mpg file but I can convert it to any other format with any codec that fit the QuickTimeFileSink object.

You mentioned MPEG4 video and AAC audio, suppose I convert my video to use those codecs, then how can I stream that video+audio file? I ask this because testOnDemandRTSPServer will not help, neither testMPEG4VideoStreamer.

So, is there any way to stream a MPEG4+AAC file with live555? and should openRTSP open that stream and create a .mov file correctly?

I will start reading about add MPEG-1 or 2 support to QuickTimeFileSink.

Thanks in advance,

Jonathan
Post by e***@fibertel.com.ar
I'm seeing something that I consider weird.
There's nothing "weird" about this. The diagnostic output is quite
clear about what the software is doing (or more precisely, is not
doing) in this case.
Post by e***@fibertel.com.ar
Warning: We don't implement a QuickTime Video Media Data Type for
the "MPV" track, so we'll insert a dummy "????" Media Data Atom
instead. A separate, codec-specific editing pass will be needed
before this track can be played.
Our "QuickTimeFileSink" code (which implements the writing of ".mov"
and ".mp4" files) currently doesn't include a mechanism for properly
storing MPEG-1 or 2 video or audio tracks. (It supports several
other codecs - including MPEG-4 and H.264 video, and MPEG-4 (AAC),
PCM, GSM and QCELP audio - but not (yet) MPEG-1 or 2 video or audio.
Post by e***@fibertel.com.ar
My question is, what do I need to do to stream a mpg file and then
be able to open it with openRTSP and obtain a valid .mov file?
You would need to update the "QuickTimeFileSink" code to implement
MPEG-1 or 2 video and audio. If you do this, feel free to contribute
a patch.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Ross Finlayson
2011-01-31 15:17:14 UTC
Permalink
Post by e***@fibertel.com.ar
So, is there any way to stream a MPEG4+AAC file with live555?
No, we currently do not have code for demultiplexing a ".mp4" or
".mov"-format file.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
e***@fibertel.com.ar
2011-01-31 15:53:13 UTC
Permalink
I see, so I'm not able to almost modify the rtspserver to use MPEG4ES and MPEG4GENERIC?

I mean to take testMPEG4ESVideoTest and aacAudioTest to make one stream that openRTSP can convert to .mov?



----- Mensaje original -----
De: Ross Finlayson <***@live555.com>
Fecha: Lunes, Enero 31, 2011 12:17 pm
Asunto: Re: [Live-devel] testOnDemandRTSPServer always stream audio/MPA and video/MPV ?
Post by Ross Finlayson
Post by e***@fibertel.com.ar
So, is there any way to stream a MPEG4+AAC file with live555?
No, we currently do not have code for demultiplexing a ".mp4" or
".mov"-format file.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
http://lists.live555.com/mailman/listinfo/live-devel
e***@fibertel.com.ar
2011-02-01 17:48:31 UTC
Permalink
Ok, I tried and found a way to stream this as I need.

I simply do:

{
char const* streamName = "MPEGTEST";
char const* v_inputFileName = "test_2.m4e";
char const* a_inputFileName = "test_2.aac";

ServerMediaSession* sms = ServerMediaSession::createNew(*env, streamName, streamName, descriptionString);
sms->addSubsession(MPEG4VideoFileServerMediaSubsession::createNew(*env, v_inputFileName, reuseFirstSource));
sms->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(*env, a_inputFileName, reuseFirstSource));

rtspServer->addServerMediaSession(sms);

announceStream(rtspServer, sms, streamName, v_inputFileName);
}

And I have a stream that have MPEG4-GENERIC and MP4V-ES.

The problem I got now is the duration... I found that in both subsessiions the duration is 0... and I did not found code to retrieve duration of MPEG4Video and ADTSAudio.

It isnt implemented yet? or am I doing something wrong?

Thanks!

----- Mensaje original -----
De: <***@fibertel.com.ar>
Fecha: Lunes, Enero 31, 2011 12:53 pm
Asunto: Re: [Live-devel] testOnDemandRTSPServer always stream audio/MPA and video/MPV ?
Post by e***@fibertel.com.ar
I see, so I'm not able to almost modify the rtspserver to use
MPEG4ES and MPEG4GENERIC?
I mean to take testMPEG4ESVideoTest and aacAudioTest to make one
stream that openRTSP can convert to .mov?
----- Mensaje original -----
Fecha: Lunes, Enero 31, 2011 12:17 pm
Asunto: Re: [Live-devel] testOnDemandRTSPServer always stream
audio/MPA and video/MPV ?
Post by Ross Finlayson
Post by e***@fibertel.com.ar
So, is there any way to stream a MPEG4+AAC file with live555?
No, we currently do not have code for demultiplexing a ".mp4" or
".mov"-format file.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
http://lists.live555.com/mailman/listinfo/live-devel
Ross Finlayson
2011-02-02 04:55:31 UTC
Permalink
Post by e***@fibertel.com.ar
sms->addSubsession(MPEG4VideoFileServerMediaSubsession::createNew(*env,
v_inputFileName, reuseFirstSource));
sms->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(*env,
a_inputFileName, reuseFirstSource));
[...]
Post by e***@fibertel.com.ar
And I have a stream that have MPEG4-GENERIC and MP4V-ES.
The problem I got now is the duration... I found that in both
subsessiions the duration is 0... and I did not found code to
retrieve duration of MPEG4Video and ADTSAudio.
No, the "fDurationInMicroseconds" field is set in both cases. For
"MPEG4VideoFileServerMediaSubsession", it is set in
"MPEG4VideoStreamFramer" (actually, in its parent class
"MPEGVideoStreamFramer"). For "ADTSAudioFileServerMediaSubsession"
it is set in "ADTSAudioFileSource".

This is a 'wild goose chase'; the frame durations should be set
properly. (You can verify this by noting the
"durationInMicroseconds" parameter to each call to
"MultiFramedRTPSink::afterGettingFrame()", for each of your two
"RTPSink"s.)

(As always, this assumes that you have not modified the supplied
source code. If you have made *any* modification to the supplied
source code, you can't expect any support on this mailing list.)
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Jonathan Granade
2011-02-02 16:19:47 UTC
Permalink
I learned that I should not modify the source code Ross ;)

I did not modify any part of the code, anything change I need, I make
subclasses.

I want to finish this to make a test and send it here, maybe you can add
it to the lib or maybe it will be useful for somebody.

I need to check about fDurationInMicroseconds, I did not notice that
before...

The problem I have now is other... Remember I was dealing with an
infinite video loop? I want to stream a 15 secs video+audio in an
infinite loop, so the stream will be seeking to the start over and over...

What I did was create a new object (subclass)
OnDemandContinuousServerMediaSubsession and add a task to the scheduler
that is called every ~1 second and compare the current stream progress
with the video duration.

When progress >= duration I do a 'loop' on the stream, something like
(sorry i dont have the code here):

pauseStream
seekStream (to the abs byte 0)
startPlaying

That work fine when I stream a MPEG1or2* file, but when I stream using
the way I just mentioned (MPEG4 + ADTS), it does not work.

Do you have any idea about why this happen?

Thanks in advance
Post by e***@fibertel.com.ar
sms->addSubsession(MPEG4VideoFileServerMediaSubsession::createNew(*env, v_inputFileName,
reuseFirstSource));
sms->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(*env,
a_inputFileName, reuseFirstSource));
[...]
Post by e***@fibertel.com.ar
And I have a stream that have MPEG4-GENERIC and MP4V-ES.
The problem I got now is the duration... I found that in both
subsessiions the duration is 0... and I did not found code to retrieve
duration of MPEG4Video and ADTSAudio.
No, the "fDurationInMicroseconds" field is set in both cases. For
"MPEG4VideoFileServerMediaSubsession", it is set in
"MPEG4VideoStreamFramer" (actually, in its parent class
"MPEGVideoStreamFramer"). For "ADTSAudioFileServerMediaSubsession" it is
set in "ADTSAudioFileSource".
This is a 'wild goose chase'; the frame durations should be set
properly. (You can verify this by noting the "durationInMicroseconds"
parameter to each call to "MultiFramedRTPSink::afterGettingFrame()", for
each of your two "RTPSink"s.)
(As always, this assumes that you have not modified the supplied source
code. If you have made *any* modification to the supplied source code,
you can't expect any support on this mailing list.)
Ross Finlayson
2011-02-03 06:56:13 UTC
Permalink
Post by Jonathan Granade
When progress >= duration I do a 'loop' on the stream, something
pauseStream
seekStream (to the abs byte 0)
startPlaying
That work fine when I stream a MPEG1or2* file, but when I stream
using the way I just mentioned (MPEG4 + ADTS), it does not work.
Do you have any idea about why this happen?
Yes - it's because we don't support server 'trick play' operations
(which include 'seek') on these media types.

See:
http://www.live555.com/liveMedia/faq.html#trick-mode
http://www.live555.com/mediaServer/#trick-play

This is also why the "duration()" virtual function has not been
implemented for these "*ServerMediaSubsession" classes (because, for
example, we can't know the duration of a MPEG-4 video file unless we
were to scan all the way through it).
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Jonathan Granade
2011-02-02 23:49:09 UTC
Permalink
Ross,

I checked what you mentioned about the duration...

I see that fDurationInMicroseconds is filled where you said, but method
duration() of OnDemandServerMediaSubsession is always 0 for both
streams, while if I stream a mpeg file with MPEG1or2* objects,
duration() method returns the duration of the file.

Is there any way to get it?

Thanks
Post by e***@fibertel.com.ar
sms->addSubsession(MPEG4VideoFileServerMediaSubsession::createNew(*env, v_inputFileName,
reuseFirstSource));
sms->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(*env,
a_inputFileName, reuseFirstSource));
[...]
Post by e***@fibertel.com.ar
And I have a stream that have MPEG4-GENERIC and MP4V-ES.
The problem I got now is the duration... I found that in both
subsessiions the duration is 0... and I did not found code to retrieve
duration of MPEG4Video and ADTSAudio.
No, the "fDurationInMicroseconds" field is set in both cases. For
"MPEG4VideoFileServerMediaSubsession", it is set in
"MPEG4VideoStreamFramer" (actually, in its parent class
"MPEGVideoStreamFramer"). For "ADTSAudioFileServerMediaSubsession" it is
set in "ADTSAudioFileSource".
This is a 'wild goose chase'; the frame durations should be set
properly. (You can verify this by noting the "durationInMicroseconds"
parameter to each call to "MultiFramedRTPSink::afterGettingFrame()", for
each of your two "RTPSink"s.)
(As always, this assumes that you have not modified the supplied source
code. If you have made *any* modification to the supplied source code,
you can't expect any support on this mailing list.)
e***@fibertel.com.ar
2011-02-03 14:34:57 UTC
Permalink
I see...

I would need to add support for that also I think it should not be too difficult, if I'm not wrong, MPEG4 video duration and trick play support should be too similar to MPEG1or2.

I'm not sure about ADTS, but I would need to play with them...

I will keep you updated about it.

Thanks for your help Ross!


----- Mensaje original -----
De: Ross Finlayson <***@live555.com>
Fecha: Jueves, Febrero 3, 2011 3:56 am
Asunto: Re: [Live-devel] testOnDemandRTSPServer always stream audio/MPA and video/MPV?
Post by Ross Finlayson
Post by Jonathan Granade
When progress >= duration I do a 'loop' on the stream, something
pauseStream
seekStream (to the abs byte 0)
startPlaying
That work fine when I stream a MPEG1or2* file, but when I stream
using the way I just mentioned (MPEG4 + ADTS), it does not work.
Do you have any idea about why this happen?
Yes - it's because we don't support server 'trick play' operations
(which include 'seek') on these media types.
http://www.live555.com/liveMedia/faq.html#trick-mode
http://www.live555.com/mediaServer/#trick-play
This is also why the "duration()" virtual function has not been
implemented for these "*ServerMediaSubsession" classes (because,
for
example, we can't know the duration of a MPEG-4 video file unless
we
were to scan all the way through it).
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
http://lists.live555.com/mailman/listinfo/live-devel
Loading...