samirkumardas / jmuxer

jMuxer - a simple javascript mp4 muxer that works in both browser and node environment.
Other
555 stars 112 forks source link

Why can't change frame? #4

Closed hahashigehaha closed 6 years ago

hahashigehaha commented 6 years ago

my websocket is raw h264 frame data,only show first frame,but can't show the back of the frame?

samirkumardas commented 6 years ago

Look likes you haven't provided timing information properly.

Do you have fixed frame rate?

Can you share your code?

hahashigehaha commented 6 years ago

ok. i say again. My data is the native H264 encoding data of the frame screen. When I play it with your library, I can only display the first frame, and the rear picture can't be parsed. There are continuous data, but they do not show, freeze frames in the first frame.

Forgive me for my poor English...

samirkumardas commented 6 years ago

Yes I understood your case. It basically happens whenever you don't provide timing information.

Let me explain little. Assume you are making a h264 player so what would be the barefoot steps:

  1. Making a frame from h264 data (Ignoring details)
  2. Then play that frame( aka picture) for some time before second frame come to play. But how long? Basically it depends on timing information. You can provide timing in two ways in jMuxer. Either you can set fps value while instantiating Or you can provide duration when you feed media data.

Example:

During instantiation -- You must provide a fps (frame per second) value

var jmuxer = new JMuxer({ node: 'player', fps: 24, debug: false });

During Feed (You can provide chunk duration in mili-seconds either)

jmuxer.feed({ audio: audioData, video: videoData, duration: 500 });

Hope this helps you!

hahashigehaha commented 6 years ago

sorry,it can't work!

hahashigehaha commented 6 years ago

it's work. because i forget to call play .