Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how extract subtitles from vob under gentoo?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 709
Location: Sota algun pi o alzina...

PostPosted: Tue Jun 06, 2017 2:27 pm    Post subject: how extract subtitles from vob under gentoo? Reply with quote

i use ffmepg for raw video and audio but it not detect vob subtitles to extract them, same with mkvtoolnix...
handbrake detect subtitles but i have to rip entire video ( or not have and option to extract raw video)

i can't use makemkv because it depens of openssl and i am using libressl :(

there any program to extract vob subtitles( .idx)?


thanks so much
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3343
Location: Rasi, Finland

PostPosted: Thu Jun 08, 2017 12:38 pm    Post subject: Reply with quote

Hm. Have you tried -vn -an -c:s copy? That should drop audio and video but leave only subtitles. Although ffmpeg should be smart enough to recognize what you're trying to do if you assing output to be a subtitle file like: ffmpeg -i video.vob output.srt for example.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 709
Location: Sota algun pi o alzina...

PostPosted: Thu Jun 08, 2017 1:23 pm    Post subject: Reply with quote

Zucca wrote:
Hm. Have you tried -vn -an -c:s copy? That should drop audio and video but leave only subtitles. Although ffmpeg should be smart enough to recognize what you're trying to do if you assing output to be a subtitle file like: ffmpeg -i video.vob output.srt for example.


seems ffmpeg no detect subtitles inside of vob( dvd directory), i have tried some dvd and that is, and neither mkvtoolnix
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3343
Location: Rasi, Finland

PostPosted: Thu Jun 08, 2017 1:27 pm    Post subject: Reply with quote

What's the error message when you try to extract subtitles?
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 709
Location: Sota algun pi o alzina...

PostPosted: Thu Jun 08, 2017 4:07 pm    Post subject: Reply with quote

Zucca wrote:
What's the error message when you try to extract subtitles?

none , just not detect them :)

Code:
$ ffprobe VTS_03_1.VOB
ffprobe version 3.3.1 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 6.3.0 (Gentoo 6.3.0 p1.0)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-3.3.1/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe' --disable-static --enable-avfilter --enable-avresample --disable-stripping --enable-nonfree --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-nonfree --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl --enable-hardcoded-tables --enable-iconv --enable-lzma --enable-network --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --disable-vaapi --enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --enable-openal --enable-opengl --disable-libv4l2 --disable-libpulse --disable-libopencore-amrwb --disable-libopencore-amrnb --enable-libfdk-aac --disable-libopenjpeg --enable-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-mmal --disable-libmodplug --disable-libopus --disable-libilbc --disable-librtmp --disable-libssh --disable-libschroedinger --disable-libspeex --enable-libvorbis --disable-libvpx --disable-libzvbi --disable-libbs2b --disable-chromaprint --disable-libflite --disable-frei0r --disable-libfribidi --enable-fontconfig --disable-ladspa --enable-libass --enable-libfreetype --disable-librubberband --disable-netcdf --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --disable-nvenc --disable-libopenh264 --disable-libsnappy --disable-libtheora --disable-libtwolame --disable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=host --disable-doc --disable-htmlpages --enable-manpages
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, mpeg, from 'VTS_03_1.VOB':
  Duration: 00:14:58.56, start: 0.360000, bitrate: 9559 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg, progressive), 720x576 [SAR 64:45 DAR 16:9], 8500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:3[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Unsupported codec with id 100357 for input stream 0


equery u ffmpeg https://paste.pound-python.org/show/pmuWFJeSEBWfU3AL6Kh3/
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3343
Location: Rasi, Finland

PostPosted: Thu Jun 08, 2017 10:12 pm    Post subject: Reply with quote

Well... This sure ain't simple.

I found this.
And I went and tried following:
Code:
cat VIDEO_TS/VTS*.VOB | ffmpeg -y -fflags +genpts -analyzeduration 1000000k -probesize 1000000k -i - -vn -an -c:s srt /tmp/subs.srt
... but it fails. :(
My ffmpeg-fu isn't there yet to solve this here and now...
I'll inform if I found a way.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Thu Jun 08, 2017 10:27 pm    Post subject: Reply with quote

Haven't tried any, but methinks MPlayer, MPV and VLC may be able to do it.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
DawgG
l33t
l33t


Joined: 17 Sep 2003
Posts: 866

PostPosted: Thu Aug 31, 2017 4:48 pm    Post subject: Reply with quote

subs in vobfiles are actually a video-stream, but .srt is a text-format - even ffmpeg cannot transcode this. for ffmpeg to detect the subtitle-stream in a vobfile analyzeduration has to be set extremely high, but even then it sometimes does not work.

to generate a textfile from the video stream i use the following steps (it's been a long time but this should still work):

1. extract the subtitle-videostream of sid 0 with mencoder:
Code:
mencoder <VOBFILE> -nosound -ovc frameno -o /dev/null -vobsuboutindex 0 -sid 0 -vobsubout <SUBFILE>

this should generate <SUBFILE>.sub and <SUBFILE>.idx.

2. then convert the video- and index-files to image-files (eg .tiff) with subp2tiff (included in media-video/ogmrip)
Code:
subp2tiff <SUBFILE>
(no file-extension)
this generates a lot of small image-files and <SUBFILE>.xml.

3. use OCR to convert the imagefiles to textfiles, i use app-text/tesseract.
a loop over all <SUBFILE>-nnnn.tiff creates <SUBFILE>-nnnn.tiff.txt
eg
Code:
for i in $(ls *.tif); do tesseract -l <LANGUAGE> $i $i; done

you have to set <LANGUAGE> to one of tesseracts language-codes or OCR will not work.

4. create final .srt-file with subptools (also from media-video/ogmrip)
Code:
subptools -s -t srt -n lf -i <SUBFILE>.xml -o <SUBFILE>.srt


these steps are quite easily scriptable.
before you mux the .srt-file into your mkv you can change/correct/... it.

to find the SIDs i am interested in i use midentify from mplayer which in this case i think is more flexible than ffmpeg; it works with iso-files, dvd-dirs and vobfiles.

You can also use the ogmrip-gui which basically does the same things but i think it forces you into "full-auto" mode and has no option to only extract and convert the subs.

GOOD LUCK!
_________________
DUMM KLICKT GUT.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Sep 09, 2017 11:35 pm    Post subject: Reply with quote

Nice post, DawgG.

One minor edit for step 3:
Code:
for i in $(ls *.tif); do tesseract -l <LANGUAGE> $i $i; done
is much safer as:
Code:
for i in *.tif; do tesseract -l <LANGUAGE> "$i" "$i"; done
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 709
Location: Sota algun pi o alzina...

PostPosted: Sun Sep 10, 2017 8:06 am    Post subject: Reply with quote

oh thanks you so much , i have to do this when i have time, media-video/ogmrip need the mplayer ..hehehe.
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum