phoboslab / jsmpeg

MPEG1 Video Decoder in JavaScript
MIT License
6.34k stars 1.43k forks source link

Video image is delayed #267

Open TevinLi opened 5 years ago

TevinLi commented 5 years ago

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:


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: _20190114173426 Play the same file with .seek() on my phone: _20190114172906

pricelesss commented 5 years ago

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 😞

luohuan commented 5 years ago

did you solve this problem, please let me know , i have the same problem now. thank you very much