-mc 0 -noskip
Adding those 2 options to mencoder standard option makes the video/audio sync for my .MOV file (taken by Digital Camera) sync smoothly1
-mc 0 -noskip
#!/usr/bin/python
import os, re
from optparse import OptionParser
usage = '%prog [options] /path/to/avchd/dir'
opt_parser = OptionParser(usage=usage)
opt_parser.add_option('-d', '--debug', dest='debug', action='store_true', default=False, help = 'debug')
options, args = opt_parser.parse_args()
def dosname(file) :
name_map = [
('index.bdmv', 'INDEX.BDM'),
('MovieObject.bdmv', 'MOVIEOBJ.BDM'),
(re.compile(r'(?P.*)\.clpi', re.IGNORECASE) , '.CPI'),
(re.compile(r'(?P.*)\.m2ts', re.IGNORECASE) , '.MTS'),
(re.compile(r'(?P.*)\.mpls', re.IGNORECASE) , '.MPL'),
]
for src, dst in name_map :
if type(src) == type('') :
if file == src :
return dst
else :
mo = src.match(file)
if mo :
return mo.group('name') + dst
return None
def avchdme(src_path, debug) :
'''Convert file name to AVCHD with Dos short file name style for PS3'''
for ent in os.listdir(src_path) :
full_path = os.path.join(src_path, ent)
if os.path.isdir(full_path) :
avchdme(full_path, debug)
else :
newname = dosname(ent)
if newname :
src = full_path
dst = os.path.join(src_path, newname)
if debug :
print 'renaming %s to %s' % (src, dst)
else :
os.rename(src, dst)
for arg in args :
avchdme(arg, options.debug)
java -jar BDSup2Sub.jar
iconv -f tis-620 -t utf-8 -o destinatino_subtitle_file.srt source_subtitle_file.srt
#!/usr/bin/python
global DeviceName, AddAction, RemoveAction, bus, hal_manager
#DeviceName = 'usb_device_15ca_c3_noserial_if0_logicaldev_input'
DevicePattern = r'usb_device.*_input'
DeviceCap = 'input.mouse'
AddAction = '/usr/bin/gconftool --set --type=bool /desktop/gnome/peripherals/mouse/touchpad_enabled false'
RemoveAction = '/usr/bin/gconftool --set --type=bool /desktop/gnome/peripherals/mouse/touchpad_enabled true'
import dbus # needed to do anything
import dbus.decorators # needed to receive messages
import dbus.glib # needed to receive messages
import gobject # needed to loop & monitor
import os # needed to
import re, time
DeviceRe = re.compile(DevicePattern, re.IGNORECASE | re.DOTALL)
#@dbus.decorators.explicitly_pass_message
def add_device(*args, **keywords):
Path = args[0].split('/')
device_obj = bus.get_object('org.freedesktop.Hal', args[0])
device = dbus.Interface(device_obj, dbus_interface = "org.freedesktop.Hal.Device")
cap = device.QueryCapability(DeviceCap)
if cap and DeviceRe.match(Path[-1]) :
os.system(AddAction)
#@dbus.decorators.explicitly_pass_message
def remove_device(*args, **keywords):
Path = args[0].split('/')
try :
device_obj = bus.get_object('org.freedesktop.Hal', args[0])
device = dbus.Interface(device_obj, dbus_interface = "org.freedesktop.Hal.Device")
cap = device.QueryCapability(DeviceCap)
except :
# assume true, since device might be already removed
cap = True
if cap and DeviceRe.match(Path[-1]) : # Device found
os.system(RemoveAction)
bus = dbus.SystemBus() # connect to system bus
hal_manager_obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
hal_manager = dbus.Interface(hal_manager_obj, 'org.freedesktop.Hal.Manager')
# Add listeners for all devices being added or removed
bus.add_signal_receiver(add_device, 'DeviceAdded', 'org.freedesktop.Hal.Manager',
'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
bus.add_signal_receiver(remove_device, 'DeviceRemoved', 'org.freedesktop.Hal.Manager',
'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
# Run remove action once to enable touchpad
os.system(RemoveAction)
time.sleep(1)
# Find mouse first
udis = hal_manager.FindDeviceByCapability('input.mouse')
for udi in udis :
Path = udi.split('/')
if DeviceRe.match(Path[-1]) : # Check if this is our prefer mouse
os.system(AddAction)
break # no need to keep looking
# monitor
loop = gobject.MainLoop()
loop.run()
gs -q -sDEVICE=tiffg3 -dNOPAUSE -sOutputFile=letter-%03d.tiff invitation_cmu.ps < /dev/null
efax -tfile...
.... M1L3Command in the latter part of Modem Init command dialog box. Also, the modem reset command is not working well, so I replaced it with hang-up command
HNote that all command will always being prefixed with "AT", as normal modem command. Ah... I miss the AT command
mencoder -ovc lavc -lavcopts vcodec=mpeg4:vhq:vqmin=2:vqscale=5:threads=2:aspect=4/3 -oac mp3lame -lameopts preset=standard -ffourcc DX50 -edl edl1.txt - o output.avi input.mpgThe vqscale=5 yield best quality and good file size. The total file size is about 1G from 4.2G MPEG2 source file, note that I remove the commercial ad and other TV program at the end of file so the actual source file size would be about 3G.
rmbr DELL 2 4Where "DELL" is my manufacturer model, 2 is the number of partition for power button, and 4 is number of partition for mediadirect button. I believe what it really does is, modify MBR to boot from partition #2, and put "something" in some place to boot from #4 when mediadirect is pressed. (I think the "something" is actually goes into MBR as well after some experiments below, and also according to many web sites in the internet.)