[Live-devel] About live555 convert H264 stream to MPEG2 transport stream

Jeff Shanab jshanab at jfs-tech.com
Wed Dec 10 03:32:25 PST 2014


Safari or apple in general is very picky about the segment length and what
is in them. I did get this to work but had to modify one of the live 555
classes. It was a few years ago but I did send it to this list as a
suggestion, so it is in the history somewhere.  While the standard allows
you to not start a segment on a keyframe if already going, the previous
segment MUST have decoded and played. If the browser drops the ball it gets
lost. So the solution I chose was to make every segment start on a keyframe.

HTTP live streaming requires the stream to be broken into segments of equal
segment lengths. 10 second is the default, I have used 5 and 2. The index
file claims the segment length and the segments cannot very much at all.
In order for this to work reliably with H264 video you need to start each
segment on a keyframe.  Currently the part of the code for transport stream
inserts the PES** frames at a timed interval that is not tied to the
keyframe interval.  I changed the attached classes and had them working
before we abandoned this for an app using live555 and rtsp on the device
themselfs. HTTP live streaming imparts a delay on live video that was
unacceptable for security camera video in our use case.

I was doing my own segmenting and index creation on the fly because I was
trying to use it for live video to the ipad,iphone, android. Safari was my
desktop test.  It became trivial once I knew I had a gop size of 10 @ 10fps
to start a segment on a keyframe and to start a new one on the segment
length * gop size +1 PTS/DTS/keyframe packet was encountered. Essentially
payed it forward. Stick in the PTS at index friendly intervals then the
downstream indexer just worked.

** sorry this is off the top of my head, PTS? I can dig deeper if necessary
after work. I see the files in an old directory and am attaching them.
Please note this was years ago, Ross may have already changed this code. I
have not followed as I have dropped interest in HTTP live streaming.  There
is a new tech, extremely similar to HTTP live streaming without the index
file and latency issues that mirrors my own solution already out there VP8
+ HTML5, so I am a bit surprized to see a question about HLS.

On Wed, Dec 10, 2014 at 3:42 AM, Ross Finlayson <finlayson at live555.com>
wrote:

> I have use the test application "testH264VideoToTransportStream" to change
> the H264 stream to transport stream, after this step I get a out.ts file,
> then I use "MPEG2TransportStreamIndexer" to create an index file out.txs
> for the out.ts file, after those two steps, I use Safari browser to request
> the transport stream but failed.
> what is wrong with those?
> I have also downloaded the bipbop-gear1-all.ts, and use
> "MPEG2TransportStreamIndexer" to create the index file, this process is
> succeed, do this means the "MPEG2TransportStreamIndexer" is correct, but
> there is something wrong with the H264VideoToTransportStream process?
>
>
> Probably not.  It’s unlikely that there is anything ‘wrong’ with the
> “H264VideoToTransportStream” mechanism, although it’s possible that (for
> some unknown reason) the type of Transport Stream that it produces does not
> satisfy Safari.  It is also possible that the problem is that the H.264
> ‘profile’ that your stream uses does not match the profile that Safari
> requires.  See
>
> https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html
> Unfortunately this is not something that we can help you with.  You will
> need to figure out (with Apple, using some appropriate Apple-specific
> mailing list; not this one) exactly what is wrong with your Transport
> Stream.
>
>
> I really need your help, and please response this email as soon as
> possible!
>
>
> Sorry, but requests posted to this free mailing list are never considered
> ‘urgent’.  Only paying consulting clients get priority support.  (Live
> Networks, Inc. is not a charity.)
>
> Also (as clearly stated in the FAQ that everyone is asked to read before
> posting to this mailing list), messages sent using unprofessional email
> addresses (like “@163.c <http://i63.net>om”) are considered very low
> priority, and might not get answered at all.
>
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141210/8f2e2af6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPEG2TransportStreamFromESSource4iOS.cpp
Type: text/x-c++src
Size: 10569 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141210/8f2e2af6/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPEG2TransportStreamFromESSource4iOS.hh
Type: application/octet-stream
Size: 2294 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141210/8f2e2af6/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPEG2TransportStreamMultiplexor4iOS.cpp
Type: text/x-c++src
Size: 20965 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141210/8f2e2af6/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPEG2TransportStreamMultiplexor4iOS.hh
Type: application/octet-stream
Size: 3553 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141210/8f2e2af6/attachment-0003.obj>


More information about the live-devel mailing list