Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
ac6044f8
Commit
ac6044f8
authored
Mar 11, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contrib: build ffmpeg with nvcodec
Change-Id: I9b58121d326be4a0789c03145551d5417ba13698
parent
a24fb11b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
contrib/src/ffmpeg/rules.mak
contrib/src/ffmpeg/rules.mak
+12
-1
contrib/src/ffnvcodec/rules.mak
contrib/src/ffnvcodec/rules.mak
+26
-0
src/media/video/accel.cpp
src/media/video/accel.cpp
+7
-2
No files found.
contrib/src/ffmpeg/rules.mak
View file @
ac6044f8
...
...
@@ -168,6 +168,7 @@ FFMPEGCONF += --disable-asm
endif
else
# Desktop Linux
DEPS_ffmpeg
+=
ffnvcodec
FFMPEGCONF
+=
\
--target-os
=
linux
\
--enable-indev
=
v4l2
\
...
...
@@ -183,7 +184,17 @@ FFMPEGCONF += \
--enable-hwaccel
=
mjpeg_vaapi
\
--enable-encoder
=
h264_vaapi
\
--enable-encoder
=
vp8_vaapi
\
--enable-encoder
=
mjpeg_vaapi
--enable-encoder
=
mjpeg_vaapi
\
--enable-cuvid
\
--enable-ffnvcodec
\
--enable-nvdec
\
--enable-nvenc
\
--enable-hwaccel
=
h264_nvdec
\
--enable-hwaccel
=
hevc_nvdec
\
--enable-hwaccel
=
vp8_nvdec
\
--enable-hwaccel
=
mjpeg_nvdec
\
--enable-encoder
=
h264_nvenc
\
--enable-encoder
=
hevc_nvenc
endif
endif
...
...
contrib/src/ffnvcodec/rules.mak
0 → 100644
View file @
ac6044f8
# ffnvcodec
FFNVCODEC_VERSION
:=
n9.0.18.1
FFNVCODEC_GITURL
:=
https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
PKGS
+=
ffnvcodec
ifeq
($(call need_pkg,"ffnvcodec >= 8"),)
PKGS_FOUND
+=
ffnvcodec
endif
$(TARBALLS)/ffnvcodec-$(FFNVCODEC_VERSION).tar.xz
:
$(
call
download_git,
$(FFNVCODEC_GITURL)
,master,
$(FFNVCODEC_VERSION)
)
.sum-ffnvcodec
:
ffnvcodec-$(FFNVCODEC_VERSION).tar.xz
$(
warning
$@
not implemented
)
touch
$@
.sum-ffnvcodec
:
ffnvcodec-$(FFNVCODEC_VERSION).tar.xz
ffnvcodec
:
ffnvcodec-$(FFNVCODEC_VERSION).tar.xz .sum-ffnvcodec
$(UNPACK)
$(MOVE)
.ffnvcodec
:
ffnvcodec
cd
$<
&&
$(HOSTVARS)
DESTDIR
=
$(PREFIX)
$(MAKE)
install
PREFIX
=
""
touch
$@
src/media/video/accel.cpp
View file @
ac6044f8
...
...
@@ -159,6 +159,9 @@ HardwareAccel::initDevice()
{
int
ret
=
0
;
auto
hwType
=
av_hwdevice_find_type_by_name
(
name_
.
c_str
());
if
(
hwType
==
AV_HWDEVICE_TYPE_NONE
and
(
name_
==
"nvenc"
or
name_
==
"nvdec"
))
{
hwType
=
AV_HWDEVICE_TYPE_CUDA
;
}
#ifdef HAVE_VAAPI_ACCEL_DRM
// default DRM device may not work on multi GPU computers, so check all possible values
if
(
name_
==
"vaapi"
)
{
...
...
@@ -258,6 +261,7 @@ std::unique_ptr<HardwareAccel>
HardwareAccel
::
setupDecoder
(
AVCodecID
id
,
int
width
,
int
height
)
{
static
const
HardwareAPI
apiList
[]
=
{
{
"nvdec"
,
AV_PIX_FMT_CUDA
,
AV_PIX_FMT_NV12
,
{
AV_CODEC_ID_H264
,
AV_CODEC_ID_H265
,
AV_CODEC_ID_VP8
,
AV_CODEC_ID_MJPEG
}
},
{
"vaapi"
,
AV_PIX_FMT_VAAPI
,
AV_PIX_FMT_NV12
,
{
AV_CODEC_ID_H264
,
AV_CODEC_ID_MPEG4
,
AV_CODEC_ID_VP8
,
AV_CODEC_ID_MJPEG
}
},
{
"vdpau"
,
AV_PIX_FMT_VDPAU
,
AV_PIX_FMT_NV12
,
{
AV_CODEC_ID_H264
,
AV_CODEC_ID_MPEG4
}
},
{
"videotoolbox"
,
AV_PIX_FMT_VIDEOTOOLBOX
,
AV_PIX_FMT_NV12
,
{
AV_CODEC_ID_H264
,
AV_CODEC_ID_MPEG4
}
},
...
...
@@ -270,7 +274,7 @@ HardwareAccel::setupDecoder(AVCodecID id, int width, int height)
// we don't need frame context for videotoolbox
if
(
api
.
format
==
AV_PIX_FMT_VIDEOTOOLBOX
||
accel
->
initFrame
(
width
,
height
))
{
JAMI_DBG
()
<<
"Attempting to use hardware de
n
coder "
<<
accel
->
getCodecName
()
<<
" with "
<<
api
.
name
;
JAMI_DBG
()
<<
"Attempting to use hardware decoder "
<<
accel
->
getCodecName
()
<<
" with "
<<
api
.
name
;
return
accel
;
}
}
...
...
@@ -284,6 +288,7 @@ std::unique_ptr<HardwareAccel>
HardwareAccel
::
setupEncoder
(
AVCodecID
id
,
int
width
,
int
height
,
AVBufferRef
*
framesCtx
)
{
static
const
HardwareAPI
apiList
[]
=
{
{
"nvenc"
,
AV_PIX_FMT_CUDA
,
AV_PIX_FMT_NV12
,
{
AV_CODEC_ID_H264
,
AV_CODEC_ID_H265
}
},
{
"vaapi"
,
AV_PIX_FMT_VAAPI
,
AV_PIX_FMT_NV12
,
{
AV_CODEC_ID_H264
,
AV_CODEC_ID_MJPEG
,
AV_CODEC_ID_VP8
}
},
{
"videotoolbox"
,
AV_PIX_FMT_VIDEOTOOLBOX
,
AV_PIX_FMT_NV12
,
{
AV_CODEC_ID_H264
}
},
};
...
...
@@ -299,7 +304,7 @@ HardwareAccel::setupEncoder(AVCodecID id, int width, int height, AVBufferRef* fr
if
(
api
.
format
==
AV_PIX_FMT_VIDEOTOOLBOX
||
accel
->
linkHardware
(
framesCtx
)
||
accel
->
initFrame
(
width
,
height
))
{
JAMI_DBG
()
<<
"Attempting to use hardware encoder "
<<
codecName
;
JAMI_DBG
()
<<
"Attempting to use hardware encoder "
<<
codecName
<<
" with "
<<
api
.
name
;
return
accel
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment