ffmpeg - How to increase speed of ffmpeg stream when running in cli assuming streaming over network
问题描述
I'd like to increase the speed of playback so that I can catch up to whatever the newest available audio packet is. Using PulseAudio on archlinux for server, client uses windows although that really shouldn't matter.
Server commands issued:
pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_s16le -ar 48000 -f s16le "udp://{LAN_IP_OF_CLIENT}:{PORT}"
Client command issued:
ffplay.exe -nodisp -ac 2 -acodec pcm_s16le -ar 48000 -analyzeduration 0 -probesize 32 -f u8 -i udp://0.0.0.0:{PORT}
Current setup is using pavucontrol to put the audio output to the pactl sink from firefox and just keeping the cli application running somewhere. Often times the network is slow, and the audio will grow an increasingly noticable lag behind whatever is onscreen. When I re-execute the commands on both server and client it catches up. If possible I'd like to keep up with whatever's being broadcast- I figure the simplest solution is to nudge the playback speed a little faster than audio is being sent over so that in the mid-long term it will fix itself.
If there's just a way to discard audio packets that aren't the newest ones and jump ahead when possible I'd prefer that as a solution- I know too little about ffmpeg to know if that's possible to do easily.
解决方案
不是一个理想的解决方案,但可以通过-filter:a "atempo:{speed_here}"
标志提高速度。
https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
仍然不知道如何从 cli 界面执行此操作。
推荐阅读
- javascript - 如何限制我的 node.js Swagger 服务器的堆栈跟踪?
- c# - 运行 MySql 存储过程的最低访问级别
- angular - 添加无线电时,FormGroup 立即更新无线电的 FormControl 值
- javascript - Express.js (Node.js) 中的 ECONNRESET 与多个请求
- size - 找出设备的块大小
- multithreading - 一个进程的线程并行执行
- assembly - AVR 汇编:将一个 16 位数字加载到两个 8 位寄存器中
- php - 使用php检查值是否是数组中唯一的东西
- java - 在我的网页上显示正确的信息。
- oracle - 在 Oracle SQL Insert 语句中返回自动增量值?