amiaopensource / vrecord

Vrecord is open-source software for capturing a video signal and turning it into a digital file.
https://github.com/amiaopensource/vrecord
149 stars 44 forks source link

Show decoded caption data in Caption viewer #810

Open iamdamosuzuki opened 6 days ago

iamdamosuzuki commented 6 days ago

I would like to have the option to view the decoded caption data in the Caption Viewer mode, rather than the raw hex values.

dericed commented 3 days ago

Hmm, I'm not sure how to get ffmpeg to do this, cc'ing @richardpl for advice.

Currently the caption values as accessible in their hexadecimal form via the metadata filter (as used at https://github.com/amiaopensource/vrecord/blob/e933bd84d62a0bd5edaa8891f6a20557c116443b/vrecord#L551) and then output to a file. Then a function processes that metadata output from those hex values into an scc (https://github.com/amiaopensource/vrecord/blob/e933bd84d62a0bd5edaa8891f6a20557c116443b/vrecord#L265-L340, this is borrowed from sccyou).

To get onscreen captions for a live input, then the output of the metadata filter would need to be sent back to ffmpeg as an additional input. I see that ffmpeg has an 608 decoder but I'm uncertain how to accept that as an input as there's no -f rawdata -c eia608 options.

richardpl commented 3 days ago

You could write .scc files and use .scc demuxer from libavformat, if you instead need realtime/stream solution than its more complex.