Example of extracting MacGyver s01e01 creating both a .mp4
with commercials and a -z.mp4
without commercials.
$ surlatablo.py -n -q 'MacGyver - s01e01' -c -C -k @ Gif Mp4 Mp4zap1 Json
(863062) MacGyver - s01e01 - The Rising
Friday, September 23, 2016 at 07:00 PM
KTVT(CBS) - 1080i [1:05:11]
Description:
Special agents for the Department of External Services, Angus "Mac" MacGyver and
Jack Dalton, work to recover a missing bioweapon.
Lucas Till;George Eads;Sandrine Holt;Justin Hires;Tristin Mays
Tablo (.ts) location: [./TV/MacGyver/Season 1/MacGyver - s01e01 - The Rising.ts]
Working on: [./TV/MacGyver/Season 1/MacGyver - s01e01 - The Rising]
Retrieving Tablo Data (863062): [####################] 100% Elapsed seconds 228.0
Srt file location: [./TV/MacGyver/Season 1/MacGyver - s01e01 - The Rising.eng.srt]
Extracting CC as Subtitle: [####################] 100% Elapsed seconds 13.0
Transcoding (Gif, .gif): [####################] 100% Elapsed seconds 2.0
Transcoding (Mp4, .mp4): [####################] 100% Elapsed seconds 9.0
Searching for commercials: [####################] 100% Elapsed seconds 214.0
Removing commercials (z1): [####################] 100% Elapsed seconds 24.0
Preserved (.ts) with commercials: [./TV/MacGyver/Season 1/MacGyver - s01e01 - The Rising-orig.ts]
Transcoding (Mp4zap1, -z.mp4): [####################] 100% Elapsed seconds 405.0
Executing (dumpJson, .json)
Took about 15 minutes on a very very old CPU. Files created as a result of the above.
$ ls -lh TV/MacGyver/Season\ 1/
total 6.6G
-rw-r--r-- 1 ccox users 100K Nov 25 15:10 MacGyver - s01e01 - The Rising.eng.srt
-rw-r--r-- 1 ccox users 1.5M Nov 25 15:10 MacGyver - s01e01 - The Rising.gif
-rw-r--r-- 1 ccox users 2.1K Nov 25 15:21 MacGyver - s01e01 - The Rising.json
-rw-r--r-- 1 ccox users 1.9G Nov 25 15:10 MacGyver - s01e01 - The Rising.mp4
-rw-r--r-- 1 ccox users 2.0G Nov 25 15:10 MacGyver - s01e01 - The Rising-orig.ts
-rw-r--r-- 1 ccox users 1.5G Nov 25 15:14 MacGyver - s01e01 - The Rising.ts
-rw-r--r-- 1 ccox users 1.3G Nov 25 15:21 MacGyver - s01e01 - The Rising-z.mp4
The .gif file is a short animated GIF preview. The .json file is a dump of JSON from SurLaTablo describing the program. The -k @
option told SurLaTablo to preserve the .ts
files.
The ffprobe (or you can use mediainfo) metadata of the resulting mp4 file.
"format": {
"filename": "TV/MacGyver/Season 1/MacGyver - s01e01 - The Rising.mp4",
"nb_streams": 3,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "3879.314000",
"size": "2001526750",
"bit_rate": "4127589",
"probe_score": 100,
"tags": {
"major_brand": "isom",
"minor_version": "512",
"compatible_brands": "isomiso2avc1mp41",
"title": "The Rising",
"album": "MacGyver",
"encoder": "Lavf57.25.100",
"comment": "Special agents for the Department of External Services, Angus \"Mac\" MacGyver and Jack Dalton, work to recover a missing bioweapon.",
"genre": "N/A",
"description": "Special agents for the Department of External Services, Angus \"Mac\" MacGyver and Jack Dalton, work to recover a missing bioweapon.",
"synopsis": "Special agents for the Department of External Services, Angus \"Mac\" MacGyver and Jack Dalton, work to recover a missing bioweapon.",
"show": "MacGyver",
"episode_id": "s01e01",
"network": "KTVT",
"episode_sort": "1",
"season_number": "1",
"media_type": "10",
"hd_video": "1"
}
}
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_time_base": "1001/60000",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1280,
"height": 720,
"coded_width": 1280,
"coded_height": 720,
"has_b_frames": 1,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": 41,
"chroma_location": "left",
"refs": 2,
"is_avc": "true",
"nal_length_size": "4",
"r_frame_rate": "30000/1001",
"avg_frame_rate": "1787339657/59693558",
"time_base": "1/90000",
"start_pts": 2160,
"start_time": "0.024000",
"duration_ts": 348969621,
"duration": "3877.440233",
"bit_rate": "3866530",
"bits_per_raw_sample": "8",
"nb_frames": "116098",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_time_base": "1/48000",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/48000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 186096640,
"duration": "3877.013333",
"bit_rate": "254762",
"max_bit_rate": "254762",
"nb_frames": "181735",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0
},
"tags": {
"language": "eng",
"handler_name": "SoundHandler"
}
},
{
"index": 2,
"codec_name": "mov_text",
"codec_long_name": "3GPP Timed Text subtitle",
"codec_type": "subtitle",
"codec_time_base": "1/1000",
"codec_tag_string": "tx3g",
"codec_tag": "0x67337874",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 3879314,
"duration": "3879.314000",
"bit_rate": "85",
"nb_frames": "2261",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0
},
"tags": {
"language": "eng",
"handler_name": "SubtitleHandler"
}
}
]
}
For players that support it the close captions are embedded in the mp4. However, the .srt
is also produced for players that need that.