Opened 7 years ago

Last modified 7 years ago

#5969 new defect

Closed Captions broken with h264_qsv encoder

Reported by: Sawgr Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: cc QSV
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Ffmpeg 3.2 has -a53cc turned on by default. It works perfectly well when encoding with libx264. Closed Captions from mpeg files are inserted into the resulting mp4, and they can be turned on or off when playing the file in VLC, any other media player or even Apple TV.

3.2 is supposed to include the same functionality when encoding with h264_qsv (Intel QSV hardware acceleration), but it seems to be somehow broken. Captions are included but they are all messed up. Some words show up, some are just gibberish.

How to reproduce:

% ffmpeg.exe -i "Test.ts" -f mpegts -c:v h264_qsv -c:a:0 libmp3lame -b:a:0 128k Out2.mp4
ffmpeg version N-82579-g28d8789
built on 20161120

Attachments (3)

Out2.log (74.7 KB ) - added by Sawgr 7 years ago.
Log Report
Out2.txt (1.3 KB ) - added by Sawgr 7 years ago.
Subtitles as extracted after h264_qsv encoding
Out.txt (1.1 KB ) - added by Sawgr 7 years ago.
Subtitles correctly extracted after libv264 encoding

Download all attachments as: .zip

Change History (17)

by Sawgr, 7 years ago

Attachment: Out2.log added

Log Report

by Sawgr, 7 years ago

Attachment: Out2.txt added

Subtitles as extracted after h264_qsv encoding

by Sawgr, 7 years ago

Attachment: Out.txt added

Subtitles correctly extracted after libv264 encoding

comment:1 by Sawgr, 7 years ago

Original MPEG TS: https://www.datafilehost.com/d/2023377c
libx264 encoded file (right Captions): https://www.datafilehost.com/d/afe2151a
h264_qsv encoded file (wrong Captions): https://www.datafilehost.com/d/12552886

Last edited 7 years ago by Sawgr (previous) (diff)

comment:2 by Carl Eugen Hoyos, 7 years ago

Keywords: cc added; Captions removed

comment:3 by Carl Eugen Hoyos, 7 years ago

Is this issue also reproducible with 0eac93da?

comment:4 by Sawgr, 7 years ago

I'm kind of new to this, so I don't really have an answer to that... Any way I can help?

comment:5 by Carl Eugen Hoyos, 7 years ago

Checkout the relevant version, compile it and test with -a53cc 1

$ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
$ cd ffmpeg
$ git checkout 0eac93da
$ ./configure --enable-libmxf
$ make ffmpeg

in reply to:  6 comment:7 by Sawgr, 7 years ago

Replying to cehoyos:

Or please test this binary:
https://ffmpeg.zeranoe.com/builds/win32/static/2015/ffmpeg-20151130-git-7b11eea-win32-static.7z

This binary gives me a "Unknown encoder 'h264_qsv' " error. I'm going to try and compile build 0eac93da

comment:8 by Sawgr, 7 years ago

Trying to compile 0eac93da. I'm stuck at "./configure --enable-libmxf". I assume it's libmfx instead, but in any case I get "libmfx not found using pkg-config". Sorry. this is all new to me, help much appreciated...

comment:9 by Sawgr, 7 years ago

Still stuck. Can anybody help me compile 0eac93da and I'll do the testing? Thanks

comment:11 by Sawgr, 7 years ago

Thanks. Tested with different samples, -a53cc enabled. Captions still come up totally messed up. Timing is also incorrect. Here's a transcript of the first few seconds:

1
00:00:00,735 --> 00:00:03,102
m go m hogeme

oo smen Ian s can

2
00:00:04,905 --> 00:00:07,573
eal th teahi oka ty?kaWe
nyto afoonnynor llw, aht rll?h y

3
00:00:09,043 --> 00:00:10,576

Ok, yeahOk

loahI veoulo yo.ouoo

comment:12 by Carl Eugen Hoyos, 7 years ago

Does the issue disappear if you disable B-frames?

comment:13 by Sawgr, 7 years ago

I think you are in the right track. Disabling b-frames (-bf 0) gives a way better result. Not yet perfect, but almost readable. This is what I get (as opposed to the text on comment 11). Please let me know what to try next:

1
00:00:00,768 --> 00:00:02,001

I'm gonna get home

s s sas Ian

2
00:00:02,103 --> 00:00:03,235

toeaeaeawith this, okay?

3
00:00:03,337 --> 00:00:04,903

We can deal with thitogeer.

4
00:00:05,006 --> 00:00:07,706

Just don't say anything

to anyone r w, all right?

comment:14 by Carl Eugen Hoyos, 7 years ago

No more suggestions from me, sorry.

Note: See TracTickets for help on using tickets.