.ts files recorded with TVTest, EDCB, or a PT3 card — and .m2ts files pulled from Blu-ray discs — are awkward formats to work with in editing software or on phones. With FFmpeg you can convert them to MP4 losslessly (no re-encoding) in seconds. This guide covers CM (commercial) cutting, subtitle handling, and how to recover recordings with dropped packets. Estimated time: 10 minutes.

Tested with: FFmpeg 6.1 / Windows 11 (64-bit official build)

Prerequisite: This article assumes the recordings are for personal viewing only. Redistributing or re-uploading broadcast content is restricted under Japanese copyright and broadcasting laws.


What You’ll Learn

  1. The differences between TS / m2ts / BDAV
  2. The fastest lossless remux (-c copy)
  3. How to resolve aac_adtstoasc errors
  4. PCR wraparound (why files cut off at the 1-hour mark) and fixes
  5. Extracting specific segments to cut out CMs
  6. Handling ARIB subtitles (keep or drop)
  7. Repairing recordings with dropped packets
  8. FAQ

1. TS / m2ts / BDAV at a Glance

FormatMain useCharacteristics
.ts (MPEG-TS)Japanese terrestrial TV, streamingH.264+AAC (Japanese terrestrial TV uses H.264 + AAC-LC or HE-AAC); 188-byte packets
.m2tsBlu-ray / BDAVH.264 or HEVC; AC-3 or DTS-HD
.mtsAVCHD camcordersEssentially the same as .m2ts; AVCHD specification

All three carry streams that are compatible with MP4 (H.264/HEVC + AAC/AC-3), so swapping only the container to MP4 (remuxing) is the most efficient approach.


2. The Fastest Lossless Remux

This is the whole command.

ffmpeg -i input.ts -c copy -bsf:a aac_adtstoasc -movflags +faststart output.mp4
  • -c copy … no re-encoding; completes in seconds
  • -bsf:a aac_adtstoasc … converts AAC ADTS headers to ASC (required for MP4)
  • -movflags +faststart … moves moov atom to the front (essential for Web and mobile playback)

Why is aac_adtstoasc needed?
AAC audio in TS has an ADTS (Audio Data Transport Stream) header on every frame, but MP4 stores the ASC (AudioSpecificConfig) once inside the container. Without this conversion, you’ll hit a “Malformed AAC bitstream detected” error and the output will be broken.

Drop subtitles for a simpler output

Japanese terrestrial TV often embeds ARIB subtitles, which are not MP4-compatible. Output only video and audio:

ffmpeg -i input.ts -map 0:v -map 0:a -c copy -bsf:a aac_adtstoasc -movflags +faststart output.mp4

3. The PCR Wraparound Problem (1-Hour Cutoff)

Symptom

When remuxing long TS files (sports broadcasts, drama marathons), the output cuts off around the 1-hour mark.

Cause

TS stores the PCR (Program Clock Reference) as a 33-bit timestamp. The maximum is about 26.5 hours, but FFmpeg’s default behavior may stop processing when it detects a discontinuity. 32-bit FFmpeg builds have additional limitations that make long recordings unstable.

Fixes

Fix 1: Use a 64-bit official build

On Windows, use the 64-bit ffmpeg-full build from gyan.dev. Avoid 32-bit builds entirely.

Fix 2: Allow timestamp discontinuities

ffmpeg -fflags +genpts -i input.ts -c copy -bsf:a aac_adtstoasc -movflags +faststart output.mp4
  • -fflags +genpts … regenerate input PTS (presentation timestamps)

Fix 3: Split very long TS files before processing

# Split into 1-hour chunks
ffmpeg -i input.ts -c copy -map 0 -f segment -segment_time 3600 -reset_timestamps 1 part_%03d.ts

Convert each chunk to MP4 and concat them afterwards.


4. Cutting Out CMs (Multiple Segments)

The typical workflow when you want to extract only the main content from a TS recording.

Step 1: Note the start and end times

Play the file and write down where the main content starts and ends (e.g., main content runs from 00:01:30 to 00:25:00 and from 00:28:00 to 00:52:30).

Step 2: Extract each segment (no re-encoding)

# Part 1 (1:30 to 25:00)
ffmpeg -ss 00:01:30 -to 00:25:00 -i input.ts -c copy -bsf:a aac_adtstoasc part1.ts

# Part 2 (28:00 to 52:30)
ffmpeg -ss 00:28:00 -to 00:52:30 -i input.ts -c copy -bsf:a aac_adtstoasc part2.ts

Step 3: Concat the two parts into MP4

# Build concat.txt
echo "file 'part1.ts'" > concat.txt
echo "file 'part2.ts'" >> concat.txt

# Concatenate
ffmpeg -f concat -safe 0 -i concat.txt -c copy -bsf:a aac_adtstoasc -movflags +faststart main.mp4

For keyframe-accurate cuts you need to align -ss to a keyframe beforehand. See the complete guide to trimming videos for details.


5. Handling ARIB Subtitles

Subtitles in Japanese terrestrial TV (closed captions) are in ARIB STD-B24 format. FFmpeg can preserve them, but most MP4 players can’t display them. You have two options:

ffmpeg -i input.ts -map 0:v -map 0:a -c copy -bsf:a aac_adtstoasc -movflags +faststart output.mp4

-map 0:v -map 0:a selects only video and audio streams. Subtitle streams are excluded from the output.

Option B: Extract subtitles and convert to SRT

Converting ARIB to SRT is difficult with FFmpeg alone. Use a dedicated tool like Caption2Ass_PCR or TSSplitter to produce SRT/ASS first, then burn in with FFmpeg:

# Burn in subtitles from subtitle.srt (prepare it in advance)
ffmpeg -i input.ts -vf "subtitles=subtitle.srt:force_style='FontName=Meiryo,FontSize=20'" \
  -c:a copy -bsf:a aac_adtstoasc -movflags +faststart output_subbed.mp4

See the complete guide to burning subtitles into video (hardcode) for more detail.


6. Repairing Recordings with Dropped Packets

Recordings made under poor reception conditions can have dropped TS packets, which cause errors during remuxing.

Recovery command

ffmpeg -err_detect ignore_err -i input.ts -c copy -bsf:a aac_adtstoasc \
  -fflags +genpts -movflags +faststart output.mp4
  • -err_detect ignore_err … ignore packet errors and keep going
  • -fflags +genpts … regenerate lost timestamps

You may see a 1–2 second stutter on playback, but otherwise-broken files become watchable.


7. Extracting from BDAV (Blu-ray)

Converting directly from BDAV discs (BDMV/STREAM/00001.m2ts, etc.):

ffmpeg -i BDMV/STREAM/00001.m2ts -c:v copy -c:a copy -map 0:v:0 -map 0:a:0 \
  -movflags +faststart output.mp4

AACS-encrypted Blu-rays cannot be processed by FFmpeg unless decrypted first. See AACS Error. Even for personal copies, circumventing technical protection measures is illegal in Japan under Article 30(1)(ii) of the Copyright Act.


8. Batch Processing (Convert Multiple TS Files at Once)

Windows batch file (save as ts_to_mp4.bat and drag-and-drop TS files onto it):

@echo off
setlocal enabledelayedexpansion
if "%~1"=="" (
  echo Usage: drag TS files onto this .bat file
  pause & exit /b 1
)
:loop
if "%~1"=="" goto end
echo Converting: %~nx1
ffmpeg -fflags +genpts -i "%~1" -c copy -bsf:a aac_adtstoasc -movflags +faststart "%~dpn1.mp4"
shift
goto loop
:end
echo All done!
pause

Bash version:

for f in *.ts; do
  ffmpeg -fflags +genpts -i "$f" -c copy -bsf:a aac_adtstoasc -movflags +faststart "${f%.ts}.mp4"
done

9. Troubleshooting

Error 1: Malformed AAC bitstream detected

Cause: You forgot -bsf:a aac_adtstoasc.
Fix: Add the option.

Error 2: File converts but won’t play on a phone

Cause: Japanese terrestrial TV uses unusual aspect ratios such as 1440×1080 with SD display aspect ratio, which phones sometimes misinterpret.
Fix: Rescale explicitly to 1920×1080 with -vf "scale=1920:1080:flags=lanczos" (note: this requires re-encoding).

Error 3: Two audio tracks (second audio / bilingual)

Cause: Japanese terrestrial TV’s bilingual broadcasts or stereo+mono recordings carry multiple audio streams.
Fix:

# Main audio only
ffmpeg -i input.ts -map 0:v:0 -map 0:a:0 -c copy -bsf:a aac_adtstoasc output.mp4

# Keep both tracks (Windows Media Player can switch between them)
ffmpeg -i input.ts -map 0 -c copy -bsf:a aac_adtstoasc output.mp4

Error 4: Chapters disappear

Cause: TS chapter information uses a different format from MP4.
Fix: Add -map_chapters 0. Note that TS-to-MP4 chapter migration is rarely complete; you’ll often need to rewrite them manually.

Error 5: BS4K (ISDB-S3, 4K broadcasts) won’t convert

Cause: BS4K uses HEVC + MPEG-H 3D Audio (MPEG-4 AAC), which some MP4 players can’t handle.
Fix: Re-encode audio to AAC-LC:

ffmpeg -i bs4k.ts -c:v copy -c:a aac -b:a 192k -ac 2 -movflags +faststart output.mp4

FAQ

Q1. Should I split TS files with TsSplitter before feeding them to FFmpeg?
A. That used to be necessary, but modern FFmpeg (6.x and later) handles Japanese terrestrial TS directly, so FFmpeg alone is enough in almost all cases. Only heavily drop-ridden recordings may benefit from pre-repair with TsSplitter.

Q2. BonDriver+TVTest recordings have the .ts extension — why not .m2ts?
A. Japanese terrestrial TV is stored as MPEG-TS with 188-byte packets, and .ts is the conventional extension. BDAV uses .m2ts (192-byte packets) — the same TS with an added timestamp prefix. Both are handled the same way by FFmpeg.

Q3. Does remuxing reduce picture quality?
A. No. -c copy copies the bitstream unchanged — not a single bit is altered.

Q4. Some players won’t play my converted file
A. Check for -movflags +faststart and, for HEVC recordings, -tag:v hvc1. If the file still won’t play, re-encode to H.264:

ffmpeg -i input.ts -c:v libx264 -crf 20 -c:a aac -b:a 192k -bsf:a aac_adtstoasc -movflags +faststart output.mp4

Q5. Why is Japanese TV recording so complicated?
A. Japanese terrestrial TS preserves the broadcaster’s multiplex specification (ARIB STD-B10/B32) faithfully — it’s a massive stream that includes subtitles, data broadcasts, EPG/EIT information, and even emergency alerts (EAS). MP4 is “just a file,” so FFmpeg’s job is to throw out everything else and extract just the main program.



Tested with ffmpeg 6.1.1 / Windows 11 (64-bit) + Ubuntu 24.04
Primary sources: ffmpeg.org/ffmpeg.html / ffmpeg.org/ffmpeg-formats.html