Subtitle disable from within QTKit and CPU load

The Perian forums have moved to Google Groups, this forum is read only.
alj
Harmless
Posts: 8
Joined: Fri Oct 15, 2010 2:31 pm

Subtitle disable from within QTKit and CPU load

Postby alj » Thu Oct 21, 2010 1:26 pm

I've got past my previous difficulty (just need to monitor the load position) and I can play MKV files quite happily.

I wanted to disable sub-titles and I've managed to do this by disabling the appropriate track in the movie but I'm not sure that I'm identifying the sub-titling track correctly. I look for a track with a MediaType of 'vide' and a layer of -1. Is there a better way to do this?

Also, when I do play MKV files, the media are obviously being decoded and re-encoded again. This adds a considerable CPU load since, at least for H.264 files, I just want to ship those out. How can I stop Perian doing this (especially when I've disabled the track)?

Thanks in advance

gbooker
Cocoaforge Admin
Posts: 723
Joined: Sat May 06, 2006 2:47 am
Contact:

Re: Subtitle disable from within QTKit and CPU load

Postby gbooker » Thu Oct 21, 2010 3:52 pm

alj wrote:Is there a better way to do this

I believe the subtitles tracks are given names.

alj wrote:Also, when I do play MKV files, the media are obviously being decoded and re-encoded again.

Uh... no.... It's not doing that. For one, there is no encoding in Perian. The slowdown is from QT's display which is slowed down by the way it tries to display the subtitles (Yes, we did bugreport this and no it has not been fixed).

alj wrote:I just want to ship those out

? What does this mean?

alj
Harmless
Posts: 8
Joined: Fri Oct 15, 2010 2:31 pm

Re: Subtitle disable from within QTKit and CPU load

Postby alj » Thu Oct 21, 2010 4:00 pm

Thank you for your prompt reply.

gbooker wrote:
alj wrote:Is there a better way to do this

I believe the subtitles tracks are given names.


Ah thanks: I'll look into that. I was wondering whether there was any attribute that could be examined from a QucikTime perspective since the (subtitle) track names may be dependent on the encoder.

gbooker wrote:
alj wrote:Also, when I do play MKV files, the media are obviously being decoded and re-encoded again.

Uh... no.... It's not doing that. For one, there is no encoding in Perian. The slowdown is from QT's display which is slowed down by the way it tries to display the subtitles (Yes, we did bugreport this and no it has not been fixed).


Do you know how I can tell QuickTime 'no subtitles'?

gbooker wrote:
alj wrote:I just want to ship those out

? What does this mean?


Sorry, I just want to ship the raw H.264 frames not any re-rendered frames. I'm essentially using Perian, through QuickTime, to demultiplex the audio and video streams within the MKV file.

gbooker
Cocoaforge Admin
Posts: 723
Joined: Sat May 06, 2006 2:47 am
Contact:

Re: Subtitle disable from within QTKit and CPU load

Postby gbooker » Thu Oct 21, 2010 7:18 pm

The issue is that for subtitle tracks, we had to tell QT to composite in it's less CPU efficient mechanism for rendering for subtitles since it displayed black frames with subtitles otherwise. It should stop using the less CPU efficient mechanism if the subtitle track is off. Maybe you should construct a new movie only copying over the appropriate tracks.
Depending on what you are doing, you may be better off using ffmpeg for the task since it is designed for raw decode, transcode, remux, etc. Just if you redistribute it, be aware of it's license and keep to the terms.

alj
Harmless
Posts: 8
Joined: Fri Oct 15, 2010 2:31 pm

Re: Subtitle disable from within QTKit and CPU load

Postby alj » Tue Oct 26, 2010 8:52 am

I found a way of removing sub-titled MKV files without incurring excessive CPU load. The subtitle track has to be disabled and disposed of prior to any other operations on the movie. That is:

[qttrack setEnabled:NO];
DisposeMovieTrack ([qttrack quickTimeTrack]);

where qttrack is the subtitle track. The CPU load is now < 5% rather than > 80% in my application.

jacobyte
Harmless
Posts: 1
Joined: Fri Apr 29, 2011 8:10 pm

Re: Subtitle disable from within QTKit and CPU load

Postby jacobyte » Fri Apr 29, 2011 8:14 pm

Excellent solution, cool. Now I can convert MKV to mov then burn through Toast. You have saved me hours, nice one.


Return to “Perian”

Who is online

Users browsing this forum: Majestic-12 [Bot]