Pi-Ming Cheng | 1 Jul 2009 01:38
Picon

QuickTimeFileSink save to new files

Hi,

We have an application to save streaming video from an IP camera to 
files every 30 secs. I plan to modify the code of QuickTimeFileSink (by 
creating a new class) so that I can use a timer to close the old file 
and open a new file without deleting the instance of QuickTimeFileSink.

(1) To close the old file is straightforward -- two function calls
   completeOutputFile();
   CloseOutputFile(fOutFid);
The resulting QuickTime file plays back fine without any problems.

(2) To open a new file is problematic -- I did the following:
       gettimeofday(&fStartTime, NULL);
       fAppleCreationTime = fStartTime.tv_sec - 0x83dac000;

       char outfilename[64];
       sprintf(outfilename, "%d.mov", (int)(fStartTime.tv_sec) );
       fOutFid = OpenOutputFile(envir(), outfilename);

       fHaveCompletedOutputFile = False;
       fMDATposition = ftell(fOutFid);
       addAtomHeader("mdat");

       then startPlaying() function

When I played the file back -- (1) from an IP camera that only has a 
video subsession -- the file tells the player that the entire video is 
60 secs long even though it actually has only 30 secs of video in it, 
(2) from an IP camera that has both video and audio subsessions -- the 
(Continue reading)

Ross Finlayson | 1 Jul 2009 08:00
Favicon

Re: QuickTimeFileSink save to new files

The problem, I think, is that the QuickTime file format requires a 
"mdat" 'atom' to be written at the start of the file.  The 
QuickTimeFileSink code works by first reserving space at the front of 
the file for this structure, and then - before closing the file - 
filling it in.  (It has to wait until the last data has been written 
to the file before it has enough information to fill in the 
structure.)

You will need to do the same thing to each file that you write. 
Search for "mdat" in the code to see what you will need to do.
--

-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Z.T Huang | 1 Jul 2009 11:36
Picon

Re: openRTSP transmission question

Thanks Ross first :-)

I printed each packet before sending and the problem was gone, so....I think it's probably because streamer send packets too fast ( server and client are both on the same machine ) so that reciver could not hold them.


Z.T

2009/6/30 Ross Finlayson <finlayson-C8PbJppqpsxBDgjK7y7TUQ@public.gmane.org>
I'm trying to send JPEG file, and wrote my JPEGVideoSource(), I use openRTSP as the client, and my input test file is just a frame, but i got some trouble, sometimes openRTSP could got the stream and saved, but sometime it didn't - the recived file is 0 byte.....and always got "BYE" and "TEARDOWN" msg, i don't know where is something wrong, could anyone give the direction to figure out the point or how and where to  put some debug code in openRTSP to see if it take packets

When you don't receive a frame, it's probably because one or more of the RTP packets got lost.  If any of the (very many) RTP packets that make up a JPEG frame get lost, then the whole frame is discarded.

JPEG is a very poor codec for video streaming.  You should use a more efficient codec (specifically for video) instead.
--

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
live-devel <at> lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
soumya patra | 1 Jul 2009 12:41

video-MP4V-ES-1 not playing in case of testOnDemandRTSPServer

Hi Ross,

 

       I am using openRTSP to receive the mpeg4ESVideoTest stream from testOnDemandRTSPServer giving input as test.m4e. It’s creating the output file   video-MP4V-ES-1 but when am trying to play it with mplayer it’s not playing. But in case of testMPEG4VideoStreamer it is able to play.

 

        Waiting for your help.

 

Regards

Soumya

 

 

_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Ross Finlayson | 1 Jul 2009 12:53
Favicon

Re: video-MP4V-ES-1 not playing in case of testOnDemandRTSPServer

       I am using openRTSP to receive the mpeg4ESVideoTest stream from testOnDemandRTSPServer giving input as test.m4e. It's creating the output file   video-MP4V-ES-1 but when am trying to play it with mplayer it's not playing.

That's simply because MPlayer does not know how to play such a file (a MPEG-4 Video Elementary Stream file).

The place to complain about this is on a MPlayer mailing list - not this one (because MPlayer is not our software).
-- --

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
mrussell | 1 Jul 2009 21:23

numChannels Parameter

Hi Ross,

I have a SimpleRTPSink that is fed a transport stream from MPEG2TransportStreamFramer.  That transport
stream contains one MPEG-4 video elementary stream plus one MPEG-1, Layer 3 stereo (2-channel) audio
stream.  When I call  SimpleRTPSink::createNew(), what value should I use for the numChannels parameter? 
I looked at the source for SimpleRTPSink::createNew(), but it is still not clear to me.

Thanks in advance,
Mike.
Ross Finlayson | 2 Jul 2009 03:33
Favicon

Re: numChannels Parameter

>I have a SimpleRTPSink that is fed a transport stream from 
>MPEG2TransportStreamFramer.  That transport stream contains one 
>MPEG-4 video elementary stream plus one MPEG-1, Layer 3 stereo 
>(2-channel) audio stream.  When I call  SimpleRTPSink::createNew(), 
>what value should I use for the numChannels parameter?

When streamed over RTP, a MPEG Transport Stream - regardless of its 
actual contents - is described in SDP as being a "video" stream, and 
therefore the "numChannels" parameter is ignored, but should be set 
to 1.

See, for example, the code in "MPEG2TransportFileServerMediaSubsession.cpp":

return SimpleRTPSink::createNew(envir(), rtpGroupsock, 33, 90000, 
"video", "MP2T", 1, True, False /*no 'M' bit*/);

Note also that - for network efficiency - you should pack as much 
Transport Stream data as possible (but with a granularity of 188 
bytes) into each RTP packet.  Using the default MTU, this usually 
means 7*188 bytes of Transport Stream data per RTP packet.

See, for example, code in 
"MPEG2TransportFileServerMediaSubsession.cpp" (for streaming via 
unicast), or "testMPEG2TransportStreamer" (for streaming via 
multicast).
--

-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
bourda guillaume | 2 Jul 2009 13:23
Picon

One Source and Multiple Sink

Hi!

In the Source/Sink live model, I can:  create 1 source, create 1 sink and "attach" both  "sink->startPlaying(source)"

I would like to know if I can "attach" many sink to one source?
For example in order to create different files from 1 single RTP stream.

I hope my question is clear enough.
Thanks in advance for your answers.

Guillaume

_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Ross Finlayson | 2 Jul 2009 14:10
Favicon

Re: One Source and Multiple Sink

>In the Source/Sink live model, I can:  create 1 source, create 1 
>sink and "attach" both  "sink->startPlaying(source)"
>
>I would like to know if I can "attach" many sink to one source?

No. Each source object can be fed to only one sink.

To do what you want, in general, you would need to write a special 
'duplicator' object that created multiple source objects from a 
single input - and then feed each of these sources to its own sink. 
(That would be a bit tricky to do, though.)

>For example in order to create different files from 1 single RTP stream.

For this particular example, the easiest thing to do would be for you 
to write a new 'sink' class - similar to FileSink - that writes to 
multiple output files.  I.e., it would just be one 'sink' object, 
that happens to write to multiple files.
--

-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Michael Russell | 3 Jul 2009 01:26

.m4v / .mp3 Synchronization

Hi Ross -

I am prototyping a streaming application using an MPEG-1, Layer 3 (.mp3) 
audio file and an MPEG-4 video elementary stream (.m4v) file as inputs.  
I am doing this to simulate our actual encoder outputs since they are 
not yet available.  I recorded these files from two different physical 
sources on two different days.  When I wrap them into an MPEG-2 
transport stream, I experience synchronization issues.  I seem to be 
dropping a lot of audio packets, making it sound like the audio is 
"jumping ahead" to catch up to the video (VLC client).

Here is a depiction of what I am doing:

       |ByteStream|  |MPEG4   |  |          |
.m4v ->|FileSource|->|Video   |->|          |
file                 |Stream  |  |          |
                     |Framer  |  |MPEG2     |  |MPEG2     |  |      |
                                 |Transport |->|Transport |  |Simple|
                                 |Stream    |  |Stream    |->|RTP   |
                     |MPEG1or2|  |From      |  |Framer    |  |Sink  |
       |ByteStream|  |Audio   |  |ESSource  |                |      |
.mp3 ->|FileSource|->|Stream  |->|          |
file                 |Framer  |  |          |

(I didn't show the RTCP Instance associated with my RTP Sink)

Am I doing something wrong here?  How does Live555 ensure synchronization?

Note that if I "disconnect" one of the inputs, the resulting transport 
stream (audio or video) plays fine in my VLC client.

Thanks a ton,
Mike.

Gmane