h.264

H264 NAL unit prefixes

你说的曾经没有我的故事 提交于 2019-11-30 07:39:19
I need some clarification on H264 NAL unit delimiter prefixes ( 00 00 00 01 and 00 00 01 ), I am using Intel Media SDK to generate a H264 and pack it into RTP. The issue is that so far I was looking only for 00 00 00 01 as a unit separator and basically was able to find only AUD,SPS,PPS and SEI units in the bitstream. Looking at the memory I saw that after the SEI there was a byte sequence 00 00 01 25 that could be a start of an IDR unit, but my search algorithm did not detect it because of a missing zero byte. Can anyone clarify the difference between 00 00 00 01 and 00 00 01 prefixes?

h264 RTP timestamp

天涯浪子 提交于 2019-11-30 07:34:01
I have a confusion about the timestamp of h264 RTP packet. I know the wall clock rate of video is 90KHz which I defined in the SIP SDP. The frame rate of my encoder is not exactly 30 FPS, it is variable. It varies from 15 FPS to 30 FPS on the fly. So, I cannot use any fixed timestamp. Could any one tell me the timestamp of the following encoded packet. After 0 milisecond encoded RTP timestamp = 0 (Let the starting timestamp 0) After 50 milisecond encoded RTP timestamp = ? After 40 milisecond encoded RTP timestamp = ? After 33 milisecond encoded RTP timestamp = ? What is the formula when the

How to use Android MediaCodec encode Camera data(YUV420sp)

吃可爱长大的小学妹 提交于 2019-11-30 06:51:17
Thank you for your focus! I want to use Android MediaCodec APIs to encode the video frame which aquired from Camera, unfortunately, I have not success to do that! I still not familiar with the MediaCodec API。 The follow is my codes,I need your help to figure out what I should do. 1、The Camera setting: Parameters parameters = mCamera.getParameters(); parameters.setPreviewFormat(ImageFormat.NV21); parameters.setPreviewSize(320, 240); mCamera.setParameters(parameters); 2、Set the encoder: private void initCodec() { try { fos = new FileOutputStream(mVideoFile, false); } catch (FileNotFoundException

Error code -8969, -12909 while decoding h264 in iOS 8 with video tool box

徘徊边缘 提交于 2019-11-30 06:50:44
I have the h264 stream inAnnex B format and follow this link here to implements h264 decoding with iOS8 videoToolBox. I check the OSStatus in every step. use CMVideoFormatDescriptionCreateFromH264ParameterSets with the SPS and PPS data to create a CMFormatDescription.(status == noErr) create a VTDecompressionSession using VTDecompressionSessionCreate. (status == noErr) capture the NALUnit payload into a CMBlockBuffer making sure to replace the start code with a byte length code. (status == noErr) create a CMSampleBuffer. (status == noErr) use VTDecompressionSessionDecodeFrame and get error

Why decoding frames from avi container and encode them to h264/mp4 doesn't work?

爷,独闯天下 提交于 2019-11-30 05:29:58
问题 I started using ffmpeg and I want to convert avi file to mp4/h264 file. I've read many posts including this, but I couldn't find any good example how to save frames to mp4 file. The code below is simplified one that decodes frames from avi file and encode it to H264/mp4 file, but when I save the frames the mp4 file cannot be played. I think I do somethinkg wrong in encoding I will appreciate if you could tell me what is wrong and how to fix it. const char* aviFileName = "aviFrom.avi"; const

Select H264 Profile when encoding with MediaCodec and MTK Codec

爷,独闯天下 提交于 2019-11-30 05:27:08
问题 We have an Android app that encodes video into H264. On all previously tried Android devices this encodes to Baseline profile which is what I need. On the Lenovo Yoga 10 the codec is OMX.MTK.VIDEO.ENCODER.AVC. This encodes the video as High Profile which gives a problem for the receiving device. I am using MediaCodec. There seems to be no way to set the profile to be used. Is there any way of doing this ? The codec does claim to support Baseline profile but gives no way of using it. Is there

Using jcodec SequenceEncoder

你。 提交于 2019-11-30 05:19:38
I need to create video from images, I have seen jcodec and I think it is what I need: http://jcodec.org/ How do I add jcodec to my project? I have seen there is a version for android. Correct me if I am wrong, but I added jcodec-0.1.5.jar to my project under the libs folder. Then added SequenceEncoder.java and BitmapUtil.java from jcodec-android-0.1.7.zip to my package but when I add: public void encodeImage(Bitmap bi) throws IOException { encodeNativeFrame(BitmapUtil.fromBitmap(bi)); } It gives me error on package com.example.seqtest and asks me to configure build path. So how I use it, How

Xuggler encoding and muxing

与世无争的帅哥 提交于 2019-11-30 05:16:09
I'm trying to use Xuggler (which I believe uses ffmpeg under the hood) to do the following: Accept a raw MPJPEG video bitstream (from a small TTL serial camera) and encode/transcode it to h.264; and Accept a raw audio bitsream (from a microphone) and encode it to AAC; then Mux the two (audio and video) bitsreams together into a MPEG-TS container I've watched/read some of their excellent tutorials, and so far here's what I've got: // I'll worry about implementing this functionality later, but // involves querying native device drivers. byte[] nextMjpeg = getNextMjpegFromSerialPort(); // I'll

How to fragment H264 Packets in RTP compliant with RFC3984

不打扰是莪最后的温柔 提交于 2019-11-30 05:10:20
I have the FFMPEG streaming baseline h264 video, which I have to encapsulate in RTP and send to SIP phones for their decoding. I am using Linphone with the h264 plugin for Windows and Mirial for the decoding progress. However, sometimes I get a huge frame size (3Kb ~ 9Kb) from the FFMPEG, which obviously doesn't fit in the MTU. If I send these frames "as is" and trusting IP fragmentation feature, some phones are able to play it well enough, but others choke and can't decode the stream. I think this is because the stream is not compliant with the RFC 3984 that specifies that packets that don't

h264 inside AVI, MP4 and “Raw” h264 streams. Different format of NAL units (or ffmpeg bug)

二次信任 提交于 2019-11-30 04:56:45
问题 TL;DR: I want to read raw h264 streams from AVI/MP4 files, even broken/incomplete. Almost every document about h264 tells me that it consists of NAL packets. Okay. Almost everywhere told to me that the packet should start with a signature like 00 00 01 or 00 00 00 01 . For example, https://stackoverflow.com/a/18638298/8167678, https://stackoverflow.com/a/17625537/8167678 The format of H.264 is that it’s made up of NAL Units, each starting with a start prefix of three bytes with the values