VideoHelp Forum




+ Reply to Thread
Results 1 to 21 of 21
  1. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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
    Quote Quote  
  2. 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:

    Get-ChildItem *.mkv | ForEach-Object {
    ffmpeg -i "$($_.FullName)" -c:v copy -an "$($_.BaseName)_converted.mp4"
    }
    - Script will process all MKV files in the current directory
    - 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 path
    Last edited by videoAI; 22nd Dec 2025 at 15:01.
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    This program can extract elementary streams
    https://www.videohelp.com/software/MKVcleaver
    Quote Quote  
  4. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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.
    Quote Quote  
  5. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    MKVcleaver is reporting this message: Mkvextrac.ex and/or Mkvmerge.exe was not found.
    Quote Quote  
  6. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    You have to point the program to your mkvtoolnix location
    Image Attached Thumbnails Click image for larger version

Name:	loc_mkvt.png
Views:	14
Size:	181.5 KB
ID:	90401  

    Quote Quote  
  7. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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.
    Quote Quote  
  8. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    Originally Posted by davexnet View Post
    You have to point the program to your mkvtoolnix location
    I see, I have to download this toolkit then.
    Quote Quote  
  9. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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.
    Quote Quote  
  10. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by dellsam34 View Post
    Getting error while trying to install mkvtoolnix.

    Edit: Run as admin I was able to install it.
    That's good but it shouldn't be necessary, however, I used the portable version (as you can probably tell from my path name)
    Quote Quote  
  11. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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.
    Quote Quote  
  12. Something like this?
    Code:
    ffmpeg.exe -i "your_.mkv" -map 0 -c copy -bsf:v h264_mp4toannexb -f out.ts "new_.ts"
    Quote Quote  
  13. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    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
    Quote Quote  
  14. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    Something wrong with that script.
    Quote Quote  
  15. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    Originally Posted by davexnet View Post
    You said at the top post
    "I'm trying to strip them from the MKV container to basic h.264"
    Yes but I want one file with audio, not muted video and a separate audio file.
    Quote Quote  
  16. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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.
    Quote Quote  
  17. Originally Posted by dellsam34 View Post
    Something wrong with that script.
    Sorry, try
    Code:
    ffmpeg -i "your.mkv" -map 0 -c copy "out.ts"
    Quote Quote  
  18. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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:

    Code:
    [mpegts @ 000001c1b1e44b40] Stream 3, codec hdmv_pgs_subtitle, is muxed as a private data stream and may not be recognized upon reading.
    Thank you.
    Last edited by dellsam34; 22nd Dec 2025 at 16:10.
    Quote Quote  
  19. Originally Posted by dellsam34 View Post
    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:

    Code:
    [mpegts @ 000001c1b1e44b40] Stream 3, codec hdmv_pgs_subtitle, is muxed as a private data stream and may not be recognized upon reading.
    Thank you.
    Good. For more details see here:
    https://trac.ffmpeg.org/wiki/Map
    Quote Quote  
  20. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by dellsam34 View Post
    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.
    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
    Quote Quote  
  21. 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.

    Code:
    ffmpeg -i "input.mkv" -c:v copy -c:a copy -sn -avoid_negative_ts make_zero "out.mkv"
    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 "out.ts"
    Last edited by cholla; 23rd Dec 2025 at 13:02. Reason: simplified code
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!