View Full Version : Demux with FFMPEG from mpls
tormento
10th July 2020, 10:26
It's 3 hours I am reading documentation and I can't sort it out.
Is there a way to blindly demux a BD video from a mpls to it's elementary streams with FFMPEG, respecting original format?
Selur
11th July 2020, 16:56
What do you mean exactly?
ffmpeg will not automatically add the file extension filenames etc. when demuxing.
You have to specify the filename etc. for each stream:
ffmpeg -y -threads 8 -analyzeduration 200M -probesize 200M -i "bluray:<PATH TO BLU-RAY FOLDER WHICH CONTAINS THE BDMV-FOLDER >" -sn -vcodec copy "E:\Temp\2020-07-11@17_50_25_2710_17.vc1" -map 0:40 -y -acodec copy "E:\Output\iId_9_aid_6656_lang_en_2020-07-11@17_50_25_2710_15.dts" -map 0:7 -y -acodec copy "E:\Output\iId_8_aid_4358_lang_en_2020-07-11@17_50_25_2710_13.ac3" -map 0:6 -y -acodec copy "E:\Output\iId_7_aid_4357_lang_es_2020-07-11@17_50_25_2710_11.dts" -map 0:5 -y -acodec copy "E:\Output\iId_6_aid_4356_lang_de_2020-07-11@17_50_25_2710_09.dts" -map 0:4 -y -acodec copy "E:\Output\iId_5_aid_4355_lang_it_2020-07-11@17_50_25_2710_07.dts" -map 0:3 -y -acodec copy "E:\Output\iId_4_aid_4354_lang_fr_2020-07-11@17_50_25_2710_05.dts" -map 0:2 -y -acodec copy "E:\Output\iId_3_aid_4353_lang_en_2020-07-11@17_50_25_2710_03.dts" -map 0:1 -y -acodec copy "E:\Output\iId_2_aid_4352_lang_ja_2020-07-11@17_50_25_2710_01.dts"
Cu Selur
stax76
11th July 2020, 17:13
@Selur
Do you use ffmpeg Bluray demuxing in Hybrid or know GUIs which do it?
In case you use it, how do you options info on the Bluray titles and streams?
Are there known issues?
Selur
11th July 2020, 20:15
Yes, Hybrid use FFmpeg (or tsMuxeR; depending on the settings) to extract streams from Blu-Rays.
In case you use it, how do you options info on the Bluray titles and streams?
What?
If you are asking how I collect data about the Blu-ray, I usually use:
"I:\Hybrid\64bit\ffmpeg.exe" -analyzeduration 200M -probesize 200M -i "bluray:PATH TO THE BLU-RAY-FOLDER"
which throws out a list of usable mpls files:
[bluray @ 00000262bf9f9100] 14 usable playlists:
[bluray @ 00000262bf9f9100] playlist 00000.mpls (1:28:21)
[bluray @ 00000262bf9f9100] playlist 00002.mpls (0:16:20)
[bluray @ 00000262bf9f9100] playlist 00003.mpls (0:03:11)
[bluray @ 00000262bf9f9100] playlist 00004.mpls (0:03:01)
[bluray @ 00000262bf9f9100] playlist 00005.mpls (0:15:20)
[bluray @ 00000262bf9f9100] playlist 00006.mpls (0:17:15)
[bluray @ 00000262bf9f9100] playlist 00007.mpls (0:15:31)
[bluray @ 00000262bf9f9100] playlist 00008.mpls (0:08:01)
[bluray @ 00000262bf9f9100] playlist 00009.mpls (0:09:13)
[bluray @ 00000262bf9f9100] playlist 00010.mpls (0:22:14)
[bluray @ 00000262bf9f9100] playlist 00011.mpls (0:21:10)
[bluray @ 00000262bf9f9100] playlist 00012.mpls (0:06:34)
[bluray @ 00000262bf9f9100] playlist 00021.mpls (0:07:34)
[bluray @ 00000262bf9f9100] playlist 00022.mpls (2:09:19)
[bluray @ 00000262bf9f9100] selected 00022.mpls
which usually is reliable. (some users reported problems with this when using some strange asian rips of Blu-rays which is why Hybrid also uses MediaInfo and tsMuxeR for the analysis)
I then usually do a quick analysis using:
"I:\Hybrid\64bit\ffmpeg.exe" -analyzeduration 200M -probesize 200M -analyzeduration 200M -probesize 200M -i "bluray:PATH TO THE BLU-RAY-FOLDER" -playlist PLAYLIST_NUMBER -angle 0
for all the usable playlists and let the user decide which playlist(s) he wants as input. After the user choose the playlists each playlist is analysed by FFmpeg, MediaInfo, tsMuxeR, mplayer to get as much details about the stream so it's later possible to use FFmpeg/tsMuxeR/MPlayer for the stream extraction.
Main downside with FFmpeg an Blu-rays is that it uses libbluray which, at least in the past frequently had broken builds, so updating libbluray was always a gamble (it has gotten better) and sometimes tsMuxeR is better suited for the stream extraction. By default Hybrid uses FFmpeg for the demuxing, but tsMuxeR is there as fallback in case the extraction with FFmpeg fails. Since I haven't detected a pattern which Blu-rays do not work with FFmpeg, but work with tsMuxeR this is a user choice.
Cu Selur
Richard1485
12th July 2020, 12:08
You have to specify the filename etc. for each stream:
ffmpeg -y -threads 8 -analyzeduration 200M -probesize 200M -i "bluray:<PATH TO BLU-RAY FOLDER WHICH CONTAINS THE BDMV-FOLDER >" -sn -vcodec copy "E:\Temp\2020-07-11@17_50_25_2710_17.vc1" -map 0:40 -y -acodec copy "E:\Output\iId_9_aid_6656_lang_en_2020-07-11@17_50_25_2710_15.dts" -map 0:7 -y -acodec copy "E:\Output\iId_8_aid_4358_lang_en_2020-07-11@17_50_25_2710_13.ac3" -map 0:6 -y -acodec copy "E:\Output\iId_7_aid_4357_lang_es_2020-07-11@17_50_25_2710_11.dts" -map 0:5 -y -acodec copy "E:\Output\iId_6_aid_4356_lang_de_2020-07-11@17_50_25_2710_09.dts" -map 0:4 -y -acodec copy "E:\Output\iId_5_aid_4355_lang_it_2020-07-11@17_50_25_2710_07.dts" -map 0:3 -y -acodec copy "E:\Output\iId_4_aid_4354_lang_fr_2020-07-11@17_50_25_2710_05.dts" -map 0:2 -y -acodec copy "E:\Output\iId_3_aid_4353_lang_en_2020-07-11@17_50_25_2710_03.dts" -map 0:1 -y -acodec copy "E:\Output\iId_2_aid_4352_lang_ja_2020-07-11@17_50_25_2710_01.dts"
This is a perfect example of why I appreciate ffmpeg's capabilities but prefer eac3to for certain tasks. If only there were a way to simplify the former's syntax...
Thanks for your posts on this topic, Selur! They are most informative. I've wanted to know how to do this with ffmpeg for quite a while.
Richard1485
13th July 2020, 13:38
Can ffmpeg handle seamless branching?
Selur
13th July 2020, 16:13
afaik there's no support for seamless branching in ffmpeg
Richard1485
13th July 2020, 16:33
Thanks for the reply! When I try the procedure outlined above, I receive an error message:
disc.c:323: failed opening UDF image mnt/directory/
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[bluray @ 0x5634cbe70680] bd_open() failed
bluray:mnt/directory/: Input/output error
I'm running Debian 10. (Initially, I ran into trouble because the static builds for Linux do not list "bluray" under "Supported file protocols", but I tried the version of ffmpeg in the repos, which does have the protocol, and ran into the above error.) I've googled the error but drawn a blank. Do you any ideas?
Selur
13th July 2020, 19:27
1. I assume you are not mounting an original blu-ray with copy protection (ffmpeg won't circumvent any copy protection)
2. make sure you ffmpeg version is build with libblury
3. you can try the version which comes with Hybrid (it's compile with the basic stuff usually used)
Cu Selur
Richard1485
13th July 2020, 20:20
1. I assume you are not mounting an original blu-ray with copy protection (ffmpeg won't circumvent any copy protection)
2. make sure you ffmpeg version is build with libblury
3. you can try the version which comes with Hybrid (it's compile with the basic stuff usually used)
1. The disc has already been decrypted and ripped to the drive. The reference to /mnt is simply because I have multiple drives. Moreover, I've tried multiple discs, including one of my own authoring that has never seen copy protection.
2. Yes. I checked that: --enable-libbluray is present, and I have libbluray installed.
3. I might try Hybrid at some point, but I don't understand why it's not working simply with ffmpeg. I've even tried the latest stable (static) Windows build under Wine, and the same message appears.
Selur
14th July 2020, 18:50
My point was not that you try Hybrid, but that you try with the ffmpeg build that comes with the version which comes with the base tools. :)
Might be a problem with libbluray.
What does you command line look like exactly?
Cu Selur
Richard1485
14th July 2020, 21:54
My point was not that you try Hybrid, but that you try with the ffmpeg build that comes with the version which comes with the base tools. :)
Yes, I understood that. But I'd still want to know why it won't work with the version in the repos. (I already know why it won't work with the static binaries for Linux.) And I've just tried the build in Hybrid, and the same message occurs.
What does you command line look like exactly?
ffmpeg -y -analyzeduration 200M -probesize 200M -i bluray:mnt/xdev/my_directory/
Enclosing the filepath in inverted commas makes no difference.
Richard1485
16th July 2020, 20:18
Okay. I found the error. There should have been a backslash immediately after the colon. This works:
ffmpeg -analyzeduration 200M -probesize 200M -i bluray:/mnt/xdev/my_directory/
However, when I select a playlist, I receive an error message:
Trailing options were found on the commandline.
Here's the command line:
ffmpeg -i bluray:/mnt/xdev/my_directory/ -playlist 00132.mpls
Obviously, something needs to be escaped. I've tried -playlist 00132 (without the extension) as well.
EDIT: I've figured it out. The example given earlier in the thread was wrong. The -playlist parameter has to go before the input. The .mpls extension is not needed. This works:
ffmpeg -playlist 00132 -i bluray:/mnt/xdev/my_directory/
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.