Created
September 9, 2012 11:20
-
-
Save youzaka/3683870 to your computer and use it in GitHub Desktop.
前番組のSD部分をカット
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.1 | |
import sys | |
from itertools import dropwhile | |
from ariblib import TransportStreamFile | |
from ariblib.packet import pid | |
output = open(sys.argv[2], 'wb') | |
with TransportStreamFile(sys.argv[1]) as ts: | |
# SDを捨ててHDを残す場合。逆に前番組のHDを捨ててSDを残す場合は4 (ARIB-STD-B10 第2部第6章 表6-60) | |
video_pid = ts.get_video_pid(1) | |
for packet in dropwhile(lambda p: pid(p) == video_pid, ts): | |
output.write(packet) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment