Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
renojim
Community Streaming Expert

AudioPIDPref

I just tried to use AudioPIDPref for the first time without any luck. I ripped a DVD to an m4v file using HandBrake and included the main audio track and the commentary. Both tracks are encoded as AAC and I can switch between them using VLC, but I can't figure out how to get the roVideoScreen to choose one or the other. I always get the main audio, even though it's the first audio track and not the last. The documentation for AudioPIDPref specifies that the last audio track will be selected if AudioPIDPref isn't set. MediaInfo shows:
Audio #1
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 1h 40mn
Bit rate mode : Variable
Bit rate : 160 Kbps
Maximum bit rate : 252 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Stream size : 115 MiB (7%)
Language : English
Encoded date : UTC 2012-07-01 21:55:19
Tagged date : UTC 2012-07-01 22:08:59

Audio #2
ID : 3
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 1h 40mn
Bit rate mode : Variable
Bit rate : 160 Kbps
Maximum bit rate : 223 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Stream size : 115 MiB (7%)
Language : English
Encoded date : UTC 2012-07-01 21:55:19
Tagged date : UTC 2012-07-01 22:08:59
I tried using the ID it shows (2 or 3) as AudioPIDPref, but it has no effect.

Has anyone been able to do something like this or have any insight?

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
6 REPLIES 6
renojim
Community Streaming Expert

Re: AudioPIDPref

Nobody's tried this or has any experience with this?
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
RokuJoel
Binge Watcher

Re: AudioPIDPref

Here's another discussion on the subject, not sure if it will help you:

viewtopic.php?f=34&t=34679&p=222769&hilit=audiopidpref#p222769
0 Kudos
TheEndless
Channel Surfer

Re: AudioPIDPref

I have successfully used AudioPIDPref on HLS streams before, but I've never tried it with static video files. I seem to remember greubel working with it for Chaneru at one point. It might be worth pinging him directly to see if he had any success.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
renojim
Community Streaming Expert

Re: AudioPIDPref

Thanks guys. I saw the other thread before I posted. It isn't clear from that whether greubel was ever able select a specific audio stream. I'll try to ping him directly.

Perhaps it only works for HLS? If so, the documentation should be updated. This was just for my own use. I've been contemplating ripping all my DVDs, some of which I'd like to have both the main audio and commentary tracks. It would be nice if I didn't have to have two rips for those movies.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
RokuMarkn
Visitor

Re: AudioPIDPref

AudioPIDPref does only work on HLS streams. PIDs are a feature of Transport Streams and don't have meaning in an MP4 file.

There is a better way to do this by setting the AudioLanguageSelected attribute in the content metadata. This should be a 3-letter ISO-639 language code. This is used to select the best matching track from the content, and it should work on both MP4 and HLS (assuming each track is correctly tagged with a language code). I'm not positive which releases support this. It may not work on R1s.

--Mark
0 Kudos
renojim
Community Streaming Expert

Re: AudioPIDPref

Thanks Mark! I can't find AudioLanguageSelected anywhere in the documentation, but it works great on both my R1 and R2.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos