Question

Je dois flux vidéo split mpeg4 (en fait de la caméra vidéo android) pour l'envoyer par RTP. La spécification est peu importante pour une référence rapide.

Je me demande s'il un exemple / code open source pour mpeg4 packetization?

Merci pour toute aide!

Était-ce utile?

La solution

Mpeg4 file format is also called ISO/IEC 14496-14. Google it any you will find specifications. However, what you are trying to do (RTP publisher) will be hard for the following reasons:

  1. Mpeg4 has header at the end of the file. Which means header will be written out only when video stream is finished. Since you want to do real time video streaming you will need to guess where audio and video packets start/end. This will not be the same on all Android devices as they might use different video sizes and codec parameters. So your code will be device-dependent and you'll need to support and test many different devices.

  2. Some devices do not flush video data to file in regular intervals. Some only flush once a minute or so. This will break your real-time stream.

  3. There is no example code. I know because I looked. There are a few companies that do something similar, but mainly they skip RTP. Instead they progressively upload the file to their own server and then implement video/audio stream "chopping" and then insert it into their video/transcoder backend. I used to work for one of those companies and that's how we did it. AFAIK competition took similar approaches. The upside is that all complexity is on server an you do not need to update clients when something breaks or new devices arrive on the market.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top