8000 Detecting if AppleTV or not... · Issue #1106 · homebridge-plugins/homebridge-camera-ffmpeg · GitHub
[go: up one dir, main page]

Skip to content
Detecting if AppleTV or not... #1106
Open
@FrancoisDucobu

Description

@FrancoisDucobu

Hello Everyone,

First, thanks for this plugin !
I have camera from HIK Vision and it works great.

In my home, I have 2 AppleTV and iPhone.

To avoid encoding issue, I used the option vcodec: copy
The image was very good.

Then, when I tried on my AppleTV, it was not working...
After searching on internet, I found that the apple tv is more picky with the homekits standards.

The Apple TV needs 802 kbps with 1920x1080. If it's not these values, it doesn't work...
So, in order to get it work with AppleTV, I need to set the setting value empty to let the plugin encode the video with the right value.

But iPhone asks 1280 x 720 with 299 kbps :o
So the quality is very bad...

I found a workaround but it's not very nicely done...

on the startStream method inside streamingDelegate.js
I put these lines

let vcodec = null;
if(request.video.max_bit_rate !== 802){
    this.log.info("Not an AppleTV. Set vcodec to copy.");
    vcodec = 'copy';
}
else{
    this.log.info("AppleTV. We use the plugin config.");
    vcodec = this.videoConfig.vcodec || 'libx264';
}
    startStream(request, callback) {
        const sessionInfo = this.pendingSessions.get(request.sessionID);
        if (sessionInfo) {
            let vcodec = null;
            if(request.video.max_bit_rate !== 802){
                this.log.info("Not an AppleTV. Set vcodec to copy.");
                vcodec = 'copy';
            }
            else{
                this.log.info("AppleTV. We use the plugin config.");
                vcodec = this.videoConfig.vcodec || 'libx264';
            }
            this.log.info("vcodec: " + vcodec);
            ...

I'm not familiar with homebridge developpement and it is (for me) the only way to know if the request is from an AppleTV or from another devices.

Is there another way to do it ?
Do you think you could add and option to use reencoding with AppleTV ? and "copy" or another option for others devices ?

Thanks a lot
(sorry for my english)

Francois

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0