Search code examples
ffmpegvideo-streaminghttp-live-streamingmpegclosed-captions

How to encode .cap Closed Caption into MPEG video


I have a .cap Closed Captions file and a .mpg video that I want to add this into. I have seen several hundreds examples of how this is done for .srt (subtitles) and any video format using ffmpeg but there is no solution that I could find for .cap.

End goal is converting this video with Closed Caption to HLS stream. There are two ways it could be done, I think: 1. Encode the captions to video first > Then convert to HLS OR 2. Convert the video to HLS first > Then add closed captions on .ts segments

I could not find a way to include the .cap file though. ffmpeg throws the following error - mycaptionsfile.cap: Invalid data found when processing input

This is the cmd I am using for my video to hls conversion though - ffmpeg -hide_banner -y -i myvideo.mpg -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename 720p_%03d.ts 720p.m3u8


Solution

  • Apparently, you can only use Cheetah's own converter to convert .cap to .scc and then take it from there. May be use CaptionMaker or Adobe Premiere Pro. Trial are available as well for a limited period.

    Some reference is here - http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_FORMAT.HTML

    , and here - https://ffmpeg.org/pipermail/ffmpeg-user/2015-August/027936.html