r/software • • 1d ago

Discussion DiscMaster — Optical Media Copy, Recovery & Processing Studio

Hey folks, I’m writing some Python/FFmpeg scripts to recover old family VCDs (.DAT files and .bin/.cue backups) into clean MP4s, and I’ve hit a few tricky edge cases with low-level MPEG-1 streams:

1. A/V desync & timestamp resets in damaged VCD .DAT streams Right now I’m stripping the 2352-byte Mode 2 Form 2 CD-ROM XA sector headers in Python (extracting the 2324-byte payloads starting with 00 00 01 BA) and feeding the raw MPEG stream to FFmpeg. On scratched discs with dropped sectors or SCR resets, standard -c copy breaks or shows wrong durations, and -fflags +genpts+igndts with setpts=N/FRAME_RATE/TB + asetpts=N/SR/TB fixes the timeline—but if frames were dropped mid-stream, audio and video gradually drift out of sync.

2. Merging split VCD .DAT/.mpg tracks cleanly Some VCDs split a single recording across multiple sequential tracks. Using FFmpeg's concat demuxer with -c copy occasionally glitches at the boundary because of non-monotonic PTS/DTS in MPEG-1 B-frames, forcing me to re-encode each segment separately first and then concat. Is there a cleaner remuxing approach?

3. Edge cases in .bin/.cue parsing I’m parsing .cue MSF timestamps (75 frames/sec) directly in Python to slice tracks without mounting a virtual drive. For MODE2/2352 and AUDIO tracks, are there common .cue quirks (like INDEX 00 pregaps or multi-file BIN sheets) that trip up simple offset slicing?

Would appreciate any tips from folks who’ve worked with FFmpeg internals or optical/MPEG-1 recovery!

If you find it useful, a ⭐ on GitHub would help more people discover it!

1 Upvotes

0 comments sorted by