[MPlayer-users] Feature Request: Get OSD Time as a Slave Command

Kevin DeKorte kdekorte at gmail.com
Tue Nov 15 20:51:59 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/15/2011 12:34 PM, mplayer wrote:
>>> ISSUE: The slave command get_time_pos returns the file
>>> timestamp, but for some
> file
>>> formats the timestamp resets.
>>> 
>>> SOLUTION (proposed): However, I noticed that the OSD time
>>> displayed is always good.  So why
> not
>>> add a slave command 'get_osd_time' to expose the value the OSD
>>> is using
> to
>>> display -- it appears to me that OSD just asks the demuxer for
>>> the
> current
>>> time.
>>> 
>>> So this is what I think we'd need to add;
>>> 
>>> input.h MP_CMD_GET_OSD_TIME,
>>> 
>>> input.c { MP_CMD_GET_OSD_TIME, "get_osd_time", 0, { {-1,{0}} }
>>> },
>>> 
>>> command.c case MP_CMD_GET_OSD_TIME: mp_msg(MSGT_GLOBAL,
>>> MSGL_INFO, "ANS_OSD_TIME=%d\n", 
>>> demuxer_get_current_time(mpctx->demuxer));
>> 
>> There is no need to add anything. All that
>> demuxer_get_current_time does is prefer the stream time over
>> pts. You will get the same by just using get_property
>> stream_time_pos and only falling back to get_property time_pos 
>> when it is not available.
> 
> Something is not adding up.
> 
> OSD is using 'demuxer_get_current_time' which implements; if
> (demuxer->stream_pts != MP_NOPTS_VALUE) get_time_ans =
> demuxer->stream_pts; else if (sh_video) get_time_ans =
> sh_video->pts;
> 
> Which returns the RIGHT answer.
> 
> And the slave command 'time_get_pos' is using; if (sh_video) pos =
> sh_video->pts; ...
> 
> Which returns the WRONG answer.
> 
> And 'get_property stream_time_pos' is using; if (!mpctx->demuxer ||
> mpctx->demuxer->stream_pts == MP_NOPTS_VALUE) return
> M_PROPERTY_UNAVAILABLE; return m_property_time_ro(prop, action,
> arg, mpctx->demuxer->stream_pts);
> 
> But when I try calling the slave command: 'get_property
> stream_time_pos' I get the following; Failed to get value of
> property 'stream_time_pos'. ANS_ERROR=PROPERTY_UNKNOWN
> 
> It's pretty frustrating seeing the OSD display 1:15:23 while
> time_get_pos returns 3:15.
> 
> Could we change the 'time_get_pos' to use the same logic as the OSD
> and give preference to the stream pts; if (demuxer->stream_pts !=
> MP_NOPTS_VALUE) pos = demuxer->stream_pts; else if (sh_video) pos =
> sh_video->pts; ...


I can confirm that get_property stream_time_pos, does not appear to work.

mplayer ~/Videos/Guilty\ Crown/\[Doki\]\ Guilty\ Crown\ -\ 01\
\(848x480\ h264\ AAC\)\ \[0D556C93\].mkv -slave -quiet
MPlayer SVN-r34343-4.6.1 (C) 2000-2011 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote
control.

Playing /home/kdekorte/Videos/Guilty Crown/[Doki] Guilty Crown - 01
(848x480 h264 AAC) [0D556C93].mkv.
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0, AVC (480p)
[lavf] stream 1: audio (aac), -aid 0, -alang jpn, AAC (2ch)
[lavf] stream 2: subtitle (ass), -sid 0, -slang eng, ASS
VIDEO:  [H264]  848x480  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 title: [Doki] Guilty Crown - 01 (848x480 h264 AAC).mkv
Load subtitles in /home/kdekorte/Videos/Guilty Crown/
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->192000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4
Audio))
==========================================================================
AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 86
Movie-Aspect is 1.77:1 - prescaling to correct movie aspect.
VO: [xv] 848x480 => 848x480 Planar YV12
get_property stream_time_pos
Failed to get value of property 'stream_time_pos'.
ANS_ERROR=PROPERTY_UNAVAILABLE
get_property time_pos
ANS_time_pos=17.851000
pause
get_time_pos
ANS_TIME_POSITION=22.5
pause


- -- 
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7Cwt8ACgkQ6w2kMH0L1dE1fwCdGP4Ny3pIzBe86EnSUot6+Ltz
vNkAni2OLD1rOS0TPrr4Xe/TlWfZBl58
=X2Tg
-----END PGP SIGNATURE-----


More information about the MPlayer-users mailing list