Showing posts with label redsox. Show all posts
Showing posts with label redsox. Show all posts
Friday, March 11, 2011
audio + video
figured out how to get an alternate audio into a video file:
# take mp3 out of audio flv
ffmpeg -i altAudio.flv -acodec copy altAudio.mp3
# take the video only out of the video
mencoder -ni -ovc copy -nosound -o noAudio.mp4 origVideo.mp4
# put the audio and video together
mencoder -ovc copy -oac copy -audiofile altAudio.mp3 -o out.avi noAudio.mp4
might not need both the ffmpeg step and -ni on the video extraction, but at least one of them is necessary. i tried without both and the video played at double speed while the audio was normal speed in the out.avi. might also be able to use a different format out with -of. not sure if avi transcodes it.
EDIT: tried without -ni, still works fine.
might need to adjust delay with - and +.
also, i found that rtmpdump has very handy -e and -o options. i dropped the -A option with -e and it seems to work (kind of), not sure if that is absolutely necessary.
now i'm trying to get mencoder on a file to let me playback faster. tried -vf filmdint and filmdint=io=2:1, and it doesn't hurt but doesn't seem to be essential. so far, best results are with just -fps 30000/1001 -ofps 20000/1001 and speed it up with ']'. -oac copy doesn't work; have to use something else like pcm (uncompressed) or mp3lame. the original audio is 48000Hz aac, which i can encode with -oac lavc -lavcopts acodec=aac, but that makes encoding really slow and messes up a/v sync, even when i try to compensate by changing -srate.
so far this version looks promising, but the avi has no idx:
mencoder -ovc copy -oac mp3lame -fps 30000/1001 -ofps 20000/1001 -o out.avi infile.mp4
could try -of mpeg or lavf, with a lavf format=mp4 for example, since the original is mp4 and plays pretty well (except when i speed it up too much).
ok, this one seems to work pretty well:
mencoder -ovc copy -oac mp3lame -fps 30000/1001 -ofps 20000/1001 -of lavf -lavfopts format=mp4 -o out.mp4 infile.mp4
Thursday, May 27, 2010
mlbviewer.py fixed
looks like mlb.com decided to jack up the xml they were sending out a couple of weeks ago, and it took me a while to figure out what to do about it. apparently the sourceforge forums are not really used; all the discussion about mlbviewer is at lq. the critical point was in comment 2917:
$ cp MediaService.xsd ~/.mlb
$ rm -r /tmp/suds/*
that suds cache really had me stumped when nothing happened after i updated the MediaService files. and it's really annoying to debug these kinds of problems when the Sign-on Restriction Error locks me out for >15 minutes at a time.
Friday, March 26, 2010
using mlbviewer for gameday audio
got my account working with mlbviewer (make sure to get the svn version for 2010 changes!) and the latest rtmpdump. only change i had to make was to change
DEFAULT_F_RECORD = 'rtmpdump -f \"LNX 10,0,22,87\" -o %f -r %s'
to
DEFAULT_F_RECORD = os.path.join(os.environ['HOME'],'checkinstall','rtmpdump','rtmpdump-2.2b','rtmpdump -f \"LNX 10,0,22,87\" -o %f -r %s')
in MLBviewer/mlbtv.py since i haven't installed rtmpdump in root. my ~/.mlb/config is
use_nexdef=False
user = <>
pass = <>
#debug = True
show_player_command = True
speed = 800
audio_player = mplayer -dumpstream %s -dumpfile %f
use_xml = False
audio_follow = 'bos'
favorite = 'bos'
i'm not totally sure about needing that use_xml = False, but i had some connection problems (the fact that the mlb seems to look me out for some time after i fail and/or try to reconnect soon doesn't help) before messing around with stuff and this Just Works. now i just run mlbviewer.py, navigate to the game, and press 'a' to download.
even though mlbviewer names the file .mp3, it's actually a flv with a single (mp3) stream. these commands are handy for demuxing and chopping the mp3 to more manageable sizes for my mp3 player.
ffmpeg -i 2010-03-19-bosmlb-pitmlb-1-MLB.com.mp3 -acodec copy tmp.mp3
mpgsplit -18 tmp.mp3 -b 2010-03-19-bos-pit
now i just need to rig up mlblistings, test/gamedayaudio.py, and the above commands to do this automatically and put stuff on my mp3 player. also need to put some tags on the files so they are conveniently grouped.
Friday, July 10, 2009
mlb gameday audio on linux
well, the free baseball audio i used to use doesn't seem to work anymore, so i've been looking for ways to use the mlb gameday audio service. the problem is, they assume i want to spend the whole day sitting in front of my windoze machine listening to my web browser. so i found the excellent mlbviewer project.
the dependencies were mostly easy to resolve: pyxml and simplejson have gentoo packages, and suds just needed an easy_install suds. rtmpdump, however, has been declared an enemy to truth, justice, and the american way. almost every site that once hosted a copy seems to have taken it down after getting peed on by adobe's legal department. (fritz hollings, still keeping the country safe from technology.) i had to get a copy of rtmpdump-v1.5 from a bsd repo, since mlbviewer claims not to work on newer versions (although i seem to recall seeing a changelog entry noting that 1.6 would...). i had to add an include for stdint.h in rtmppacket.h to get it to compile on linux. make rtmpdump, make streams worked fine after that. don't forget to run Patch.sh in rtmpdump-patches/ that comes with mlbviewer. it also needs a very recent svn version of mplayer; the install file shows you how to check it out. ./configure --enable-dynamic-plugins, make, and you're done.
i built mlbviewer-0.1alpha12 in its own directory, with a dedicated rtmpdump and mplayer. the install file says to install these to root, so they are found by mlbviewer. but it turns out mplayer and rtmpdump_x86 are only referenced once in the whole mlbviewer package (other than test/), so it's not hard to change the paths.
set PYTHONPATH if you don't install to root
python setup.py --prefix=/path/to/mlbviewer/installation install
mkdir ~/.mlb
cp MediaService.* ~/.mlb/
set user and pass in ~/.mlb/config
i think that the -dumpstream -dumpfile options will work with the mplayer called from mlbviewer, so this could be a nice little audio tivo for yours truly. and mlbviewer comes with other handy tools for finding out which files are available, for some easy cron automation.
EDIT: managed to compile rtmpdump 2.2b, which claims to support everything (including rtmpe). had to point it to some includes with
export XCFLAGS='-I/home/epd-6.0.1-rh5-x86/include'
export XLDFLAGS='-L/home/epd-6.0.1-rh5-x86/lib'
seems to work just fine with mlbviewer, even without any of its patches for 1.5. mlbplayer warns that you must compile a svn version from the last 2 weeks (before its release 2009-06-11) for it to play stably. ubuntu's current version (2:1.0~rc3+svn20090426-1ubuntu10.1, SVN-r29237-4.4.1) of mplayer plays the flv (with a mp3 extension!?) file dumped out by test/gamedayaudio.py, though it does get the length wrong which might cause problems with seeking. otherwise, maybe the warnings apply more for video than audio.
Friday, May 8, 2009
free online baseball
just found this great site that links to online sports radio stations that broadcast baseball games: http://www.freebaseballradio.com/
and with the magic of mplayer, i can time-shift redsox games (my personal audio recorder)
mplayer -dumpstream -dumpfile redsox-2009-05-07.asf mms://wm-live.abacast.com/northeast_broadcasting-wfad-32
Subscribe to:
Posts (Atom)