ijkplayer icon indicating copy to clipboard operation
ijkplayer copied to clipboard

请问如何实现大于2倍数播放

Open idoit opened this issue 7 years ago • 8 comments

请问ios如何实现大于2倍数播放?

idoit avatar May 18 '17 06:05 idoit

see ffp_set_playback_rate

2017-05-18 14:07 GMT+08:00 邓军 [email protected]:

请问ios如何实现大于2倍数播放?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Bilibili/ijkplayer/issues/3115, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOmlv9cz_cAZcTianP-pWe5wiXmrrvyks5r6-AxgaJpZM4NexX3 .

raymond1012 avatar May 18 '17 06:05 raymond1012

ffp_set_playback_rate 这个不是只能是0.5到2倍之间吗?大于2倍的呢?

idoit avatar May 18 '17 06:05 idoit

考虑解码效率和网络速度,推荐小于2倍速而已

2017-05-18 14:31 GMT+08:00 邓军 [email protected]:

ffp_set_playback_rate 这个不是只能是0.5到2倍之间吗?大于2倍的呢?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Bilibili/ijkplayer/issues/3115#issuecomment-302313622, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOmlpYy0Imesgzr_lSiXSCOAa7mHGoeks5r6-W3gaJpZM4NexX3 .

raymond1012 avatar May 18 '17 06:05 raymond1012

但是我发现/*! @enum AudioQueueParameterID @abstract Constants that identify the parameters for audio queues. @discussion You can set a parameter in one of two ways:

    <ul>
    <li>    Assign a parameter value to an audio queue to take effect immediately using
            AudioQueueSetParameter.</li>
    <li>    Schedule a parameter to take effect when a buffer is enqueued. You supply the
            parameter when you queue a buffer, and the new value of the parameter is applied
            when that buffer is rendered.
    </ul>
    
    AudioQueueGetParameter always returns the current value of the parameter

@constant   kAudioQueueParam_Volume
    A value from 0.0 to 1.0 indicating the linearly scaled gain for the queue. A value of
    1.0 (the default) indicates unity gain. A value of 0.0 indicates zero gain, or silence.
@constant   kAudioQueueParam_PlayRate
    A value from 0.5 to 2.0 indicating the rate at which the queue is to play. A value of
    1.0 (the default) indicates that the queue should play at its normal rate. Only
    applicable when the time/pitch processor has been enabled and on Mac OS X 10.6 and higher.
@constant   kAudioQueueParam_Pitch
    A value from -2400 to 2400 indicating the number of cents to pitch-shift the queue's
    playback. (1200 cents is one octave.) Only applicable when the time/pitch processor has 
    been enabled with the spectral algorithm, and on Mac OS X 10.6 and higher.
@constant   kAudioQueueParam_VolumeRampTime
    A value indicating the number of seconds over which subsequent volume changes will be
    ramped. For example, to fade out from full unity gain to silence over the course of 1
    second, set kAudioQueueParam_VolumeRampTime to 1 then kAudioQueueParam_Volume to 0.
@constant   kAudioQueueParam_Pan
    A value from -1 to 1 indicating the pan position of a mono source (-1 = hard left, 0 =
    center, 1 = hard right). For a stereo source this parameter affects left/right balance.
    For multi-channel sources, this parameter has no effect.

*/ CF_ENUM(AudioQueueParameterID) { kAudioQueueParam_Volume = 1, kAudioQueueParam_PlayRate = 2, kAudioQueueParam_Pitch = 3, kAudioQueueParam_VolumeRampTime = 4, kAudioQueueParam_Pan = 13 };

idoit avatar May 18 '17 09:05 idoit

我忘记ios的限制了,你可以尝试用ijk里集成的第三方库soundtouch试试

2017-05-18 17:38 GMT+08:00 邓军 [email protected]:

但是我发现/*! @enum https://github.com/enum AudioQueueParameterID @abstract https://github.com/abstract Constants that identify the parameters for audio queues. @discussion https://github.com/discussion You can set a parameter in one of two ways:

<ul>
<li>    Assign a parameter value to an audio queue to take effect immediately using
        AudioQueueSetParameter.</li>
<li>    Schedule a parameter to take effect when a buffer is enqueued. You supply the
        parameter when you queue a buffer, and the new value of the parameter is applied
        when that buffer is rendered.
</ul>

AudioQueueGetParameter always returns the current value of the parameter

@constant kAudioQueueParam_Volume A value from 0.0 to 1.0 indicating the linearly scaled gain for the queue. A value of 1.0 (the default) indicates unity gain. A value of 0.0 indicates zero gain, or silence. @constant kAudioQueueParam_PlayRate A value from 0.5 to 2.0 indicating the rate at which the queue is to play. A value of 1.0 (the default) indicates that the queue should play at its normal rate. Only applicable when the time/pitch processor has been enabled and on Mac OS X 10.6 and higher. @constant kAudioQueueParam_Pitch A value from -2400 to 2400 indicating the number of cents to pitch-shift the queue's playback. (1200 cents is one octave.) Only applicable when the time/pitch processor has been enabled with the spectral algorithm, and on Mac OS X 10.6 and higher. @constant kAudioQueueParam_VolumeRampTime A value indicating the number of seconds over which subsequent volume changes will be ramped. For example, to fade out from full unity gain to silence over the course of 1 second, set kAudioQueueParam_VolumeRampTime to 1 then kAudioQueueParam_Volume to 0. @constant kAudioQueueParam_Pan A value from -1 to 1 indicating the pan position of a mono source (-1 = hard left, 0 = center, 1 = hard right). For a stereo source this parameter affects left/right balance. For multi-channel sources, this parameter has no effect.

*/ CF_ENUM(AudioQueueParameterID) { kAudioQueueParam_Volume = 1, kAudioQueueParam_PlayRate = 2, kAudioQueueParam_Pitch = 3, kAudioQueueParam_VolumeRampTime = 4, kAudioQueueParam_Pan = 13 };

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Bilibili/ijkplayer/issues/3115#issuecomment-302354002, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOmlsWS9TMelesvmehZcXkqiEiIPx-Vks5r7BGqgaJpZM4NexX3 .

raymond1012 avatar May 18 '17 09:05 raymond1012

3ks,但是那个库好像最大也是2倍 // Sets new rate control value. Normal rate = 1.0, smaller values // represent slower rate, larger faster rates. void SoundTouch::setRate(double newRate) { virtualRate = newRate; calcEffectiveRateAndTempo(); }

// Sets new rate control value as a difference in percents compared // to the original rate (-50 .. +100 %) void SoundTouch::setRateChange(double newRate) { virtualRate = 1.0 + 0.01 * newRate; calcEffectiveRateAndTempo(); }

idoit avatar May 19 '17 07:05 idoit

那就只能尝试参照vlc的音频处理修改ffmpeg

2017-05-19 15:26 GMT+08:00 邓军 [email protected]:

3ks,但是那个库好像最大也是2倍 // Sets new rate control value. Normal rate = 1.0, smaller values // represent slower rate, larger faster rates. void SoundTouch::setRate(double newRate) { virtualRate = newRate; calcEffectiveRateAndTempo(); }

// Sets new rate control value as a difference in percents compared // to the original rate (-50 .. +100 %) void SoundTouch::setRateChange(double newRate) { virtualRate = 1.0 + 0.01 * newRate; calcEffectiveRateAndTempo(); }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Bilibili/ijkplayer/issues/3115#issuecomment-302629926, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOmlqtFAWU24OiRngHuN6gu-nx2fzk_ks5r7UQTgaJpZM4NexX3 .

raymond1012 avatar May 19 '17 07:05 raymond1012

试用参照vlc的音频处理修改只能ffmpeg 2017-05-19 15:26 GMT+08:00 邓军 [email protected]: 3ks,但是那个库也好象2 // 设置的节拍值。节拍值= 1.0,正常的新周期 //代表较慢的节拍倍数,较快的速度。= 新率;calcEffectiveRateAndTempo(); } // 将新的震荡控制设置为与胎动的不同值差异 (-50 .. +100 %) void SoundTouch::setRateChange(double newRate) { virtualRate = 1.0 + 0.01 * newRate; calcEffectiveRateAndTempo(); } — 您收到此邮件是您发表了评论。直接在 GitHub 上查看< #3115(因为消息评论,或将线程评论)< https://github.com/notifications/unsubscribe-auth/ AEOmlqtFAWU24OiRngHuN6gu-nx2fzk_ks5r7UQTgaJpZM4Nex33 > 。

大佬,大于两倍速的播放速度有没有新的解决方案

liangdongbo avatar Apr 24 '22 12:04 liangdongbo

你可以尝试使用libsonic这个库去提高倍速

dylanZk1 avatar Dec 26 '22 00:12 dylanZk1