Raw H264 frames in mpegts container using libavcodec

I believe if you set the following, you will see video playback. packet.flags |= AV_PKT_FLAG_KEY; packet.pts = packet.dts = 0; You should really set packet.flags according to the h264 packet headers. You might try this fellow stack overflowian’s suggestion for extracting directly from the stream. If you are also adding audio, then pts/dts is going … Read more

How to reduce latency in MediaCodec video/avc decoding

I think you’re seeing some effects unique to the first frame. I repeated your experiment, with the further addition of forcing doRender = false around line 244 to avoid the sleep calls used to manage the output frame rate. I see: 01-29 14:05:36.552 9115 9224 I Grafika : queueInputBuffer index/pts, 2,0 01-29 14:05:36.562 9115 9224 … Read more

h264 lossless coding

I am going to add a late answer to this one after spending all day trying to figure out how to get YUV 4:4:4 pixels into x264. While x264 does accept raw 4:2:0 pixels in a file, it is really quite difficult getting 4:4:4 pixels passed in. With recent versions of ffmpeg, the following works … Read more

Use FFMPEG on Android [closed]

You have two options: use ffmpeg api – google ffmpeg sample code. this requires good understanding of the api and which is very comprehnsive. compile ffmpeg.c and invoke its main() via jni. This requires that you understand the command line parameters. It is rather cumbersome but works. You need to look out for the static … Read more

MediaCodec and Camera: colorspaces don’t match

I solved it by swapping the byteplanes myself on Android level, using a simple function: public byte[] swapYV12toI420(byte[] yv12bytes, int width, int height) { byte[] i420bytes = new byte[yv12bytes.length]; for (int i = 0; i < width*height; i++) i420bytes[i] = yv12bytes[i]; for (int i = width*height; i < width*height + (width/2*height/2); i++) i420bytes[i] = yv12bytes[i … Read more

How to process raw UDP packets so that they can be decoded by a decoder filter in a directshow source filter

Peace of cake! 1. Get the data As I can see, you already know how to do that (start RTSP session, SETUP a RTP/AVP/UDP;unicast; transport, and get user datagrams)… but if you are in doubt, ask. No matter the transport (UDP or TCP) the data format is mainly the same: RTP data: [RTP Header – … Read more

techhipbettruvabetnorabahisbahis forumu