HLS First Chunk

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HLS First Chunk

Nicolas Castillejos
Hello,

We are encountering problem reading HLS Stream outgoing from Wowza
Streaming Engine on our GStreamer Client. For information we try to read
a record that has been recorded with Wowza DVR. The Problem is that when
we start reading video from start, all is working fine, we succeed to
read the video on our gstreamer client. But when we start the video from
the middle of the video, for example, the video doesn't show and the
screen is black. The poor solution we have found to correct it, at this
time, is, each time we want to start reading video not from start, we
re-inject the first chunk of the video then we continue with injecting
video part that we wanna read. It results with a weird video that starts
from zero, then after 2 sec, jump to the middle of video. With this
solution we can watch the video.
It seems that the first chunk contains informations that other chunks
doesn't have and that are needed to decode the video.

What do you think about this ?

Do you know a way to have these informations in other chunks ? Is there
something to do with Wowza ? Or do we have to do something on our
gstreamer client ?

This is a scheme of our GStreamer Pipeline if it cans help :

APPSRC -> tsDemux -> VideoBin (h264parse -> avdec_h264 -> videoconvert
-> capsfilter)

APPSRC is used to feed  gstreamer with hls chunks. We have implemented
our custom HLS demuxer and TS demuxer in java).

Cordially,

Nicolas Castillejos

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: HLS First Chunk

Arjen Veenhuizen
Make sure that all your HLS segments start with an SPS & PPS NAL unit and (obviously) with an I-frame. You can check if h264parse can parse the NAL units by setting GST_DEBUG=h264parse*:5. It will fail if you do not meet these criteria.
Reply | Threaded
Open this post in threaded view
|

Re: HLS First Chunk

Nicolas Castillejos

Hello,

Here are the logs when it doesn't works ( when video starts not from chunk 0) :

0:00:05.857882476  1376   1CBA8D80 DEBUG              h264parse gsth264parse.c:262:gst_h264_parse_start:<h264parse> start
14: 0:00:05.858033563  1376   1CBA8D80 DEBUG              h264parse gsth264parse.c:184:gst_h264_parse_reset_frame:<h264parse> reset frame
15: 0:00:05.879834417  1376   1465AA68 INFO        mpegtspacketizer mpegtspacketizer.c:763:mpegts_try_discover_packet_size: have packetsize detected: 188 bytes
16: 0:00:07.247871598  1376   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:1838:_set_current_group: GAP detected. diff 0:00:02.598000000
17: 0:00:07.774271858  1376   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:1832:_set_current_group: RESET detected. diff 0:00:00.680000000
18: 0:00:07.896264980  1376   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:1832:_set_current_group: RESET detected. diff 0:00:06.958000000
19: 0:00:09.184193700  1376   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:1838:_set_current_group: GAP detected. diff 0:00:02.598000000
20: 0:00:09.747579169  1376   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:1832:_set_current_group: RESET detected. diff 0:00:00.400000000
21: 0:00:09.870614876  1376   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:1832:_set_current_group: RESET detected. diff 0:00:07.197000000
22: 0:00:11.159512336  1376   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:1838:_set_current_group: GAP detected. diff 0:00:02.598000000


And Here the logs when it works fine (injecting chunk 0 at start of the video) :

13: 0:00:06.025137992  5560   1CBA8D80 DEBUG              h264parse gsth264parse.c:262:gst_h264_parse_start:<h264parse> start
14: 0:00:06.025334111  5560   1CBA8D80 DEBUG              h264parse gsth264parse.c:184:gst_h264_parse_reset_frame:<h264parse> reset frame
15: 0:00:06.042989522  5560   1465AA68 INFO        mpegtspacketizer mpegtspacketizer.c:763:mpegts_try_discover_packet_size: have packetsize detected: 188 bytes
16: 2016-11-02 16:33:52,015 [INFO ] [HLSMosaicPlayer.java] [27229407]  state is now PLAYING
17: 0:00:06.047280069  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2302:mpegts_packetizer_pts_to_ts: Not enough information to calculate proper timestamp
18: 0:00:06.047553711  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2302:mpegts_packetizer_pts_to_ts: Not enough information to calculate proper timestamp
19: 0:00:06.047769152  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2302:mpegts_packetizer_pts_to_ts: Not enough information to calculate proper timestamp
20: 0:00:06.047877521  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2302:mpegts_packetizer_pts_to_ts: Not enough information to calculate proper timestamp
21: 0:00:06.047975164  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2302:mpegts_packetizer_pts_to_ts: Not enough information to calculate proper timestamp
22: 0:00:06.048184085  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2300:mpegts_packetizer_pts_to_ts: No groups, can't calculate timestamp
23: 0:00:06.048391156  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2300:mpegts_packetizer_pts_to_ts: No groups, can't calculate timestamp
24: 0:00:06.049040006  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2300:mpegts_packetizer_pts_to_ts: No groups, can't calculate timestamp
25: 0:00:06.050315936  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2300:mpegts_packetizer_pts_to_ts: No groups, can't calculate timestamp
26: 0:00:06.050683526  5560   1465AA68 WARN        mpegtspacketizer mpegtspacketizer.c:2300:mpegts_packetizer_pts_to_ts: No groups, can't calculate timestamp
27: 0:00:06.144540186  5560   1465AA68 DEBUG              h264parse gsth264parse.c:328:gst_h264_parse_format_from_caps: parsing caps: video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
28: 0:00:06.144690356  5560   1465AA68 DEBUG              h264parse gsth264parse.c:2535:gst_h264_parse_set_caps:<h264parse> have bytestream h264
29: 0:00:06.145402035  5560   1465AA68 DEBUG              h264parse gsth264parse.c:368:gst_h264_parse_negotiate:<h264parse> allowed caps: video/x-h264, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], alignment=(string)au, stream-format=(string){ avc, byte-stream }, parsed=(boolean)true
30: 0:00:06.145532641  5560   1465AA68 DEBUG              h264parse gsth264parse.c:375:gst_h264_parse_negotiate:<h264parse> negotiating with caps: video/x-h264, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], alignment=(string)au, stream-format=(string){ avc, byte-stream }, parsed=(boolean)true
31: 0:00:06.145651262  5560   1465AA68 DEBUG              h264parse gsth264parse.c:328:gst_h264_parse_format_from_caps: parsing caps: video/x-h264, width=(int)1, height=(int)1, framerate=(fraction)0/1, alignment=(string)au, stream-format=(string)avc, parsed=(boolean)true
32: 0:00:06.145759676  5560   1465AA68 DEBUG              h264parse gsth264parse.c:406:gst_h264_parse_negotiate:<h264parse> selected format avc, alignment au
33: 0:00:06.145930876  5560   1465AA68 DEBUG              h264parse gsth264parse.c:184:gst_h264_parse_reset_frame:<h264parse> reset frame
34: 0:00:06.146030265  5560   1465AA68 DEBUG              h264parse gsth264parse.c:1097:gst_h264_parse_handle_frame:<h264parse> last parse position 0