[FFmpeg-devel] [PATCH 12/18] avformat/hls: parse ID3 timestamps for elementary audio streams

Anssi Hannula anssi.hannula at iki.fi
Tue Dec 31 06:28:26 CET 2013

31.12.2013 06:58, Michael Niedermayer kirjoitti:
> On Tue, Dec 31, 2013 at 04:46:37AM +0200, Anssi Hannula wrote:
>> 31.12.2013 03:32, Michael Niedermayer kirjoitti:
>>> On Tue, Dec 31, 2013 at 03:04:33AM +0200, Anssi Hannula wrote:
>>>> 30.12.2013 16:12, Michael Niedermayer kirjoitti:
>>>>> On Mon, Dec 30, 2013 at 01:14:26PM +0200, Anssi Hannula wrote:
>>>>>> HLS provides MPEG TS timestamps via ID3 tags in the beginning of each
>>>>>> segment of elementary audio streams.
>>>>>> Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>
>>>>>> ---
>>>>>> This is a bit hacky, but I could not see any better way.
>>>>> this seems to break some hls streams
>>>>> for example:
>>>>> http://qthttp.apple.com.edgesuite.net/c123pibhargjknawdconwecown/0064/prog_index.m3u8
>>>>> didnt investigate why
>>>> The ID3 tag in the beginning of each segment seems to contain an
>>>> attached picture (APIC) in addition to the timestamp, so the ID3 tag is
>>>> too large for the id3 hack to fully intercept (since the hack currently
>>>> depends on the ID3 tag fitting in the caller-provided buffer), so the
>>>> caller gets 0 bytes.
>>>> The APIC is currently parsed to a static mjpeg stream by
>>>> ff_id3v2_parse_apic() in avformat_open_input(). I guess it could
>>>> theoretically change mid-stream as well, though it might not currently
>>>> happen in practice (no idea, though [1](13) suggests it does not).
> dunno about the picture but from reading "Adding Timed Metadata" on:
> https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/streamingmediaguide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html
> it sounds like these things can change

I'm just not sure that the ID3 tag in the beginning of an audio
elementary stream segment is considered such "timed metadata", segments
are usually around 10sec in length, which is a bit coarse...

The "If you are writing your own segmenter, you can read about the
stream format for timed metadata information in Timed Metadata for HTTP
Live Streaming." link goes to a page that describes MPEG-2 TS timed ID3
metadata, nothing about audio elementary stream ID3 metadata.

Anssi Hannula

More information about the ffmpeg-devel mailing list