Opened 12 years ago

Last modified 11 years ago

#2088 new enhancement

loadfile from offset in one command

Reported by: falcon.sheep@… Owned by: reimar
Priority: normal Component: core
Version: unspecified Severity: minor
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

I'm loading a file from specific position in slave mode (from an application):

loadfile <filename> 0
seek <seconds> 2

with option: nocache
I tried having both commands executed at once i.e. in one line with "\n" between them

It seems the first command "loadfile" will play unwanted frames in all cases until "seek" is taking place. This is noted especially when loading URL instead of local file.

In summary: command which can load a new file and start playing
from a given offset in idle slave mode (atomic operation for loadfile / seek).

it is like −ss in mplayer or ffmpeg but in slave mode.

this will help also in not wasting time for DNS URL resolving since it is doing this when loading the URL and then when seeking.

Change History (3)

comment:1 by falcon.sheep@…, 11 years ago

just a follow up on the case:

The below output shows clearly the case, loadfile will start the stream from the beginning, then seek will take affect.

MPlayer says: MPlayer Redxii-SVN-r36050-4.6.3 (C) 2000-2013 MPlayer Team
MPlayer says: Custom build by Redxii, http://smplayer.sourceforge.net
MPlayer says: Compiled against FFmpeg version N-51249-g01a334e
MPlayer says: Build date: Sun Mar 24 00:01:25 EDT 2013
MPlayer says:
MPlayer says: get_path('codecs.conf') -> 'C:/Users/Ibrahim/Documents/AudioCataloger/out/AudioCataloger/bin/mplayer/codecs.conf'
MPlayer says: get_path('fonts') -> 'C:/Users/Ibrahim/Documents/AudioCataloger/out/AudioCataloger/bin/mplayer/fonts'
Send to MPlayer the command: loadfile "http://www.maknoon.com/download/audios/الشيخ محمد علي فركوس/المنتقى من الفتاوى الشرعية/07.rm" 0
seek 2003.0 2
Command sent
MPlayer says: get_path('07.rm.conf') -> 'C:/Users/Ibrahim/Documents/AudioCataloger/out/AudioCataloger/bin/mplayer/07.rm.conf'
MPlayer says:
MPlayer says: Playing http://www.maknoon.com/download/audios/الشيخ محمد علي فركوس/المنتقى من الفتاوى الشرعية/07.rm.
MPlayer says: get_path('sub/') -> 'C:/Users/Ibrahim/Documents/AudioCataloger/out/AudioCataloger/bin/mplayer/sub/'
MPlayer says: Resolving www.maknoon.com for AF_INET...
MPlayer encountered an error: Fontconfig error: Cannot load default config file
MPlayer encountered an error: IPv6 not supported for winsock2
MPlayer says: Connecting to server www.maknoon.com[69.89.31.235]: 80...
MPlayer encountered an error: IPv6 not supported for winsock2
MPlayer says:
MPlayer says: Cache size set to 0 KBytes
MPlayer says: Resolving www.maknoon.com for AF_INET...
MPlayer says: Connecting to server www.maknoon.com[69.89.31.235]: 80...
MPlayer says:
MPlayer says: libavformat version 55.0.100 (internal)
MPlayer says: libavformat file format detected.
MPlayer encountered an error: IPv6 not supported for winsock2
MPlayer says: Resolving www.maknoon.com for AF_INET...
MPlayer says: Connecting to server www.maknoon.com[69.89.31.235]: 80...
MPlayer encountered an error:
MPlayer encountered an error: [rm @ 012712e0]Invalid stream index 1 for index at pos 4044522
MPlayer encountered an error: IPv6 not supported for winsock2
MPlayer says: Resolving www.maknoon.com for AF_INET...
MPlayer says: Connecting to server www.maknoon.com[69.89.31.235]: 80...
MPlayer says:
MPlayer says: [lavf] stream 0: audio (cook), -aid 0
MPlayer says: Clip info:
MPlayer says: title:
MPlayer says: author:
MPlayer says: copyright:
MPlayer says: comment:
MPlayer says: Audiences: 12k Substream for 28k Dial-up;
MPlayer says: audioMode: music
MPlayer says: Creation Date: 6/12/2009 23:11:06
MPlayer says: Description:
MPlayer says: Generated By: Helix Producer SDK 10.0 for Windows, Build 10.0.0.545
MPlayer says: Keywords:
MPlayer says: Modification Date: 6/12/2009 23:11:06
MPlayer says: videoMode: normal
MPlayer says: get_path('sub/') -> 'C:/Users/Ibrahim/Documents/AudioCataloger/out/AudioCataloger/bin/mplayer/sub/'
MPlayer says: ==========================================================================
MPlayer says: Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
MPlayer says: libavcodec version 55.1.100 (internal)
MPlayer says: AUDIO: 11025 Hz, 1 ch, floatle, 11.0 kbit/3.12% (ratio: 1378->44100)
MPlayer says: Selected audio codec: [ffcook] afm: ffmpeg (FFmpeg COOK audio)
MPlayer says: ==========================================================================
MPlayer says: AO: [dsound] 11025Hz 1ch s16le (2 bytes per sample)
MPlayer says: Video: no video
MPlayer says: Starting playback...
MPlayer says: A: 0.1 (00.0) of 2823.9 (47:03.9) 0.6%
MPlayer says: A: 0.1 (00.0) of 2823.9 (47:03.9) 0.6%
MPlayer says: Resolving www.maknoon.com for AF_INET...
MPlayer encountered an error:
MPlayer encountered an error: IPv6 not supported for winsock2
MPlayer says: Connecting to server www.maknoon.com[69.89.31.235]: 80...
MPlayer encountered an error:
MPlayer says: Resolving www.maknoon.com for AF_INET...
MPlayer encountered an error: IPv6 not supported for winsock2
MPlayer says: Connecting to server www.maknoon.com[69.89.31.235]: 80...
MPlayer says: Resolving www.maknoon.com for AF_INET...
MPlayer says: Connecting to server www.maknoon.com[69.89.31.235]: 80...
MPlayer encountered an error:
MPlayer encountered an error: IPv6 not supported for winsock2
MPlayer says: A:2004.5 (33:24.4) of 2823.9 (47:03.9) 0.2%
MPlayer says: A:2004.5 (33:24.5) of 2823.9 (47:03.9) 0.2%
MPlayer says: A:2004.6 (33:24.5) of 2823.9 (47:03.9) 0.2%

comment:2 by reimar, 11 years ago

It won't save any time, the beginning of the file needs to be read either way, to figure out file format, bit rate etc. without which seeking is not possible.
Even a third request for reading the index might be necessary.
I suspect it won't quite work, but have you tried "pausing loadfile"?
Any solution should probably be based on making that work.

comment:3 by falcon.sheep@…, 11 years ago

(In reply to comment #2)

It won't save any time, the beginning of the file needs to be read either
way, to figure out file format, bit rate etc. without which seeking is not
possible.
Even a third request for reading the index might be necessary.
I suspect it won't quite work, but have you tried "pausing loadfile"?
Any solution should probably be based on making that work.

I need to say the "unwanted frames" was not due to loadfile + seek, I got to know this after some discussion with ffmpeg team:
http://ffmpeg.org/trac/ffmpeg/ticket/1605

and this bug is solved just recently. i was under impression that these "unwanted frames" because of mplayer start playback from 0 each time (e.g. A: 0.1 (00.0) of 2823.9 (47:03.9) 0.6%).

since you are saying atomic operation (loadfile+seek) will not result in any improvement in speed, i guess this ticket is not correct then.

Note: See TracTickets for help on using tickets.