ffmpeg-cli-wrapper
ffmpeg-cli-wrapper copied to clipboard
how to set payload_type
trafficstars
The question how to set payload_type and filter_complex . i use addExtraArgs to set it.but it return 'Unrecognized option'
Example ffmpeg command
ffmpeg -i rtmp://172.16.2.67:1935/live/livestream -vn -acodec pcm_alaw -payload_type 8 -filter_complex 'aresample=8000,asetnsamples=n=160' -ar 8000 -f rtp rtp://172.16.2.96:19132
What you have tried
FFmpegBuilder builder = new FFmpegBuilder()
.setInput("rtmp://172.16.2.67:1935/live/livestream")
.addOutput("rtp://127.0.0.1:19132")
.setFormat("rtp")
.disableVideo()
.setAudioCodec("pcm_alaw")
.setAudioSampleRate(8000)
.addExtraArgs("-payload_type 8")
.addExtraArgs("-filter_complex 'aresample=8000,asetnsamples=n=160'")
.done();
-payload_type 8 is encoded as a single argument. Split that into two, and it should work:
addExtraArgs("-payload_type").addExtraArgs("8")