Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
b7023a96
Commit
b7023a96
authored
5 years ago
by
Steven D. Lander
Committed by
Pascal Vizeli
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue #27288 Move imports to top for FFMPEG (#27613)
parent
ff4e35e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/ffmpeg/__init__.py
+1
-1
1 addition, 1 deletion
homeassistant/components/ffmpeg/__init__.py
homeassistant/components/ffmpeg/camera.py
+2
-2
2 additions, 2 deletions
homeassistant/components/ffmpeg/camera.py
with
3 additions
and
3 deletions
homeassistant/components/ffmpeg/__init__.py
+
1
−
1
View file @
b7023a96
...
...
@@ -3,6 +3,7 @@ import logging
import
re
import
voluptuous
as
vol
from
haffmpeg.tools
import
FFVersion
from
homeassistant.core
import
callback
from
homeassistant.const
import
(
...
...
@@ -105,7 +106,6 @@ class FFmpegManager:
async
def
async_get_version
(
self
):
"""
Return ffmpeg version.
"""
from
haffmpeg.tools
import
FFVersion
ffversion
=
FFVersion
(
self
.
_bin
,
self
.
hass
.
loop
)
self
.
_version
=
await
ffversion
.
get_version
()
...
...
This diff is collapsed.
Click to expand it.
homeassistant/components/ffmpeg/camera.py
+
2
−
2
View file @
b7023a96
...
...
@@ -3,6 +3,8 @@ import asyncio
import
logging
import
voluptuous
as
vol
from
haffmpeg.camera
import
CameraMjpeg
from
haffmpeg.tools
import
ImageFrame
,
IMAGE_JPEG
from
homeassistant.components.camera
import
PLATFORM_SCHEMA
,
Camera
,
SUPPORT_STREAM
from
homeassistant.const
import
CONF_NAME
...
...
@@ -53,7 +55,6 @@ class FFmpegCamera(Camera):
async
def
async_camera_image
(
self
):
"""
Return a still image response from the camera.
"""
from
haffmpeg.tools
import
ImageFrame
,
IMAGE_JPEG
ffmpeg
=
ImageFrame
(
self
.
_manager
.
binary
,
loop
=
self
.
hass
.
loop
)
...
...
@@ -66,7 +67,6 @@ class FFmpegCamera(Camera):
async
def
handle_async_mjpeg_stream
(
self
,
request
):
"""
Generate an HTTP MJPEG stream from the camera.
"""
from
haffmpeg.camera
import
CameraMjpeg
stream
=
CameraMjpeg
(
self
.
_manager
.
binary
,
loop
=
self
.
hass
.
loop
)
await
stream
.
open_camera
(
self
.
_input
,
extra_cmd
=
self
.
_extra_arguments
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment