-
-
Notifications
You must be signed in to change notification settings - Fork 204
Audio speed
CourvilleSoftware edited this page Jan 28, 2023
·
9 revisions
- Principles:
- 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 conversely stream->video_time = real_time / audio_speed
- Definitions:
- 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
)
-
QUESTION should
video->bytesPerSec
be scaled too? - 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
is rt/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
: TODO why should it be changed??? called bystream_video:_parser_thread
and used to modifyvtime_parsed/vcurrent_rate
andatime_parsed/acurrent_rate
TODO where is it used and should it be scaled?
-
- 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 stream rt i.e.stream_get_current_time
withSTREAM_SEEK_BACKWARD
-
- From
stream_video
-
_output_frame_no_resize
:s->video_time
ands->sink_ref_time
are rt/as and increments are (mspf / as) -
stream_get_time_default
: returns rt -
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
- TOCHECK no modification there
- From
stream_subtitles
-
_sub_decode
for internal subs operates oncdata->time
thus requiress->video_time
and not rt but external subs operate on rt and thus requires as *s->video_time
-
- From
stream_sync
-
_output_frame_no_resize
s->sink_ref_time
increments/decrements are mspf/as -
TOCHECK check
sink_ref_time
vs.vid_ref_time
-
- From
stream_sink
- nothing is done there