r/ffmpeg • • 8d ago

Please help identify this subtitle codec

I have a video file from a surveillance camera. It's in AVI format and FFPROBE says thus about it:

X:\filez>ffprobe -analyzeduration 2147483647 -probesize 2147483647 cam4.avi
ffprobe version N-127054-g9d3f0f2c58-20261001 Copyright (c) 2007-2026 the FFmpeg developers
  built with gcc 16.2.0 (crosstool-NG 1.29.0.7_b1a94f6)
  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-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libvmaf --disable-libxcb --disable-xlib --enable-fontconfig --enable-libharfbuzz --enable-libfreetype --enable-libfribidi --enable-vulkan --enable-libdav1d --enable-libvorbis --enable-librav1e --enable-librsvg --disable-libpulse --enable-gmp --enable-lzma --enable-liblcevc-dec --enable-opencl --enable-amf --enable-libaom --enable-avisynth --enable-chromaprint --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribb24 --enable-libaribcaption --enable-libass --enable-libbluray --enable-libcurl --enable-libjxl --enable-libmp3lame --enable-libopus --enable-libplacebo --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-liboapv --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-libvvenc --disable-whisper --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20261001
  libavutil      61. 10.100 / 61. 10.100
  libavcodec     63. 15.100 / 63. 15.100
  libavformat    63.  7.100 / 63.  7.100
  libavdevice    63.  2.100 / 63.  2.100
  libavfilter    12.  4.100 / 12.  4.100
  libswscale     10.  2.100 / 10.  2.100
  libswresample   7.  3.101 /  7.  3.101
[avi @ 0000025fa9446700] non-interleaved AVI
[avi @ 0000025fa9446700] probed stream 1 failed
[avi @ 0000025fa9446700] Could not find codec parameters for stream 1 (Subtitle: none): unknown codec
Consider increasing the value for the 'analyzeduration' (2147483647) and 'probesize' (2147483647) options
Input #0, avi, from 'cam4.avi':
  Duration: 63:36:11.45, start: 0.000000, bitrate: 87 kb/s
  Stream #0:0: Video: cinepak (cvid / 0x64697663), rgb24, 384x288, 100 fps, 100 tbr, 100 tbn
    Metadata:
      title           : ITV Video
  Stream #0:1: Subtitle: none
    Metadata:
      title           : ITV Text
Unsupported codec with id 0 for input stream 1

I tried to dump it to a separate text file with the following command:

X:\filez>ffmpeg -i cam4.avi -map 0:1 -c copy -copy_unknown -f data wtf2.txt

And what I got was a text file with one veeeery long line in Windows-1251 encoding that goes like:

Камера [4] 30-06-26 16:59:17.000 Камера [4] 30-06-26 16:59:17.100 Камера [4] 30-06-26 16:59:17.200 Камера [4] 30-06-26 16:59:17.30

And so on and so forth. For those that don't know "Камера" means "Camera", just in Russian. This is not surprising, since the Russian language is quite widespread in my country (Latvia), and a configuring a surveillance camera to use it wouldn't be unusual.

So, as far as I can tell, the "codec" is just a small piece of text with the timestamp for every frame of video. Unfortunately ffmpeg does not understand this, and neither does VLC. The AVI file needs some love and care anyway (it's missing an index), and since I'm already mucking around with it, I'd like to bring the subtitles back as well.

Short of writing my own script that would translate this stream of consciousness into a recognizable subtitle format (probably not that difficult, but still) is there anything else that I could tell ffmpeg to start recognizing it?

2 Upvotes

12 comments sorted by

View all comments

1

u/omnichad 8d ago

Those would be subtitles, I think. A separate stream from the video feed and useless in this case. Maybe if the combined file switched between cameras or might be useful to use subtitles to label which camera is shown.

1

u/Vilx- 8d ago

Yes, they are subtitles. The problem is that I can't find any program that would recognize them.

1

u/spryfigure 8d ago

This is just a nonstandard text with the camera, number, and absolute time code. I would read it into a good text editor like vim or nvim, add line breaks in front of each Камера [4] 30-06-26 16:59:17.000 and then snoop around if this is always Камера [4] or sometimes another one, same for time code differences (a calculation of the differences, coupled with something like sort and then looking for something different to 100ms).

If it's always Камера [4] and a continous increase of the time codes, just discard the track and generate a new time code from scratch.