In this issue, we are making on video using ffmpeg commands .
Test data (Images and Audio) has been attached in the attachment of this issue.
TestImages.zip
Command is as follows:
ffmpeg -f image2 -framerate 1/5 -pattern_type glob -i '*.jpg' -i audio.mp3 -c:v libx264 -vf scale=480:360 -pix_fmt yuv420p -crf 30 out_30.mp4
After playing the video , we are changing playback speed using PlaybackParams API>=23. using below mentioned code.
speed = 12.0f
PlaybackParameters prevParam = mPlayer.getPlaybackParameters();
PlaybackParameters newParam = new PlaybackParameters(speed,prevParam.pitch);
After the execution of this code, we are giving 12.0f as input speed parameter but this API
onPlaybackParametersChanged is giving value 8.0f . Same is happening if we send 24.0f as input.
This issue is happening only if we make video with audio. If we make video without Audio, this is not happening. Correct playback speed is getting set.
Exoplayer version :-'com.google.android.exoplayer:exoplayer:2.6.0'
Please help.
Thanks
Sheetal Garg
ExoPlayer limits the maximum speedup to 8 internally when using built-in playback speed adjustment (see SonicAudioProcessor). See also the javadoc for Player.setPlaybackParameters which mentions that the actual speedup may differ from what's passed in.
Side note: ExoPlayer doesn't rely on platform functionality for changing the playback speed so you can use this before API 23.
Hello Andrew,
Thanks for your reply.
If we play the video without audio then we can reach to the speed of 24.0f . I mean we make video without audio using ffmpeg.
If we play video with audio then we can reach to the maximum speed of 8.0f which is our concern.
with your explanation, it means if a video has audio, exoplayer can reach maximum to the speed of 8.0x because of SonicAudioProcessor maximum speed limit . But if video does not have any Audio then SonicAudioProcessor does not come in to picture and it can reach to the level of 24.0f.
Please confirm
Thanks
Sheetal Garg
Yes, that's right. In the video-only case Sonic won't be used so the limit there won't apply.
This is very useful information for me. Thank you Andrew :)