[FFmpeg-devel] [PATCH] ffmpeg_filter: enable stream_loop in HWAccel transcoding.
Jun Zhao
mypopydev at gmail.com
Wed Mar 14 10:26:54 EET 2018
-------------- next part --------------
From 731b6cb1f3a13fa18cfe39c1ddba92050b999668 Mon Sep 17 00:00:00 2001
From: Jun Zhao <mypopydev at gmail.com>
Date: Wed, 14 Mar 2018 16:13:39 +0800
Subject: [PATCH] ffmpeg_filter: enable stream_loop in HWAccel transcoding.
use the cmd: ffmpeg -y -stream_loop 1 -hwaccel vaapi -hwaccel_device
/dev/dri/renderD128 -hwaccel_output_format vaapi -i
input.mp4 -c:v h264_vaapi output.mp4 can get the error like:
Error while decoding stream #0:1: Invalid data found when processing
input
Impossible to convert between the formats supported by the filter
'Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
the root cause is can't insert software scale filter in the hwaccel
transcoding pipeline.
Signed-off-by: Jun Zhao <mypopydev at gmail.com>
---
fftools/ffmpeg_filter.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 877fd670e6..c85dd7ae8d 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -452,6 +452,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
int pad_idx = out->pad_idx;
int ret;
char name[255];
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(ofilter->format);
snprintf(name, sizeof(name), "out_%d_%d", ost->file_index, ost->index);
ret = avfilter_graph_create_filter(&ofilter->filter,
@@ -461,7 +462,8 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
if (ret < 0)
return ret;
- if (ofilter->width || ofilter->height) {
+ if ((ofilter->width || ofilter->height) &&
+ (!desc || (desc && !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)))) {
char args[255];
AVFilterContext *filter;
AVDictionaryEntry *e = NULL;
--
2.14.1
More information about the ffmpeg-devel
mailing list