Skip to content

Instantly share code, notes, and snippets.

@JonathanTurnock
Last active March 7, 2021 12:58
Show Gist options
  • Save JonathanTurnock/6c1e96767351e3dcfcd7aa1f552b7af3 to your computer and use it in GitHub Desktop.
Save JonathanTurnock/6c1e96767351e3dcfcd7aa1f552b7af3 to your computer and use it in GitHub Desktop.
VLC media player Convert & Save DVD Chapters

Intro

How to use VLC media player to export a DVD in a file per chapter format

The command for reference is:

vlc dvdsimple:///G:/#1:1-1:1 --sout "#standard{access=file,mux=ts,dst=T1_CH1.mpg} vlc://quit"

The important part is the addition of a "to" section that the GUI does not allow.

Update the range as necessary, for example to export chapter 1, 2 and 3 the range values would be 1,4 (The last is not included)

Note

As it stands it requires the vlc exe to be available on the path

References

https://wiki.videolan.org/VLC_HowTo/Rip_a_DVD/

"""
Exports Chapters from DVD using VLC Media Player
ENSURE VLC is on the PATH
"""
import os
vlc_exe = "vlc"
dvd_drive = "G"
title = 1
if __name__ == '__main__':
for chapter in range(1, 1):
ch_id = f"{title}:{chapter}"
out_f_name = f"T{title}_CH{chapter}.mpg"
os.system(" ".join([
"vlc",
f'dvdsimple:///{dvd_drive}:/#{ch_id}-{ch_id}',
f'--sout "#standard{{access=file,mux=ts,dst={out_f_name}}}"',
'vlc://quit'])
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment