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.
printf "file '%s'\n" VTS_02_1.VOB VTS_02_2.VOB VTS_02_3.VOB VTS_02_4.VOB > vobs.txtCheck interlace/telecine and audio layout:
ffprobe -hide_banner -i concat:vobs.txtIf 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.
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.
YTS style typically means:
slow (or slower
if you’re patient).film.Use
yadif=mode=send_frame:parity=tff:deint=interlaced, fieldmatch, decimate
(safe combo) or pullup,decimate. Here’s a solid, safe
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 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.mkvcrop=iw:ih with your crop=... from
step 2 if you want to remove bars.scale=-2:1080 and
set -crf 20–21.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-crf 22 is a
decent start.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.mkvbwdif
only; don’t decimate.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.mkvCRF is usually nicer and closer to how YTS encodes today; 2-pass is just for tight size targets.
mkvmerge. From raw
VOBs alone, you likely don’t have a chapter file.-map 0:s? -c:s copy keeps VobSub
(image-based) as soft subs in MKV. If you want text, OCR with
VSRip + SubRip or
ffmpeg→vobsub→tesseract pipeline,
then mux the SRT.-crf 21–22 (720p), 20–21 (1080p),
-preset slow, -tune film,
-profile high -level 4.1.-crf 23 (720p), 22 (1080p),
-preset slow, -tune film,
-x265-params profile=main.-c:a aac -b:a 128k–160k -ac 2..mkv.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:
0:v:0 = first video track0:a:1 = second audio track (ffmpeg counts from zero, so
“track 2” = a:1)0:s? = all subs, optionalThen 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.mkvIf 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.mkvNotes:
-map 0:a:1 selects audio track 2
(ffmpeg is zero-indexed). No other audio tracks are kept.yadif line safely deinterlaces only if the
frames are flagged interlaced; progressive frames pass through
cleanly.-vf
with e.g.-vf "yadif=mode=send_frame:parity=auto:deint=interlaced,crop=704:368:8:56,scale=-2:720:flags=lanczos,fps=25".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 23This 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.mkvNotes:
[0:a:1] = track 2 from the first file;
[1:a:0][2:a:0][3:a:0] = track 1 from files
2–4.[vcat], audio into
[acat], then filter the video once (deinterlace safeguard →
scale → keep 25 fps).crop=… just before scale, e.g.... [vcat]bwdif=...,crop=704:368:8:56,scale=-2:720:flags=lanczos,fps=25 [v]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 23If 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.mkvThat forces a common sample format/rate before the concat, then your
-ac 2 downmix happens on the encoded output.