Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert c708 /clcp from Quicktime to SRT #21

Open
kamari-swami opened this issue May 6, 2024 · 0 comments
Open

Convert c708 /clcp from Quicktime to SRT #21

kamari-swami opened this issue May 6, 2024 · 0 comments

Comments

@kamari-swami
Copy link

I have .MOV file with following info:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HTI_short.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.76.100
    timecode        : 09:59:00:00
  Duration: 00:25:23.00, start: 0.000000, bitrate: 2768 kb/s
  Stream #0:0(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : TimeCodeHandler
      timecode        : 09:59:00:00
  Stream #0:1(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, gbr/reserved/reserved, top coded first (swapped)), 1920x1080, 65625 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : FFMP
  Stream #0:2(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:3(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:4(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:5(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:6(eng): Subtitle: none (c708 / 0x38303763), 1920x1080, 18 kb/s (default)
    Metadata:
      handler_name    : ClosedCaptionHandler
Unsupported codec with id 0 for input stream 0
Unsupported codec with id 0 for input stream 6
    "format": {
        "filename": "HTI_short.mov",
        "nb_streams": 7,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "1523.000000",
        "size": "526992491",
        "bit_rate": "2768181",
        "probe_score": 100,
        "tags": {
            "major_brand": "qt  ",
            "minor_version": "512",
            "compatible_brands": "qt  ",
            "encoder": "Lavf58.76.100",
            "timecode": "09:59:00:00"
        }
    }
}

I converted that to MPEG2 TS as below:

$ ffmpeg -i HTI_short.mov -map 0 -ac 2 -c:s copy -map 0:d -c:d copy -f mpegts HTI.ts
====================================
ffmpeg -i HTI_short.mov -map 0:v -map 0:a -ac 2 -map 0:s -c:s copy -map 0:d -c:d copy -f mpegts HTI.ts                                                           ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558d4a7a5740] Could not find codec parameters for stream 6 (Subtitle: none (c708 / 0x38303763), 1920x1080, 18 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Guessed Channel Layout for Input Stream #0.5 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HTI_short.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.76.100
    timecode        : 09:59:00:00
  Duration: 00:25:23.00, start: 0.000000, bitrate: 2768 kb/s
  Stream #0:0(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : TimeCodeHandler
      timecode        : 09:59:00:00
  Stream #0:1(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, gbr/reserved/reserved, top coded first (swapped)), 1920x1080, 65625 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : FFMP
  Stream #0:2(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:3(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:4(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:5(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:6(eng): Subtitle: none (c708 / 0x38303763), 1920x1080, 18 kb/s (default)
    Metadata:
      handler_name    : ClosedCaptionHandler
File 'HTI.ts' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:1 -> #0:0 (prores (native) -> mpeg2video (native))
  Stream #0:2 -> #0:1 (pcm_s24be (native) -> mp2 (native))
  Stream #0:3 -> #0:2 (pcm_s24be (native) -> mp2 (native))
  Stream #0:4 -> #0:3 (pcm_s24be (native) -> mp2 (native))
  Stream #0:5 -> #0:4 (pcm_s24be (native) -> mp2 (native))
  Stream #0:6 -> #0:5 (copy)
  Stream #0:0 -> #0:6 (copy)
Press [q] to stop, [?] for help
Output #0, mpegts, to 'HTI.ts':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    timecode        : 09:59:00:00
    encoder         : Lavf58.76.100
  Stream #0:0(eng): Video: mpeg2video (4:2:2), yuv422p(tv, unknown/reserved/reserved, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : FFMP
      encoder         : Lavc58.134.100 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
  Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 mp2
  Stream #0:2(eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 mp2
  Stream #0:3(eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 mp2
  Stream #0:4(eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 mp2
  Stream #0:5(eng): Subtitle: none (c708 / 0x38303763), 1920x1080, 18 kb/s (default)
    Metadata:
      handler_name    : ClosedCaptionHandler
  Stream #0:6(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : TimeCodeHandler
      timecode        : 09:59:00:00
[mpegts @ 0x558d4a8217c0] Stream 5, codec none, is muxed as a private data stream and may not be recognized upon reading.
[mpegts @ 0x558d4a8217c0] Stream 6, codec none, is muxed as a private data stream and may not be recognized upon reading.
frame= 1500 fps=123 q=31.0 Lsize=   25610kB time=00:00:59.96 bitrate=3498.6kbits/s speed= 4.9x
video:12741kB audio:11250kB subtitle:136kB other streams:0kB global headers:0kB muxing overhead: 6.144103%

When i am trying to extract subtitles as below, the output file is blank:

$ ffmpeg -f lavfi -i "movie=HTI.ts[out0+subcc]"  -map 0:s HTI.ts.srt

ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
Input #0, lavfi, from 'movie=HTI.ts[out0+subcc]':
  Duration: N/A, start: 1.440000, bitrate: N/A
  Stream #0:0: Video: rawvideo (Y42B / 0x42323459), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 90k tbc
  Stream #0:1: Subtitle: eia_608
Output #0, srt, to 'HTI.ts.srt':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Subtitle: subrip
    Metadata:
      encoder         : Lavc58.134.100 srt
Stream mapping:
  Stream #0:1 -> #0:0 (eia_608 (cc_dec) -> subrip (srt))
Press [q] to stop, [?] for help
[Parsed_movie_0 @ 0x5a615207fc40] EOF timestamp not reliable
size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

I think I am converting MOV -> TS wrongly which results into this. Any pointer how can i achieve my goal of extracting captions as srt or webvtt files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant