Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transcoder: implement a video filter chain for deint+scale
This patch reimplements deinterlacing and scaling with a simple libav filter chain, to make the transcoder compatible with newer ffmpeg/libav codebase. Upstream ffmpeg has removed the long deprecated deinterlacer module used by this code, which made the reimplementation using a filter chain necessary. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
- Loading branch information
Showing
6 changed files
with
179 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c63371c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to build the latest git version of tvheadend (version 3882~ga26944c) on debian jessie (latest updates) on the armel platform and noticed there was an additional package check I had not seen which failed related to libavfilter. I decided to install libavfilter5 and libavfilter-dev (the stable packages available in jessie). Note, I am not using the ffmpeg libraries.
The package check now shows:
checking for ffmpeg libraries ... fail
checking for pkg libavcodec >=55.34.1 ... ok (detected 56.1.0)
checking for pkg libavutil >=53.3.0 ... ok (detected 54.3.0)
checking for pkg libavformat >=55.12.0 ... ok (detected 56.1.0)
checking for pkg libavfilter >=4.0.0 ... ok (detected 5.0.0)
checking for pkg libavresample >=1.1.0 ... ok (detected 2.1.0)
However the build failed on transcoding.c. The errors were:
src/plumbing/transcoding.c: In function ‘create_video_filter’:
src/plumbing/transcoding.c:1093:3: error: implicit declaration of function ‘av_opt_set_int_list’ [-Werror=implicit-function-declaration]
err = av_opt_set_int_list(vs->flt_bufsinkctx, "pix_fmts", pix_fmts,
^
src/plumbing/transcoding.c:1115:3: error: implicit declaration of function ‘avfilter_graph_parse_ptr’ [-Werror=implicit-function-declaration]
err = avfilter_graph_parse_ptr(vs->flt_graph,
^
It seems the libavfilter and libavutil versions in debian jessie is missing these declarations.
Is there any advantage in using ffmpeg over libav versions of these libraries?
I did some searching and found a reference to using avfilter_graph_parse2 instead of avfilter_graph_parse_ptr (https://www.mail-archive.com/libav-user@ffmpeg.org/msg05353.html). This function is present in the libavfilter5 included with debian jessie.
av_opt_set_int_list is more problematic. It is a define in opt.c of libavutil which can be added but this in turn uses another define (av_int_list_length) which would also have to be added. This define uses av_int_list_length_for_size() which is specified in utils.c. I am not sure how to rewrite the code to achieve the same outcome and support both libav and ffmpeg.
It's certainly a challenge trying to make the code compatible with both libav and ffmpeg libraries and the different versions included by different distributions!
If you require further information, please do not hesitate to contact me.
Regards
Paul