Anyway, you might find it easier to use the '--json' option of HandBrakeCLI. It outputs the title information in json format. stdout looks like this:
Code: Select all
Version: {
"Arch": "x86_64",
"Name": "HandBrake",
"Official": true,
"RepoDate": "2019-02-21 16:19:39",
"RepoHash": "c6cde0de9f3f6b1d50b5dc736cbb3fb30d4ffdb8",
"System": "Linux",
"Type": "developer",
"Version": {
"Major": 0,
"Minor": 0,
"Point": 0
},
"VersionString": "20190221161939-c6cde0d-master"
}
Progress: {
"Scanning": {
"Preview": 10,
"PreviewCount": 10,
"Progress": 1.0,
"Title": 2,
"TitleCount": 2
},
"State": "SCANNING"
}
JSON Title Set: {
"MainFeature": 1,
"TitleList": [
{
"AngleCount": 1,
"AudioList": [
{
"Attributes": {
"AltCommentary": false,
"Commentary": false,
"Default": false,
"Normal": true,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 192000,
"ChannelCount": 2,
"ChannelLayout": 3,
"ChannelLayoutName": "stereo",
"Codec": 2048,
"CodecName": "ac3",
"Description": "English (AC3) (2.0 ch) (192 kbps)",
"LFECount": 0,
"Language": "English",
"LanguageCode": "eng",
"SampleRate": 48000
},
{
"Attributes": {
"AltCommentary": false,
"Commentary": false,
"Default": false,
"Normal": true,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 448000,
"ChannelCount": 6,
"ChannelLayout": 1551,
"ChannelLayoutName": "5.1(side)",
"Codec": 2048,
"CodecName": "ac3",
"Description": "English (AC3) (5.1 ch) (448 kbps)",
"LFECount": 1,
"Language": "English",
"LanguageCode": "eng",
"SampleRate": 48000
},
{
"Attributes": {
"AltCommentary": false,
"Commentary": false,
"Default": false,
"Normal": true,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 192000,
"ChannelCount": 2,
"ChannelLayout": 1610612736,
"ChannelLayoutName": "downmix",
"Codec": 2048,
"CodecName": "ac3",
"Description": "Francais (AC3) (2.0 ch) (Dolby Surround) (192 kbps)",
"LFECount": 0,
"Language": "Francais",
"LanguageCode": "fra",
"SampleRate": 48000
},
{
"Attributes": {
"AltCommentary": false,
"Commentary": true,
"Default": false,
"Normal": false,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 128000,
"ChannelCount": 2,
"ChannelLayout": 3,
"ChannelLayoutName": "stereo",
"Codec": 2048,
"CodecName": "ac3",
"Description": "English (AC3) (Director's Commentary 1) (2.0 ch) (128 kbps)",
"LFECount": 0,
"Language": "English",
"LanguageCode": "eng",
"SampleRate": 48000
},
{
"Attributes": {
"AltCommentary": false,
"Commentary": false,
"Default": false,
"Normal": true,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 128000,
"ChannelCount": 2,
"ChannelLayout": 3,
"ChannelLayoutName": "stereo",
"Codec": 2048,
"CodecName": "ac3",
"Description": "English (AC3) (2.0 ch) (128 kbps)",
"LFECount": 0,
"Language": "English",
"LanguageCode": "eng",
"SampleRate": 48000
},
{
"Attributes": {
"AltCommentary": false,
"Commentary": false,
"Default": false,
"Normal": true,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 128000,
"ChannelCount": 2,
"ChannelLayout": 3,
"ChannelLayoutName": "stereo",
"Codec": 2048,
"CodecName": "ac3",
"Description": "English (AC3) (2.0 ch) (128 kbps)",
"LFECount": 0,
"Language": "English",
"LanguageCode": "eng",
"SampleRate": 48000
}
],
"ChapterList": [
{
"Duration": {
"Hours": 0,
"Minutes": 4,
"Seconds": 41,
"Ticks": 25263000
},
"Name": "Chapter 1"
},
{
"Duration": {
"Hours": 0,
"Minutes": 8,
"Seconds": 5,
"Ticks": 43620030
},
"Name": "Chapter 2"
},
{
"Duration": {
"Hours": 0,
"Minutes": 7,
"Seconds": 48,
"Ticks": 42086970
},
"Name": "Chapter 3"
},
{
"Duration": {
"Hours": 0,
"Minutes": 7,
"Seconds": 33,
"Ticks": 40799970
},
"Name": "Chapter 4"
},
{
"Duration": {
"Hours": 0,
"Minutes": 2,
"Seconds": 58,
"Ticks": 15990030
},
"Name": "Chapter 5"
},
{
"Duration": {
"Hours": 0,
"Minutes": 5,
"Seconds": 12,
"Ticks": 28065060
},
"Name": "Chapter 6"
},
{
"Duration": {
"Hours": 0,
"Minutes": 10,
"Seconds": 6,
"Ticks": 54510030
},
"Name": "Chapter 7"
},
{
"Duration": {
"Hours": 0,
"Minutes": 4,
"Seconds": 30,
"Ticks": 24300000
},
"Name": "Chapter 8"
},
{
"Duration": {
"Hours": 0,
"Minutes": 3,
"Seconds": 42,
"Ticks": 19943910
},
"Name": "Chapter 9"
},
{
"Duration": {
"Hours": 0,
"Minutes": 3,
"Seconds": 28,
"Ticks": 18675000
},
"Name": "Chapter 10"
},
{
"Duration": {
"Hours": 0,
"Minutes": 5,
"Seconds": 27,
"Ticks": 29432970
},
"Name": "Chapter 11"
},
{
"Duration": {
"Hours": 0,
"Minutes": 7,
"Seconds": 28,
"Ticks": 40347000
},
"Name": "Chapter 12"
},
{
"Duration": {
"Hours": 0,
"Minutes": 9,
"Seconds": 33,
"Ticks": 51600060
},
"Name": "Chapter 13"
},
{
"Duration": {
"Hours": 0,
"Minutes": 3,
"Seconds": 35,
"Ticks": 19335060
},
"Name": "Chapter 14"
},
{
"Duration": {
"Hours": 0,
"Minutes": 5,
"Seconds": 1,
"Ticks": 27074970
},
"Name": "Chapter 15"
},
{
"Duration": {
"Hours": 0,
"Minutes": 5,
"Seconds": 39,
"Ticks": 30528000
},
"Name": "Chapter 16"
},
{
"Duration": {
"Hours": 0,
"Minutes": 7,
"Seconds": 20,
"Ticks": 39582000
},
"Name": "Chapter 17"
},
{
"Duration": {
"Hours": 0,
"Minutes": 3,
"Seconds": 40,
"Ticks": 19824030
},
"Name": "Chapter 18"
},
{
"Duration": {
"Hours": 0,
"Minutes": 8,
"Seconds": 0,
"Ticks": 43229970
},
"Name": "Chapter 19"
},
{
"Duration": {
"Hours": 0,
"Minutes": 2,
"Seconds": 48,
"Ticks": 15093000
},
"Name": "Chapter 20"
},
{
"Duration": {
"Hours": 0,
"Minutes": 0,
"Seconds": 1,
"Ticks": 45000
},
"Name": "Chapter 21"
}
],
"Color": {
"Matrix": 6,
"Primary": 6,
"Transfer": 1
},
"Crop": [
56,
58,
0,
2
],
"Duration": {
"Hours": 1,
"Minutes": 56,
"Seconds": 32,
"Ticks": 629346060
},
"FrameRate": {
"Den": 1126125,
"Num": 27000000
},
"Geometry": {
"Height": 480,
"PAR": {
"Den": 27,
"Num": 32
},
"Width": 720
},
"Index": 1,
"InterlaceDetected": false,
"Metadata": {},
"Name": "ALIEN",
"Path": "/Samples/DVD/Alien.iso",
"Playlist": -1,
"SubtitleList": [
{
"Attributes": {
"4By3": false,
"Children": false,
"ClosedCaption": true,
"Commentary": false,
"Default": false,
"Forced": false,
"Large": false,
"Letterbox": false,
"Normal": false,
"PanScan": false,
"Wide": true
},
"Format": "bitmap",
"Language": "English Closed Caption (Wide Screen) [VOBSUB]",
"LanguageCode": "eng",
"Source": 0,
"SourceName": "VOBSUB"
},
{
"Attributes": {
"4By3": false,
"Children": false,
"ClosedCaption": true,
"Commentary": false,
"Default": false,
"Forced": false,
"Large": false,
"Letterbox": true,
"Normal": false,
"PanScan": false,
"Wide": false
},
"Format": "bitmap",
"Language": "English Closed Caption (Letterbox) [VOBSUB]",
"LanguageCode": "eng",
"Source": 0,
"SourceName": "VOBSUB"
},
{
"Attributes": {
"4By3": false,
"Children": false,
"ClosedCaption": false,
"Commentary": false,
"Default": false,
"Forced": false,
"Large": false,
"Letterbox": false,
"Normal": true,
"PanScan": false,
"Wide": true
},
"Format": "bitmap",
"Language": "español (Wide Screen) [VOBSUB]",
"LanguageCode": "spa",
"Source": 0,
"SourceName": "VOBSUB"
},
{
"Attributes": {
"4By3": false,
"Children": false,
"ClosedCaption": false,
"Commentary": false,
"Default": false,
"Forced": false,
"Large": false,
"Letterbox": true,
"Normal": true,
"PanScan": false,
"Wide": false
},
"Format": "bitmap",
"Language": "español (Letterbox) [VOBSUB]",
"LanguageCode": "spa",
"Source": 0,
"SourceName": "VOBSUB"
},
{
"Attributes": {
"4By3": false,
"Children": false,
"ClosedCaption": false,
"Commentary": false,
"Default": false,
"Forced": false,
"Large": false,
"Letterbox": false,
"Normal": true,
"PanScan": false,
"Wide": true
},
"Format": "bitmap",
"Language": "Francais (Wide Screen) [VOBSUB]",
"LanguageCode": "fra",
"Source": 0,
"SourceName": "VOBSUB"
},
{
"Attributes": {
"4By3": false,
"Children": false,
"ClosedCaption": false,
"Commentary": false,
"Default": false,
"Forced": false,
"Large": false,
"Letterbox": true,
"Normal": true,
"PanScan": false,
"Wide": false
},
"Format": "bitmap",
"Language": "Francais (Letterbox) [VOBSUB]",
"LanguageCode": "fra",
"Source": 0,
"SourceName": "VOBSUB"
},
{
"Attributes": {
"4By3": false,
"Children": false,
"ClosedCaption": true,
"Commentary": false,
"Default": false,
"Forced": false,
"Large": false,
"Letterbox": false,
"Normal": false,
"PanScan": false,
"Wide": false
},
"Format": "text",
"Language": "English, Closed Caption [CC608]",
"LanguageCode": "eng",
"Source": 1,
"SourceName": "CC608"
}
],
"Type": 0,
"VideoCodec": "mpeg2video"
},
{
"AngleCount": 1,
"AudioList": [
{
"Attributes": {
"AltCommentary": false,
"Commentary": false,
"Default": false,
"Normal": false,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 192000,
"ChannelCount": 2,
"ChannelLayout": 3,
"ChannelLayoutName": "stereo",
"Codec": 2048,
"CodecName": "ac3",
"Description": "English (AC3) (2.0 ch) (192 kbps)",
"LFECount": 0,
"Language": "English",
"LanguageCode": "eng",
"SampleRate": 48000
},
{
"Attributes": {
"AltCommentary": false,
"Commentary": false,
"Default": false,
"Normal": true,
"Secondary": false,
"VisuallyImpaired": false
},
"BitRate": 192000,
"ChannelCount": 2,
"ChannelLayout": 3,
"ChannelLayoutName": "stereo",
"Codec": 2048,
"CodecName": "ac3",
"Description": "English (AC3) (2.0 ch) (192 kbps)",
"LFECount": 0,
"Language": "English",
"LanguageCode": "eng",
"SampleRate": 48000
}
],
"ChapterList": [
{
"Duration": {
"Hours": 0,
"Minutes": 3,
"Seconds": 23,
"Ticks": 18249030
},
"Name": "Chapter 1"
},
{
"Duration": {
"Hours": 0,
"Minutes": 0,
"Seconds": 1,
"Ticks": 45000
},
"Name": "Chapter 2"
},
{
"Duration": {
"Hours": 0,
"Minutes": 0,
"Seconds": 1,
"Ticks": 45000
},
"Name": "Chapter 3"
}
],
"Color": {
"Matrix": 6,
"Primary": 6,
"Transfer": 1
},
"Crop": [
108,
110,
14,
22
],
"Duration": {
"Hours": 0,
"Minutes": 3,
"Seconds": 23,
"Ticks": 18338940
},
"FrameRate": {
"Den": 1126125,
"Num": 27000000
},
"Geometry": {
"Height": 480,
"PAR": {
"Den": 9,
"Num": 8
},
"Width": 720
},
"Index": 3,
"InterlaceDetected": false,
"Metadata": {},
"Name": "ALIEN",
"Path": "/Samples/DVD/Alien.iso",
"Playlist": -1,
"SubtitleList": [],
"Type": 0,
"VideoCodec": "mpeg2video"
}
]
}