aos-AVP icon indicating copy to clipboard operation
aos-AVP copied to clipboard

Add playback speed control with audio

Open courville opened this issue 5 years ago • 7 comments

Add capability to speed up video with same audio pitch to watch more in less time.

courville avatar Aug 27 '18 16:08 courville

I hate to be the squeaky wheel here, but how are we doing on this front? I use this feature religiously on every media player I touch, so the lack of the feature here kinda threw me.

PacoBell avatar Jul 01 '20 03:07 PacoBell

Any update on this? This seems like a basic feature in most video players now.

sherpajosh avatar Dec 08 '20 12:12 sherpajosh

Looks like no progress

Thewisem avatar Oct 17 '21 17:10 Thewisem

@Thewisem yes but there is already an issue open no need to have duplicates. Playback speed is on my todo but no time for now to make progress.

courville avatar Oct 17 '21 17:10 courville

FYI implementation in progress. It works using audiotrack setspeed on playbackparams and scaling avos stream parser timestamps. What is still nok: subs are not yet at audioSpeed and on the fly adjustment of the playback speed causes crashes.

courville avatar Aug 25 '22 18:08 courville

Updated status:

  • on the fly playback speed modification KO (causes JNI error not in the audio_interface_audiotrack_java:audiotrack_change_audio_speed)
  • when using shield on samsung soundbar, playback speed has no effect (just player as well) but AudioTrack PlaybackParams are correctly set (setSpeed ok)

courville avatar Sep 01 '22 17:09 courville

Update: on the fly playback is fixed but requires seeking to flush all previous timestamps and causes jump to closest iframe. It could be enhanced by waiting for the next iframe before applying the seek to not cause the time jump effect. Method to achieve this is to be found.

For soundbar problem issue happens when playing multichannel content only and adb shell dumpsys media.audio_flinger reveals that two audio output are created for some reasons cf. logs.zip. Workaround would be to downmix to stereo when changing playback speed (TBD).

Buffer wise in avos_mp_video.c a 2x increase is performed stream_set_buffer_size(video->s, 48). TBD: make it dynamic. And VIDEO_MINDATA_SIZE in stream.h might need to be doubled but would probably cause extra wait at video start using streaming.

courville avatar Sep 10 '22 09:09 courville