jsmpeg icon indicating copy to clipboard operation
jsmpeg copied to clipboard

Video image is delayed

Open TevinLi opened this issue 6 years ago • 2 comments

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

TevinLi avatar Jan 12 '19 07:01 TevinLi

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 😞

pricelesss avatar Jan 31 '19 16:01 pricelesss

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

luohuan avatar Apr 22 '19 12:04 luohuan