PDA

View Full Version : extract subtitles from ogm with mplayer/ffmpeg


Selur
6th July 2009, 21:43
Taking http://samples.mplayerhq.hu/ogg/bgc.sub.dub.ogm as test object, is it possible to extract the subtitles as a 'normal' .srt with timecodes?

best result I could come up with was ffmpeg -y -i d:\testclips\bgc.sub.dub.ogm -an -vn -scodec copy -f rawvideo sub.srt which resulted in a text file without time codes.

tried also mplayer "bgc.sub.dub.ogm" -sid 0 -mc 0 -nosound -noautosub -noframedrop -vo null -dumpsrtsub but it didn't output anything ;)

So if any one knows if this is possible with mencoder/mplayer/ffmpeg or if it's a no-go please let me know. :)

Cu Selur

froggy1
7th July 2009, 08:59
To get the track IDs
neutrino@neutrino:~/Video/var> ogminfo foo.ogm
(ogminfo.c) (v1/serial 0) fps: 23.976 width height: 848x352 codec: 0x44583530 (DX50)
(ogminfo.c) (t1/serial 1) text/subtitle stream

To dump track ID 1 which is a SRT subtitle
ogmdemux -t 1 foo.ogm

you need ogmtools which provide ogminfo, ogmmerge and ogmdemux ;)

EDIT: IIRC, -dumpsrtsub can only be used to convert a subtitle specified with the -sub option, not one that's embedded in a container

Selur
10th July 2009, 18:05
thanks, knew of ogmtools, just wanted to know if it was possible with mencoder/ffmpeg ;)