M: I have a vob file set from a dvd, VTS_02_1.VOB through VTS_02_4.VOB. Help me use ffmpeg to encode it to the quality used by the YTS group.

G: [Non-text content: thoughts; content_type=thoughts]

G: [Non-text content: reasoning_recap; content_type=reasoning_recap]

G: TL;DR: Join the VOBs, IVTC/deinterlace if needed, then encode H.264 or H.265 with a fairly aggressive CRF, slow preset, AAC stereo ~128–160 kbps, and wrap in MKV. YTS-style = small file, “film” tune, 24 fps, and soft subs kept. Commands below you can paste and run.

0) Set up filenames

printf "file '%s'\n" VTS_02_1.VOB VTS_02_2.VOB VTS_02_3.VOB VTS_02_4.VOB > vobs.txt

1) Quick scan to see what you’ve got

Check interlace/telecine and audio layout:

ffprobe -hide_banner -i concat:vobs.txt

If you see ~29.97 fps with repeated fields (classic NTSC telecine), use IVTC. If it’s true 25 fps (PAL) or true 23.976/24 fps, skip IVTC. If it’s interlaced, deinterlace.

2) (Optional) Find black bars for clean crop

Let this run ~30–60 s and note the crop= it prints repeatedly:

ffmpeg -hide_banner -nostdin -fflags +genpts -f concat -safe 0 -i vobs.txt \
  -t 60 -vf cropdetect=limit=0.1:round=2:reset=0 -an -sn -f null -

Example output might suggest crop=704:368:8:56. Use whatever it reports consistently.

3) Choose your target

YTS style typically means:

A) NTSC DVD with telecine → do IVTC to 23.976 fps

Use yadif=mode=send_frame:parity=tff:deint=interlaced, fieldmatch, decimate (safe combo) or pullup,decimate. Here’s a solid, safe chain:

H.264 (x264), 1080p-ish target width (keep DVD scale reasonable; usually 720p is enough)

ffmpeg -hide_banner -nostdin -fflags +genpts -f concat -safe 0 -i vobs.txt \
  -map 0:v:0 -map 0:a:0 -map 0:s? \
  -vf "bwdif=mode=send_frame:parity=auto:deint=all,fieldmatch,decimate,\
       crop=iw:ih,scale=-2:720:flags=lanczos" \
  -c:v libx264 -preset slow -tune film -profile:v high -level 4.1 -pix_fmt yuv420p \
  -crf 22 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  -c:s copy \
  -movflags +faststart \
  ytsish_720p_h264.mkv

H.265 (x265), same filter chain

ffmpeg -hide_banner -nostdin -fflags +genpts -f concat -safe 0 -i vobs.txt \
  -map 0:v:0 -map 0:a:0 -map 0:s? \
  -vf "bwdif=mode=send_frame:parity=auto:deint=all,fieldmatch,decimate,\
       crop=iw:ih,scale=-2:720:flags=lanczos" \
  -c:v libx265 -preset slow -tune film -pix_fmt yuv420p \
  -x265-params profile=main:level=4.1 \
  -crf 23 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  -c:s copy \
  ytsish_720p_h265.mkv

B) True progressive (23.976/24 fps) → skip IVTC, just (optional) deinterlace safeguard

If ffprobe shows progressive 23.976/24, you can simplify to:

ffmpeg -hide_banner -nostdin -fflags +genpts -f concat -safe 0 -i vobs.txt \
  -map 0:v:0 -map 0:a:0 -map 0:s? \
  -vf "bwdif=mode=send_frame:parity=auto:deint=all,crop=iw:ih,scale=-2:720:flags=lanczos" \
  -c:v libx264 -preset slow -tune film -profile:v high -level 4.1 -pix_fmt yuv420p \
  -crf 22 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  -c:s copy \
  ytsish_720p_h264.mkv

4) Bitrate-targeted (optional)

If you prefer targeting a file size (e.g., “~1.2 GB for 720p”), use 2-pass:

# Example ~1.2 Mbps video (~1.1–1.3 GB for a 2-hour movie after audio)
ffmpeg -hide_banner -nostdin -f concat -safe 0 -i vobs.txt \
  -vf "bwdif=mode=send_frame:parity=auto:deint=all,fieldmatch,decimate,\
       crop=iw:ih,scale=-2:720:flags=lanczos" \
  -c:v libx264 -preset slow -tune film -pix_fmt yuv420p -b:v 1200k -pass 1 \
  -an -sn -f mkv /dev/null

ffmpeg -hide_banner -nostdin -f concat -safe 0 -i vobs.txt \
  -vf "bwdif=mode=send_frame:parity=auto:deint=all,fieldmatch,decimate,\
       crop=iw:ih,scale=-2:720:flags=lanczos" \
  -c:v libx264 -preset slow -tune film -pix_fmt yuv420p -b:v 1200k -pass 2 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  -c:s copy \
  ytsish_720p_h264.mkv

CRF is usually nicer and closer to how YTS encodes today; 2-pass is just for tight size targets.

5) Chapters & subtitles (optional polish)

6) Typical YTS-ish knobs (quick reference)

Third option / omission

If you prefer a literally tiny file (old-school “700 MB 720p”), push CRF higher (x264: 23–24, x265: 24–25) and accept more banding and softness; that’s closer to early YIFY compressions but the quality hit is real.

If you want, give me your ffprobe video and audio lines (streams + fps) and any cropdetect result, and I’ll plug the exact filters and CRF into a ready-to-paste command.

M: i left out something - i want -track 2- to be the main and only audio.

G: Got it 👍 If you only want track 2 as your main audio and nothing else, just change the mapping so only that stream is kept.

For example, in the H.264 encode command I gave earlier, replace the audio mapping line with:

-map 0:v:0 -map 0:a:1 -map 0:s?

Explanation:

Then you can drop the -ac 2 -b:a 160k (or whatever settings you want) on just that track.

Full example with H.264 + CRF 22:

ffmpeg -hide_banner -nostdin -fflags +genpts -f concat -safe 0 -i vobs.txt \
  -map 0:v:0 -map 0:a:1 -map 0:s? \
  -vf "bwdif=mode=send_frame:parity=auto:deint=all,fieldmatch,decimate,\
       crop=iw:ih,scale=-2:720:flags=lanczos" \
  -c:v libx264 -preset slow -tune film -profile:v high -level 4.1 -pix_fmt yuv420p \
  -crf 22 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  -c:s copy \
  ytsish_720p_h264.mkv

If you don’t want subtitles either, just drop the -map 0:s? -c:s copy.

Want me to adapt the H.265 example too with track 2 locked in?

M: the original is 25 fps when playing in VLC. give me the appropriate ffmpeg command, knowing that, with a single pass approach, while using audio track 2 from the VOB as the main and only audio track in the result.

G: [Non-text content: thoughts; content_type=thoughts]

G: [Non-text content: reasoning_recap; content_type=reasoning_recap]

G: Here’s a solid single-pass PAL (25 fps) command that keeps audio track 2 only, YTS-style H.264 at 720p:

# 1) Make a concat list of your VOBs (order matters)
printf "file '%s'\n" VTS_02_1.VOB VTS_02_2.VOB VTS_02_3.VOB VTS_02_4.VOB > vobs.txt

# 2) Encode: 25 fps, H.264 CRF, slow preset, film tune, AAC stereo; audio track 2 only
ffmpeg -hide_banner -nostdin -fflags +genpts -f concat -safe 0 -i vobs.txt \
  -map 0:v:0 -map 0:a:1 -map 0:s? \
  -vf "yadif=mode=send_frame:parity=auto:deint=interlaced,scale=-2:720:flags=lanczos,fps=25" \
  -c:v libx264 -preset slow -tune film -profile:v high -level 4.1 -pix_fmt yuv420p \
  -crf 22 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  -c:s copy \
  ytsish_pal25_720p_h264.mkv

Notes:

If you prefer HEVC for a smaller file at similar quality, swap the video part for:

-c:v libx265 -preset slow -tune film -pix_fmt yuv420p -x265-params profile=main -crf 23

This keeps 25 fps, uses only track 2 for audio, and lands in the YTS-ish quality/size range.

M: everything was orking, but there’s a complication: the ONLY vob file that uses track 2 is the first one. numbers 2, 3, and 4 have track 1 as the appropriate one. suggestions?

G: [Non-text content: thoughts; content_type=thoughts]

G: [Non-text content: reasoning_recap; content_type=reasoning_recap]

G: Nice catch. When the “right” audio track index changes across segments, treat each VOB as a separate input and explicitly pick the correct stream per file, then concat in filters. Here’s a clean, single-pass H.264 command that keeps 25 fps, downmixes to AAC stereo, and uses track 2 from the first VOB and track 1 from the rest.

# Inputs: four separate VOBs (order matters)
ffmpeg -hide_banner -nostdin \
  -i VTS_02_1.VOB -i VTS_02_2.VOB -i VTS_02_3.VOB -i VTS_02_4.VOB \
  -filter_complex "\
    [0:v:0][1:v:0][2:v:0][3:v:0] concat=n=4:v=1:a=0 [vcat]; \
    [0:a:1][1:a:0][2:a:0][3:a:0] concat=n=4:v=0:a=1 [acat]; \
    [vcat]bwdif=mode=send_frame:parity=auto:deint=all,scale=-2:720:flags=lanczos,fps=25 [v]" \
  -map "[v]" -map "[acat]" \
  -c:v libx264 -preset slow -tune film -profile:v high -level 4.1 -pix_fmt yuv420p \
  -crf 22 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  ytsish_pal25_720p_h264.mkv

Notes:

If you’d rather go HEVC for smaller size at similar visual quality, swap the video codec block:

  -c:v libx265 -preset slow -tune film -pix_fmt yuv420p -x265-params profile=main \
  -crf 23

Third option / omission

If the concat complains that audio formats don’t match (rare on a single PGC, but possible), normalize each input’s audio before concat:

ffmpeg -hide_banner -nostdin \
  -i VTS_02_1.VOB -i VTS_02_2.VOB -i VTS_02_3.VOB -i VTS_02_4.VOB \
  -filter_complex "\
    [0:v:0][1:v:0][2:v:0][3:v:0] concat=n=4:v=1:a=0 [vcat]; \
    [0:a:1]aformat=sample_fmts=fltp:channel_layouts=5.1|stereo,aresample=48000[a0]; \
    [1:a:0]aformat=sample_fmts=fltp:channel_layouts=5.1|stereo,aresample=48000[a1]; \
    [2:a:0]aformat=sample_fmts=fltp:channel_layouts=5.1|stereo,aresample=48000[a2]; \
    [3:a:0]aformat=sample_fmts=fltp:channel_layouts=5.1|stereo,aresample=48000[a3]; \
    [a0][a1][a2][a3] concat=n=4:v=0:a=1 [acat]; \
    [vcat]bwdif=mode=send_frame:parity=auto:deint=all,scale=-2:720:flags=lanczos,fps=25 [v]" \
  -map "[v]" -map "[acat]" \
  -c:v libx264 -preset slow -tune film -profile:v high -level 4.1 -pix_fmt yuv420p -crf 22 \
  -c:a aac -b:a 160k -ac 2 -ar 48000 \
  ytsish_pal25_720p_h264.mkv

That forces a common sample format/rate before the concat, then your -ac 2 downmix happens on the encoded output.