[FFmpeg-user] [EXTERNAL] Re: attempting to extract srt from mpg

Shupert, Jim jim.shupert at hearst.com
Wed Oct 20 16:06:14 EEST 2021



Here is an example with ffmpeg:

$ /usr/bin/ffmpeg -f lavfi -i \
'movie=4131_20150814180000.mpg[out0+subcc]' -t 00:01:00 -map s \ /tmp/4131_20150814180000.mpg.srt

ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-\ gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libja\ ck --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enabl\ e-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265
--enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-\
sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100
[mpegts @ 0x558f9643a9c0] PES packet size mismatch Input #0, lavfi, from 'movie=4131_20150814180000.mpg[out0+subcc]':
Duration: N/A, start: 16071.108744, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc Stream #0:1: Subtitle: eia_608 Output #0, srt, to '/tmp/4131_20150814180000.mpg.srt':
Metadata:
encoder         : Lavf58.29.100
Stream #0:0: Subtitle: subrip (srt)
Metadata:
encoder         : Lavc58.54.100 srt
Stream mapping:
Stream #0:1 -> #0:0 (eia_608 (cc_dec) -> subrip (srt)) Press [q] to stop, [?] for help
size=       2kB time=00:00:58.19 bitrate=   0.2kbits/s speed=6.59x
video:0kB audio:0kB subtitle:1kB other streams:0kB global headers:0kB muxing overhead: 45.037453%


mythtv-user at mythtv-server:/var/lib/mythtv/recordings$ cat /tmp/4131_20150814180000.mpg.srt
1
00:00:00,000 --> 00:00:32,900
<font face="Monospace">{\an7}\h\h\h\h- HI. I’M MURRAY FROM "SESAME STREET," AND I’M LOOKING</font>


Thanks for the suggestion
But

My effort fails with
[lavfi @ 000001c05b20df00] No such filter: 'movie=mtp_1.mpg[out0+subcc]'
'movie=mtp_1.mpg[out0+subcc]': Invalid argument
If I do a ffmpeg -filters
I do not see a lavfi in the listing with the "L"s  is that my problem?

When I run


C:\0h>ffmpeg -f lavfi -i 'movie=mtp_1.mpg[out0+subcc]'  s mtp_mpg_j.srt
ffmpeg version N-99707-g2b702015d8 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-debug --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --enable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
  libavutil      56. 60.100 / 56. 60.100
  libavcodec     58.111.101 / 58.111.101
  libavformat    58. 62.100 / 58. 62.100
  libavdevice    58. 11.102 / 58. 11.102
  libavfilter     7. 88.100 /  7. 88.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[lavfi @ 000001c05b20df00] No such filter: 'movie=mtp_1.mpg[out0+subcc]'
'movie=mtp_1.mpg[out0+subcc]': Invalid argument



thanks












More information about the ffmpeg-user mailing list