7

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Yaniv De Ridder
  • 773
  • 1
  • 7
  • 13
  • Have you tried opening up a .ts file in a hex editor? ID3s should show up clearly near the front if they're there – Rich Tolley Feb 01 '13 at 16:29
  • When injecting metadata using a macro-file with mediafilesegmenter Beta Version 1.1(130110) it simply doesn't work. When I look with an HEX editor, It only inject empty ID3. If I inject id3 using the -F -y parameter (without using a macro file) then I can clearly see in the HEX editor the right ID3 and it works. THE PROBLEM: to inject timed metadata, you can only do that with a macro file ... Someone with the same problem ? I start wondering if its not a bug in this version of the mediafilesegmenter .. Maybe someone can point me to an older version of the installer to try ?? Thanks – Yaniv De Ridder Feb 04 '13 at 08:59

2 Answers2

5

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.

Yaniv De Ridder
  • 773
  • 1
  • 7
  • 13
1

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/

Jace Sparks
  • 121
  • 2
  • 11