mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
videoconvert: add an ffmpeg based video converter
To activate:
PIPEWIRE_PROPS='{ video.adapt.converter = video.convert.ffmpeg }' build/src/examples/video-play
This makes it possible to start firefox with mjpg capture and then
video-play and it will decode the mjpeg transparently. Works for other
incompatible video formats as well, as long as they can be mmapped.
Ideally this should use something GPU accelerated and this is what the
vulkan converter will do.
This commit is contained in:
parent
b57375ba85
commit
2cbcdbc579
4 changed files with 1958 additions and 5 deletions
|
|
@ -310,7 +310,8 @@ ffmpeg = get_option('ffmpeg')
|
|||
if pw_cat_ffmpeg.allowed() or ffmpeg.allowed()
|
||||
avcodec_dep = dependency('libavcodec', required: pw_cat_ffmpeg.enabled() or ffmpeg.enabled())
|
||||
avformat_dep = dependency('libavformat', required: pw_cat_ffmpeg.enabled())
|
||||
avutil_dep = dependency('libavutil', required: pw_cat_ffmpeg.enabled())
|
||||
avutil_dep = dependency('libavutil', required: pw_cat_ffmpeg.enabled() or ffmpeg.enabled())
|
||||
swscale_dep = dependency('libswscale', required: pw_cat_ffmpeg.enabled() or ffmpeg.enabled())
|
||||
else
|
||||
avcodec_dep = dependency('', required: false)
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -4,13 +4,23 @@ videoconvert_sources = [
|
|||
'plugin.c'
|
||||
]
|
||||
|
||||
simd_cargs = []
|
||||
simd_dependencies = []
|
||||
extra_cargs = []
|
||||
extra_dependencies = []
|
||||
|
||||
if avcodec_dep.found() and avutil_dep.found() and swscale_dep.found()
|
||||
videoconvert_ffmpeg = static_library('videoconvert_fmmpeg',
|
||||
['videoconvert-ffmpeg.c' ],
|
||||
dependencies : [ spa_dep, avcodec_dep, avutil_dep, swscale_dep ],
|
||||
install : false
|
||||
)
|
||||
extra_cargs += '-D HAVE_VIDEOCONVERT_FFMPEG'
|
||||
extra_dependencies += videoconvert_ffmpeg
|
||||
endif
|
||||
|
||||
videoconvertlib = shared_library('spa-videoconvert',
|
||||
videoconvert_sources,
|
||||
c_args : simd_cargs,
|
||||
c_args : extra_cargs,
|
||||
dependencies : [ spa_dep, mathlib ],
|
||||
link_with : simd_dependencies,
|
||||
link_with : extra_dependencies,
|
||||
install : true,
|
||||
install_dir : spa_plugindir / 'videoconvert')
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
|
||||
extern const struct spa_handle_factory spa_videoadapter_factory;
|
||||
extern const struct spa_handle_factory spa_videoconvert_dummy_factory;
|
||||
#if HAVE_VIDEOCONVERT_FFMPEG
|
||||
extern const struct spa_handle_factory spa_videoconvert_ffmpeg_factory;
|
||||
#endif
|
||||
|
||||
SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED;
|
||||
|
||||
|
|
@ -25,6 +28,11 @@ int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t
|
|||
case 1:
|
||||
*factory = &spa_videoconvert_dummy_factory;
|
||||
break;
|
||||
#if HAVE_VIDEOCONVERT_FFMPEG
|
||||
case 2:
|
||||
*factory = &spa_videoconvert_ffmpeg_factory;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
1934
spa/plugins/videoconvert/videoconvert-ffmpeg.c
Normal file
1934
spa/plugins/videoconvert/videoconvert-ffmpeg.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue