-
-
Notifications
You must be signed in to change notification settings - Fork 202
Audio speed
CourvilleSoftware edited this page Oct 27, 2024
·
9 revisions
- Design:
- timestamps derivation are not changed by audio_speed
- when
audio_speed>1
, parser is outputting audio/video quicker with smaller time units - this means
realtime=stream->video_time*audio_speed
to scale it back to real value, and converselystream->video_time=real_time/audio_speed
- Notations:
-
rt
:= real video|audio time -
as
:= audio speed (2x -> 2.0f),0.25<=as<=2.00
(audio_interface_get_audio_speed()
) -
mspf
:= milli seconds per frame (s->video->msPerFrame
)
-
-
QUESTIONS
- should
video->bytesPerSec
be scaled too? It should not because it represents real data rate.
- should
- From
audio_interface_audiotrack_java
- sets the audio speed and configures
PlayParams
ofAudioTrack
to set/change output audio rate without pitch
- sets the audio speed and configures
- From
stream_parser
:-
_get_XXX_cdata
: chunck datacdata->time
isrt/as
-
_get_XXX_time
: time is rt -
GET_XXX_TS
: timestamps are rt -
_seek
: need to seek to_get_XXX_time
/as i.e.rt/as
-
_calc_rate
: no scaling should be applied because time difference should be in real time (RT) (it is called bystream_video:_parser_thread
and used to modifyvtime_parsed/vcurrent_rate
andatime_parsed/acurrent_rate
)
-
- From
stream
-
stream_set_av_speed
is called for a change of as and sets AudioTrack audio speed viaaudio_interface_change_audio_speed
andstream_seek_time
to current streamrt
i.e.stream_get_current_time
withSTREAM_SEEK_BACKWARD
-
- From
stream_video
-
_output_frame_no_resize
:s->video_time
ands->sink_ref_time
arert/as
and increments are (mspf/as
) -
stream_get_time_default
: returnsrt
-
QUESTION in
_real_time
there iss->speed
concept that could be used instead withmult
&div
? -
QUESTION
_put_frame_in_sink
calls_real_time
, should it be updated to take as? -
TOCHECK
_video_decode
this is whereframe_time
is set
-
- From
stream_audio
- no modification there which is normal
- From
stream_subtitles
-
_sub_decode
for internal subs operates oncdata->time
thus requiress->video_time
and notrt
but external subs operate onrt
and thus requiresas*s->video_time
-
- From
stream_sync
-
_output_frame_no_resize
s->sink_ref_time
increments/decrements aremspf/as
-
sink_ref_time
(manage frame output timing to sink, adjusted on frame drop or double logic and scaled byas
) vs.vid_ref_time
(used to manage video frames reference time and converts frame time to real time based on playback speed)
-
- From
stream_sink
- nothing is done there