LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Recording: Windows Media Audio 9 stream (https://www.linuxquestions.org/questions/linux-general-1/recording-windows-media-audio-9-stream-395494/)

despotic 12-21-2005 10:27 PM

Recording: Windows Media Audio 9 stream
 
I appologize if a similar topic has been posted before.

I have a problem recording a Windows Media Audio 9 stream with mplayer. The issue seems to happen only with some Windows Media Audio 9 streams and not with others.
For example, I have tried to record streams from the following radio stations, both streaming Windows Media Audio 9:
1) http://64.34.147.109:3690/CFMJAM -- does not work
2) http://ccri.eonstreams.com/ccri_ne_omaha_kfab_am.asf -- works

When I try to record the first stream with mplayer, I get a dump of the stream, but then I cannot play it in Windows Media Player. On the contrary, if I try to record the second stream, Windows Media Player is able to play the file. I am using the same command for both stations:
Code:

mplayer URL -dumpstream -dumpfile test.wma -vc dummy -vo null

Can you tell me if you have the same issue with the above stream. Also, I'd like to know if any1 knows of another way I can record the stream without using mplayer or maybe how I can properly record a playable file with mplayer.

Thank you for your help!

despotic 12-22-2005 11:38 AM

I sloved my problem :D

For those of you interested, here is the solution:

I realized that the mime-type of the stream that wasn't recorded properly was not recognized. It has a mime-type "application/x-mms-framed", while the stream that I am able to record has a mime-type "video/x-ms-asf". Looking in mplayer's source code (libmpdemux/network.c), I noticed that "video/x-ms-asf" is in the mime-type table and "application/x-mms-framed" was not. So what I had to do is simply add the new mime-type and recompile. Now, the code for mime_type_table looks like:

Code:

mime_struct_t mime_type_table[] = {
        // MP3 streaming, some MP3 streaming server answer with audio/mpeg
        { "audio/mpeg", DEMUXER_TYPE_AUDIO },
        // MPEG streaming
        { "video/mpeg", DEMUXER_TYPE_UNKNOWN },
        { "video/x-mpeg", DEMUXER_TYPE_UNKNOWN },
        { "video/x-mpeg2", DEMUXER_TYPE_UNKNOWN },
        // AVI ??? => video/x-msvideo
        { "video/x-msvideo", DEMUXER_TYPE_AVI },
        // MOV => video/quicktime
        { "video/quicktime", DEMUXER_TYPE_MOV },
        // ASF
        { "audio/x-ms-wax", DEMUXER_TYPE_ASF },
        { "audio/x-ms-wma", DEMUXER_TYPE_ASF },
        { "video/x-ms-asf", DEMUXER_TYPE_ASF },
        { "video/x-ms-afs", DEMUXER_TYPE_ASF },
        { "video/x-ms-wvx", DEMUXER_TYPE_ASF },
        { "video/x-ms-wmv", DEMUXER_TYPE_ASF },
        { "video/x-ms-wma", DEMUXER_TYPE_ASF },
        { "application/x-mms-framed", DEMUXER_TYPE_ASF },
        // Playlists
        { "video/x-ms-wmx", DEMUXER_TYPE_PLAYLIST },
        { "audio/x-scpls", DEMUXER_TYPE_PLAYLIST },
        { "audio/x-mpegurl", DEMUXER_TYPE_PLAYLIST },
        { "audio/x-pls", DEMUXER_TYPE_PLAYLIST },
        // Real Media
//        { "audio/x-pn-realaudio", DEMUXER_TYPE_REAL },
        // OGG Streaming
        { "application/x-ogg", DEMUXER_TYPE_OGG },
        // NullSoft Streaming Video
        { "video/nsv", DEMUXER_TYPE_NSV},
        { "misc/ultravox", DEMUXER_TYPE_NSV},
        { NULL, DEMUXER_TYPE_UNKNOWN},
};

Heads up if you have similar problems ... check the stream mime-type and make sure mplayer recognizes it properly.

utopicdog 01-19-2006 02:57 PM

there is a simpler way, just play the stream and record the mixer channel.


All times are GMT -5. The time now is 09:15 PM.