Opened 17 years ago

Last modified 13 years ago

#705 new defect

endpos does not work with mplayer on 'live' streams

Reported by: compn Owned by: reimar
Priority: normal Component: streaming
Version: HEAD Severity: trivial
Keywords: Cc: r_ovidius@…, mplayer.mails.skeeve@…
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

mplayer -endpos 30 "http://wmscr1.dr.dk/e02ch03m?wmcontentbitrate=300000/.wma"

does not work , i think the problem is the timestamp is very large...
similar problem with lavf, altho the number is a negative.

Change History (9)

comment:1 by r_togni@…, 17 years ago

It works, but you have to specify a timestamp istead of a relative offset: if the stream starts with timestamp 1000 and you want to stop after 10 sec, you don't have to use -endpos 10 but -endpos 1010 insted.

comment:2 by r_ovidius@…, 17 years ago

Cc: r_ovidius@… added

I experience this problem as well. I am trying to dump a stream for 30 minutes every day at a certain time and only save 30 minutes. The stream is live radio.

mplayer -dumpstream "mms://wm05.nm.cbc.ca/cbcr1-vancouver" -endpos 0:30:0

But it does not work (live realmedia streams don't work either AFAIK), and I don't see a way (automated or manual) to figure out the stream timestamp so that I can make a "relative endpos" as stated in comment #1.

comment:3 by compn, 17 years ago

for real rtsp streams, you can use ?start=30:00 and some other to stop...

i think it was ?stop but i'm not sure..

rtsp://blah.rm?start=30:00 works fine :)

comment:4 by mplayer.mails.skeeve@…, 16 years ago

Cc: mplayer.mails.skeeve@… added

So if you want to stop recording a livestream after, say 1hour, you have to find out first the timestamp of the stream? How can I possibly to that?

comment:5 by compn, 16 years ago

(In reply to comment #4)

So if you want to stop recording a livestream after, say 1hour, you have to
find out first the timestamp of the stream? How can I possibly to that?

the timestamps are shown in mplayer output when you play the stream
A:749440.0 (208:10:40.0) of 2133437440.0 (-24.-8) 0.5% 6%

so you would use -endpos 209:10:40

or you could calculate what fps it is and then just use 30fpsx60secondsx60mins -frames 108000

comment:6 by mplayer.mails.skeeve@…, 16 years ago

(In reply to comment #5)

the timestamps are shown in mplayer output when you play the stream
A:749440.0 (208:10:40.0) of 2133437440.0 (-24.-8) 0.5% 6%

Below is my output. I don't see a timestamp. Or is "(06.5)" the timestamp?

Problem is: I was trying to create an Applescript to be triggered by a calendar event in order to record a stream at a given time. If I want to do it by adding something to the timestamp, I need to connect once to get it and then again with the calculated endpos. Not very practical.

I also tried to kill the process but then i get no recording at all, provided my cache is large enough. I choose a cache of 4MB because I had some glitches in the recording when I didn't set the cache.


$ mplayer http://dradio-mp3.t-bn.de/dlf_live
MPlayer dev-SVN-r21482-4.0.1 (C) 2000-2006 MPlayer Team
AltiVec found
CPU: PowerPC

Playing http://dradio-mp3.t-bn.de/dlf_live.
Resolving dradio-mp3.t-bn.de for AF_INET6...
Couldn't resolve name for AF_INET6: dradio-mp3.t-bn.de
Resolving dradio-mp3.t-bn.de for AF_INET...
Connecting to server dradio-mp3.t-bn.de[194.50.58.72]: 80...
Cache size set to 320 KBytes
Cache fill: 2.50% (8192 bytes)
ICY Info: StreamTitle=;
Cache fill: 12.50% (40960 bytes)
Audio file file format detected.
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
mpg123: Can't rewind stream by 117 bits!
AUDIO: 44100 Hz, 2 ch, s16be, 48.0 kbit/3.40% (ratio: 6000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [macosx] 44100Hz 2ch s16be (2 bytes per sample)
Video: no video
Starting playback...
mpg123: Can't rewind stream by 163 bits!
mpg123: Can't rewind stream by 211 bits!
mpg123: Can't rewind stream by 95 bits!
A: 6.6 (06.5) of -0.0 (unknown) 2.0% 20%

MPlayer interrupted by signal 2 in module: play_audio

comment:7 by compn, 16 years ago

(In reply to comment #6)

(In reply to comment #5)

the timestamps are shown in mplayer output when you play the stream
A:749440.0 (208:10:40.0) of 2133437440.0 (-24.-8) 0.5% 6%

Below is my output. I don't see a timestamp. Or is "(06.5)" the timestamp?

the 6.6 is the timestamp, -endpos 10 should work for you

Problem is: I was trying to create an Applescript to be triggered by a calendar
event in order to record a stream at a given time. If I want to do it by

use the right tool for the job, like streamripper
http://streamripper.sourceforge.net/

comment:8 by mplayer.mails.skeeve@…, 16 years ago

(In reply to comment #7)

use the right tool for the job, like streamripper
http://streamripper.sourceforge.net/

StreamripperX is dead since OS X 10.2. There is a shareware that is supposed to be a replacement.

Using the source is an option for me, but not for other Mac users. You know: Mac users usually don't compile ;-)

I switched to VLC for my AppleScript. I'd still love to see a "relative endpos" option.

Anyway: Thanks for your support.

comment:9 by compn, 13 years ago

Owner: changed from r_togni@… to reimar
Note: See TracTickets for help on using tickets.