[FFmpeg-user] Export raw (binary) subtitle data

Johannes Bauer dfnsonfsduifb at gmx.de
Sat Jun 3 16:33:22 EEST 2017


Hi there,

I recently got a dashcam and noticed that mplayer spits out odd warnings
about the contained subtitles:

Subtitle word 'pie~ejpgnlekkjgijeiliojpeeeicko' too long!

$ ffmpeg -i 06031028_0041.MOV
[...]
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '06031028_0041.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2017-06-03 10:28:50
    comment         : AMBARELLA A7L
  Duration: 00:03:00.00, start: 0.020000, bitrate: 13059 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661),
yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], 11998 kb/s, 50 fps, 50 tbr,
1200k tbn, 100 tbc (default)
    Metadata:
      creation_time   : 2017-06-03 10:28:50
      handler_name    : Ambarella AVC
      encoder         : Ambarella AVC encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2017-06-03 10:28:50
      handler_name    : Ambarella AAC
    Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 0 kb/s
(default)
    Metadata:
      creation_time   : 2017-06-03 10:28:50
      handler_name    : Ambarella EXT


I do suspect that this "subtitle" information is raw position/speed data
from the camera. Certainly looks like it. I'd like to export these
subtitles using ffmpeg, then "render" them (i.e., reverse engineer the
format, then make something human-readable of them) and then
re-integrate into the videostream. That way, I could later define what I
want to see (or even render multiple different subtitle streams which
would be pretty cool).

So far, I've had no luck exporting the subtitles, however:

# ffmpeg -i 06031028_0041.MOV y.srt
[...]
Output #0, srt, to 'y.srt':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    comment         : AMBARELLA A7L
    encoder         : Lavf56.40.101
    Stream #0:0(eng): Subtitle: subrip (srt) (default)
    Metadata:
      creation_time   : 2017-06-03 10:28:50
      handler_name    : Ambarella EXT
      encoder         : Lavc56.60.100 srt
Stream mapping:
  Stream #0:2 -> #0:0 (mov_text (native) -> subrip (srt))
Press [q] to stop, [?] for help
size=      16kB time=00:02:59.02 bitrate=   0.8kbits/s

Gives something like this:
1
00:00:00,020 --> 00:00:01,020
<font face="(null)" size="0" color="#000000">{\an7}</font>

2
00:00:01,020 --> 00:00:02,020
<font face="(null)" size="0" color="#000000">{\an7}</font>

3
00:00:02,020 --> 00:00:03,020
<font face="(null)" size="0" color="#000000">{\an7}</font>

4
00:00:03,020 --> 00:00:04,020
<font face="(null)" size="0" color="#000000">{\an7}</font>
[...]

I.e., an entry every second, but obviously unable to decode it.

Is there a way to export the raw binary subtitle data just the way it's
interleaved within the video to a file using ffmpeg? If so, I'd greatly
appreciate any pointers.

Thanks very much,
Cheers,
Joe


More information about the ffmpeg-user mailing list