jsmpeg
jsmpeg copied to clipboard
Video image is delayed
On some mobile devices, there is a delay in the video image. When the sound is finished, the video image is only played halfway.
My test phones:
- HuaWei Honor 7
- vivo X9S
I used this command
ffmpeg -i video.mp4 -f mpegts -b 1500k -s 960x540 -bf 0 -codec:v mpeg1video -codec:a mp2 video.ts
I try to modify the timestampIndex
and decodedTime
of the video decoder to the correct time, but it doesn't work.
I also try to use .seek(time)
to correct the video time, but the video image is messed up.
For example, play a .ts video in my local player:
Play the same file with .seek() on my phone:
set the "-force_key_frames" or"-g" to your ffmpeg command to custom "I frame" in .ts . seek the "I frame" time ( or set currentTIme to it ) will fix the problem in pic 2.
but not about delayed video image 😞
did you solve this problem, please let me know , i have the same problem now. thank you very much