Opened 17 months ago

Last modified 13 months ago

#8677 new enhancement

HEVC libx265 removes Closed caption

Reported by: Dhanish Vijayan Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: libx265
Cc: graycapo@yahoo.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I am using the FFmpeg static binary to trancode ts file to HLS.

The ffprobe output of the input file as shown.

abish@abish-TUF-Gaming-FX505DT-FX505DT:~/Documents/InavadaTest$ ./ffmpeg-4.2.2-amd64-static/ffprobe AMC.ts 
ffprobe version 4.2.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[mpeg2video @ 0x65b3b80] Invalid frame dimensions 0x0.
    Last message repeated 20 times
[mpegts @ 0x65aea40] start time for stream 5 is not set in estimate_timings_from_pts
[mpegts @ 0x65aea40] PES packet size mismatch
    Last message repeated 1 times
[mpegts @ 0x65aea40] Could not find codec parameters for stream 1 (Unknown: none (ETV1 / 0x31565445)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x65aea40] Could not find codec parameters for stream 2 (Unknown: none (ETV1 / 0x31565445)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x65aea40] Could not find codec parameters for stream 6 (Unknown: none ([192][0][0][0] / 0x00C0)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'AMC.ts':
  Duration: 00:09:59.51, start: 63682.431556, bitrate: 3122 kb/s
  Program 2008 
    Stream #0:0[0xdec]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 704x480 [SAR 10:11 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0xded]: Unknown: none (ETV1 / 0x31565445)
    Stream #0:2[0xdee]: Unknown: none (ETV1 / 0x31565445)
    Stream #0:3[0xdef](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:4[0xdf0](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, mono, fltp, 96 kb/s
    Stream #0:5[0xdf1]: Data: scte_35
    Stream #0:6[0xe21]: Unknown: none ([192][0][0][0] / 0x00C0)
Unsupported codec with id 0 for input stream 1
Unsupported codec with id 0 for input stream 2
Unsupported codec with id 98305 for input stream 5
Unsupported codec with id 0 for input stream 6

How to reproduce:

% ./ffmpeg-4.2.2-amd64-static/ffmpeg -y -i AMC.ts   -preset slow -g 48 -sc_threshold 0   -map 0:0 -map 0:3 -map 0:0 -map 0:4   -s:v:0 640x360 -c:v:0 libx265 -b:v:0  2000k   -s:v:1 960x540 -c:v:1 libx265 -b:v:1 365k   -c:a  aac -b:a 128k -ac 2   -var_stream_map "v:0,a:0 v:1,a:1"   -master_pl_name stream.m3u8   -f hls -hls_time 6 -hls_list_size 0   -hls_segment_filename "stream/v%v/fileSequence%d.ts"   stream/v%v/prog_index.m3u8

ffmpeg version Version 4.2.2-static
built with gcc 8 (Debian 8.3.0-6)

ffprobe on the output filesgment of HLS shows that the CC is removed.

abish@abish-TUF-Gaming-FX505DT-FX505DT:~/Documents/InavadaTest$ ./ffmpeg-4.2.2-amd64-static/ffprobe stream/v0/fileSequence0.ts 
ffprobe version 4.2.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mpegts, from 'stream/v0/fileSequence0.ts':
  Duration: 00:00:08.23, start: 1.445422, bitrate: 2061 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv), 640x360 [SAR 3:4 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
    Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 121 kb/s

I have a similar transcoding command with the libx264 instead of libx265, and libx264 preserves Closed caption'''

Change History (7)

comment:1 by Carl Eugen Hoyos, 17 months ago

Analyzed by developer: unset
Keywords: HEVC libx265 removed
Priority: criticalnormal
Reproduced by developer: unset
Version: 4.2unspecified

Please test current FFmpeg git head - the only version supported on this bug tracker - and provide a sample input file.

comment:2 by Dhanish Vijayan, 17 months ago

Version: unspecified4.2

comment:3 by Dhanish Vijayan, 17 months ago

Keywords: HEVC libx265 added

comment:4 by Carl Eugen Hoyos, 17 months ago

Keywords: HEVC removed
Priority: normalwish
Type: defectenhancement
Version: 4.2git-master

comment:5 by Dhanish Vijayan, 16 months ago

Any updates on this. I think the H265 standard supports the Closed Caption in the data format. But still waiting for it to become available in FFMPEG..

comment:6 by GrayC, 13 months ago

Cc: graycapo@yahoo.com added
Component: avcodecffmpeg

Any way of offering a bounty or making a donation to the development team to help get ffmpeg Closed Captions working with HEVC libx265? We really need this capability to support the hearing impared. Thank you

comment:7 by Carl Eugen Hoyos, 13 months ago

Component: ffmpegavcodec

Please test current FFmpeg git head - the only version supported on this bug tracker - and provide a sample input file to make this a valid ticket.

Note: See TracTickets for help on using tickets.