[FFmpeg-devel] [PATCH] ffmpeg_filter: enable stream_loop in HWAccel transcoding.

Michael Niedermayer michael at niedermayer.cc
Sat Mar 24 02:14:18 EET 2018


On Wed, Mar 14, 2018 at 04:26:54PM +0800, Jun Zhao wrote:
> 

>  ffmpeg_filter.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 170327a7137d3ce26124c86525566d32c523a948  0001-ffmpeg_filter-enable-stream_loop-in-HWAccel-transcod.patch
> 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)))) {

this can be simplified because after "!desc ||" desc is not NULL

about the patch itself, ill leave this to the people activly working on hwaccel

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180324/37862285/attachment.sig>


More information about the ffmpeg-devel mailing list