[FFmpeg-user] EIA-608/EIA-708 closed captions lost while using h264_vaapi encoder

W Boba w_boba at hotmail.com
Thu Apr 20 21:13:08 EEST 2017


Hello, Everyone!

I want to switch all my live streams to new CPUs and utilize Intel VAAPI accelerated encoding. Everything works wine with the exception of embedded closed captions. They don't get passed through to output stream if accelerated encoder used, while they are in the stream with libx264 encoder.

I am wondering if this is something that can be fixed in FFmpeg or is it h264_vaapi encoder problem?

Please take a look at 2 samples at the bottom of this message, they were made using different encoders from the same input stream.

FFmpeg: N-85588-g61088051bd
Kernel: 4.10.11-041011-generic #201704180310 SMP Tue Apr 18 07:12:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
LSB Version:    core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty

$ vainfo
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: Intel i965 driver for Intel(R) Kabylake - 1.8.0


Command line #1:

ffmpeg -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi_vld -i http://host:port/mpegts -filter:v 'hwdownload,fps=ntsc,format=yuv420p' -map 0:a:0 -map 0:v:0 -acodec aac -ac 2 -b:a 128k -b:v:0 3200k -maxrate 4600k -g 30 -movflags isml+frag_keyframe -sc_threshold 0 -t 30 -bufsize 8192k -vcodec <b>libx264</b> tst_libx264.mp4

FFprobe output on output file #1:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tst_libx264.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1iso6mp41
    encoder         : Lavf57.72.101
  Duration: 00:00:30.10, start: 0.000000, bitrate: 3322 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    <b>Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 3196 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)</b>
    Metadata:
      handler_name    : VideoHandler

Command line #2:

ffmpeg -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi_vld -i http://host:port/mpegts -filter:v 'fps=ntsc' -map 0:a:0 -map 0:v:0 -acodec aac -ac 2 -b:a 128k -b:v:0 3200k -maxrate 4600k -g 30 -movflags isml+frag_keyframe -sc_threshold 0 -t 30 -bufsize 8192k -vcodec <b>h264_vaapi</b> tst_h264_vaapi.mp4

FFprobe output on output file #2:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tst_h264_vaapi.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1iso6mp41
    encoder         : Lavf57.72.101
  Duration: 00:00:30.06, start: 0.000000, bitrate: 2340 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    <b>Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2209 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)</b>
    Metadata:
      handler_name    : VideoHandler




More information about the ffmpeg-user mailing list