I have few MKV files ripped from Blu-Ray using MakeMKV, I'm trying to strip them from the MKV container to basic h.264, I'm trying to work on them in a program that doesn't take MKV files. What's the easiest script in ffmpeg that can do it without altering the file integrity?
Here is the Mediainfo:
Code:General Format : Matroska Format version : Version 2 File size : 1.68 GiB Duration : 6 min 58 s Overall bit rate mode : Variable Overall bit rate : 34.4 Mb/s Frame rate : 23.976 FPS Writing application : MakeMKV 1.18.2 win(x64-release) Writing library : libmakemkv 1.18.2 (1.3.10/1.5.2) win(x64-release) Video ID : 1 ID in the original source medium : 4113 (0x1011) Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames Format settings, Slice count : 4 slices per frame Codec ID : V_MPEG4/ISO/AVC Duration : 6 min 58 s Bit rate mode : Variable Bit rate : 30.9 Mb/s Maximum bit rate : 39.0 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.621 Time code of first frame : 00:59:59:00 Stream size : 1.50 GiB (90%) Language : English Default : No Forced : No Original source medium : Blu-ray Audio #1 ID : 2 ID in the original source medium : 4352 (0x1100) Format : DTS XLL Format/Info : Digital Theater Systems Commercial name : DTS-HD Master Audio Codec ID : A_DTS Duration : 6 min 58 s Bit rate mode : Variable Bit rate : 1 989 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 93.750 FPS (512 SPF) Bit depth : 24 bits Compression mode : Lossless Stream size : 99.2 MiB (6%) Title : Stereo Language : English Default : Yes Forced : No Original source medium : Blu-ray Audio #2 ID : 3 ID in the original source medium : 4352 (0x1100) Format : DTS Format/Info : Digital Theater Systems Codec ID : A_DTS Duration : 6 min 58 s Bit rate mode : Constant Bit rate : 1 509 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 93.750 FPS (512 SPF) Bit depth : 24 bits Compression mode : Lossy Stream size : 75.3 MiB (4%) Title : Stereo Language : English Default : No Forced : No Original source medium : Blu-ray Text ID : 4 ID in the original source medium : 4608 (0x1200) Format : PGS Codec ID : S_HDMV/PGS Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs Duration : 6 min 48 s Bit rate : 15.5 kb/s Frame rate : 0.269 FPS Count of elements : 110 Stream size : 771 KiB (0%) Language : English Default : No Forced : No Original source medium : Blu-ray
+ Reply to Thread
Results 1 to 21 of 21
-
-
Try :
clever-FFmpeg-GUI [Extract streams -> Raw Stream]
or .. for many files .. a PowerShell/FFmpeg script that will extract the h.264 video streams from files:
- Script will process all MKV files in the current directoryGet-ChildItem *.mkv | ForEach-Object {
ffmpeg -i "$($_.FullName)" -c:v copy -an "$($_.BaseName)_converted.mp4"
}
- Each file gets a `_converted` suffix to avoid overwriting originals
- The conversion is essentially a container change [not a re-encode]. The output is an `.mp4` container.
- Make sure FFmpeg.exe is in your system pathLast edited by videoAI; 22nd Dec 2025 at 15:01.
-
This program can extract elementary streams
https://www.videohelp.com/software/MKVcleaver -
I would prefer a script, But I will give those a try, if encoding less than or equal to real time that means it's doing something wrong.
-
MKVcleaver is reporting this message: Mkvextrac.ex and/or Mkvmerge.exe was not found.
-
Clever-ffmpeg is no no for me, it either extracts the streams individually or encode as a whole package which is not lossless and takes time.
-
-
Getting error while trying to install mkvtoolnix.
Edit: Run as admin I was able to install it.Last edited by dellsam34; 22nd Dec 2025 at 15:15.
-
-
MKVCleaver is no no too, It just extracts all streams to separate files, that's not what I want. I want a single file like the original m2ts on the disc.
-
Something like this?
Code:ffmpeg.exe -i "your_.mkv" -map 0 -c copy -bsf:v h264_mp4toannexb -f out.ts "new_.ts"
-
You said at the top post
"I'm trying to strip them from the MKV container to basic h.264"
that's what this program does. It gives you the elementary stream, *.h264
MKV is used because if accepts almost all variations of audio and video formats/codecs.
You could try remuxing to mp4 in Avidemux, but I'm not sure whether the DTS audio is supported.
Open the source in Avidemux, leave audio and video set to "copy" on the left, and set the output format
(lower left) to mp4 muxer
Or for remuxing to a *.ts or *.m2ts, you can try TSMuxer GUI -
Something wrong with that script.
-
-
When I try to open the file in TSmuxeR GUI it says TSmuxeR not found, The same error when I drag and drop the file into the program input field.
-
-
I think I may have tried that already and it didn't work, found in a google search, let me double check.
Edit:
It looks like it worked with a yellow message, But all the streams are there in one file:
Thank you.Code:[mpegts @ 000001c1b1e44b40] Stream 3, codec hdmv_pgs_subtitle, is muxed as a private data stream and may not be recognized upon reading.
Last edited by dellsam34; 22nd Dec 2025 at 16:10.
-
Good. For more details see here:
https://trac.ffmpeg.org/wiki/Map -
Download the the missing exe from here:
https://github.com/justdan96/tsMuxer/releases/download/2.7.0/tsMuxer-2.7.0-win64.zip
extract the file and put it in the same folder as the GUI component -
First I suggest you strip out you subtitles from your.mkv.
They are not going to work anyway because ffmpeg can not convert hdmv_pgs_subtitles.
At least not to a output.ts file.
Then the new "out.mkv" without subtitles will be the "input.mkv" in the code below.Code:ffmpeg -i "input.mkv" -c:v copy -c:a copy -sn -avoid_negative_ts make_zero "out.mkv"
Code:ffmpeg -i "input.mkv" -c:v copy -c:a copy "out.ts"
Last edited by cholla; 23rd Dec 2025 at 13:02. Reason: simplified code
Similar Threads
-
How do I extract an MPEG2 file out of a MKV container?
By guy24s in forum Video ConversionReplies: 12Last Post: 29th Jun 2024, 08:12 -
Any way to save time when changing track name in a MKV container?
By ElegantRain in forum Video ConversionReplies: 3Last Post: 9th May 2023, 13:06 -
Hardcoding subtitles ALREADY in an mkv container with XMedia Recode
By Cherry Picker in forum SubtitleReplies: 2Last Post: 28th Dec 2021, 11:18 -
What audio container works well with .mp4/.mkv containers? FLAC or AAC?
By Guernsey in forum Newbie / General discussionsReplies: 1Last Post: 2nd Dec 2021, 01:18 -
MKV Batch Metadata Removal Tool - JMkvPropedit??
By BJ12 in forum Newbie / General discussionsReplies: 18Last Post: 13th Apr 2021, 20:18


Quote
