on
http://people.0x63.nu/~andersg/osd-flv-transcoder.tar.gz you can find
things to build a flash video transcoder for the osd.
It contains the following things:
* vixynet flv2mpeg
modified by me to handle input files without seeking,
meaning that it can be used with a pipe as input.
also modified to force output of avi files always.
* ffmpeg source
with some minor adjustments allowing it to build
in a really minimal configuration
* BUILD.sh
script to configure and build ffmpeg libraries
in a minimal configuration for flv2mpeg. The
script then builds "flv2mpeg" itself.
* youtube-fetcher.sh
small shellscript (works with busybox shell) to
download youtube video and feed it to flv2mpeg,
without storing it in a temporary file. (video url
is currently hardcoded in start of script)
NOTE! You need to configure wget support in busybox.
Just run "sh BUILD.sh" and you'll get a flv2mpeg binary for use on the osd.
Unfortunatly this version can only download files for playing on the
osd; not direct streaming. However the transcoding seems to be faster
than realtime on the osd aswell, so it should be possible to feed the
results directly to nmsd. But the current version writes the headers of
the output file last, which wont work when streaming it to nmsd.
Changing it to write out data in order (by writing some fake header
maybe) allowing it to be streamed should be possible, but I haven't
investigated it in detail (yet).
anders
HOLY FLYING COWBAGS BATMAN!!!!
Anders, you mentioned this on the IRC, but I didn't really get it until
I read this!
We will always remember where we were on this historic date, Feb 12,
2007 when we read this email!
Can someone please buy our man Anders the finest jug of wood alchohol
Old Europe has to offer!
CONGRATULATIONS!
Joe
The question now is, how can OSD automatically compose a list off the
Youtube site? isn't there a Lua script doing this already? an xml
parser?
Thanks,
/MG
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
That said, I'd also like to brief here what has been done on top of this
patch in order to bring Youtube support in life, and explain why this
also opens the door for video streaming feature on OSD.
Since similar info can be found at r3-plugins/av/src/input/flv/README to
explain what has been done to the transcoder itself, I'll first explain
what is available for video streaming feature on OSD by finishing the
FLV video input plugin. ;-)
<1> Video streaming on OSD explained
* OSD as a streaming client
All it takes to write a streaming input plugin is to implent the Init
and GetData API together with a few other trivial helper APIs.
Taking r3-plugins/av/src/input/flv/flv.c as the example,
- FLVInit
This does all initializatoin and eventually return the stream info
in to a media_desc_t structure, where the video codec type / resolution,
audio codec type / samplerate etc info get filled in.
- FLVGetData
All this does is eventually to call,
flv_parser_getframe(entry->data,
MAX_ENTRY_SIZE,
&entry->size,
&entry->tsms,
(int *)&entry->key_frame_flag,
&flv_frame_type);
entry->data: pointer to raw compressed video or audio frame
MAX_ENTRY_SIZE: maximum frame buffer size
&entry->size: actual frame buffer size
&entry->tsms: corresponding timestamp for this frame
(int *)&entry->key_frame_flag: is this a key (video) frame?
&flv_frame_type: video or audio?
The above is all the client needs to know, so basically client first
asks for media information, then ask for data using the above APIs. As
long as the Server (explained below) provides the above info, OSD can
happily stream to play back the contents.
* OSD as a streaming server
Server could be super easy if all you want to do is to broadcast
media info and return the media data upon request. It can get more
complicated if RTSP or any other streaming format needs to be supported.
A very simple server on a socket will do the trick to just provide
info as explained in above client support.
I hope the above explanation can inspire someone to bring us an OSD to
OSD streaming at least. If I confused you, just let me know and I am
sure I can explain better in Chinese. ;-)
<2> how real-time FLV transcoding works
To turn Anders FLV2AVI transcoder real-time on OSD, following heavy
rewriting has been done,
- macro block copying is eliminated by using the same data structure for
both h263 input and MPEG4 output processing.
- critical loops are manually expanded (this brings in code space
penalty obviously, however with the change below, the transcoder is
actually much smaller than the original version)
- fetcher callback mechanism is removed (sacrificing the expandability,
but the contents fetcher is not currently used by anyone else, worth the
performance gain)
- removed all frame padding and output stream saving (AVI constructor)
logic, thus removed the dependency to FFMPEG and significantly shrinked
the binary size since the transcoder was using FFMEG mainly for output
muxing.
Again, thanks go to Anders and happy browse Youtube on OSD, more
importantly, looking forward to more OSD streaming support!
/MG