Yaniv De Ridder
Yaniv De Ridder

Reputation: 783

Insert timed metadata into HLS (HTTP Live Stream) using id3taggenerator and mediafilesegmenter

I try to insert timed metadata into an .mov or .mp4 video file. I did read about it here:

Basically, my problem is that whatever I try, I get the generated .m3u8 and a bunch of .ts files as expected without any errors but I feel like the metadata are not inserted.

Let me explain in details what I do.

First I generate some id3 tags as follow:

id3taggenerator -o tag1.id3 -t "Test"

Then I write a macro text file called 'macrofile.txt' containing:

5 id3 tag1.id3

I make sure the file ends with a newline character and each field is separated by a single space and not tabs.

Then I use mediafilesegmenter to create the m3u8 with the .ts files with the command that also include the macrofile as follow:

mediafilesegmenter -index-file test.m3u8 -M macrofile.txt -no-floating-point-duration -iframe-index-file none test.mp4

This will successfully generate the m3u8 file + a bunch of .ts files (one ts per 10 sec of video)

I upload those on my webserver, (obviously I added the right MIME types etc) and from my iOS app, I open the stream:

NSURL* url = [NSURL URLWithString:@"http://url.com/test.m3u8"];
player = [[MPMoviePlayerController alloc] initWithContentURL:url];

I also make sure to add the MPMoviePlayerTimedMetadataUpdatedNotification notification as follow:

NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self
           selector:@selector(metadataUpdate:)
               name:MPMoviePlayerTimedMetadataUpdatedNotification
             object:nil];

Now the problem is that, the MPMoviePlayerTimedMetadataUpdatedNotification is never triggered.

If I try with the Apple test stream ( https://devimages.apple.com.edgekey.net/resources/http-streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8 ) that includes timed metadata every 5seconds -> It Works Perfectly

So this is why I assume that my generated .ts files does not contain any metadata or at least I'm doing something wrong somewhere but I checked everything I could and now I'm out of ideas.

Upvotes: 7

Views: 6662

Answers (2)

Jace Sparks
Jace Sparks

Reputation: 121

This wordpress blog helped me tremendously in regards to the issues you are having. https://jmacmullin.wordpress.com/2010/11/03/adding-meta-data-to-video-in-ios/

Upvotes: 1

Yaniv De Ridder
Yaniv De Ridder

Reputation: 783

After spending a bit more time on this, I decided to contact Apple Developer Technical Support.

It is indeed a bug in the latest version of the mediafilesegmenter tool 1.1(130110)

Here is the direct link to access the bug report https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/67/wo/quUWkJlEHk4L6S6U9geEZ0/21.83.28.0.13

The BUG ID is 13178898

I'll update my answer here as soon as the bug is resolved or a workaround is given to me by Apple.

Upvotes: 5

Related Questions