h.264

Live streaming through MP4

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 15:25:59
问题 I am working on an online TV service. One of the goals is for the video to be played without any additional browser plug-ins (except for Flash). I decided to use MP4, because it is supported by the majority of HTML5 browsers and by Flash (for fallback). The videos are transcoded from ASF on a server by FFMpeg. However, I found that MP4 cannot be live-streamed because it has a moov atom for metadata that has to specify the length. FFMpeg cannot directly stream mp4 to stdout, because it puts

How to encode Bitmaps into a video using MediaCodec?

本秂侑毒 提交于 2019-11-26 15:17:18
问题 I would like to encode a set of Bitmaps that I have into an h264. Is this possible via MediaEncoder? I have written some code in order to do it, but the output cannot be played in any media player I have tried. Here's some of the code that I primarily borrowed from other sources that I found on Stackoverflow. mMediaCodec = MediaCodec.createEncoderByType("video/avc"); mMediaFormat = MediaFormat.createVideoFormat("video/avc", 320, 240); mMediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 125000);

FFMPEG (libx264) “height not divisible by 2”

人盡茶涼 提交于 2019-11-26 14:53:07
I am trying to encode a .mp4 video from a set of frames using FFMPEG using the libx264 codec. This is the command I am running: /usr/local/bin/ffmpeg -r 24 -i frame_%05d.jpg -vcodec libx264 -y -an video.mp4 I sometimes get the following error: [libx264 @ 0xa3b85a0] height not divisible by 2 (520x369) After searching around a bit it seems that the issue has something to do with the scaling algorithm and can be fixed by adding a -vf argument. However, in my case I don't want to do any scaling. Ideally, I want to keep the dimensions exactly the same as the frames. Any advice? Is there some sort

MediaCodec and Camera: colorspaces don't match

試著忘記壹切 提交于 2019-11-26 14:16:29
I have been trying to get H264 encoding to work with input captured by the camera on an Android tablet using the new low-level MediaCodec . I have gone through some difficulties with this, since the MediaCodecAPI is poorly documented, but I've gotten something to work at last. I'm setting up the camera as follows: Camera.Parameters parameters = mCamera.getParameters(); parameters.setPreviewFormat(ImageFormat.YV12); // <1> parameters.setPreviewFpsRange(4000,60000); parameters.setPreviewSize(640, 480); mCamera.setParameters(parameters); For the encoding part, I'm instantiating the MediaCodec

How to use MediaCodec without MediaExtractor for H264

倾然丶 夕夏残阳落幕 提交于 2019-11-26 12:38:00
问题 I need to use MediaCodec without the MediaExtractor and I\'m reading the file using a FileInputStream. Currently it is not working, it is showing a greenish scrambled image on the screen. This is the whole source code: FileInputStream in = new FileInputStream(\"/sdcard/sample.ts\"); String mimeType = \"video/avc\"; MediaCodec decoder = MediaCodec.createDecoderByType(mimeType); MediaFormat format = MediaFormat.createVideoFormat(mimeType, 1920, 1080); byte[] header_sps = { 0, 0, 0, 1, 103, 100,

How does one encode a series of images into H264 using the x264 C API?

流过昼夜 提交于 2019-11-26 12:01:41
How does one use the x264 C API to encode RBG images into H264 frames? I already created a sequence of RBG images, how can I now transform that sequence into a sequence of H264 frames? In particular, how do I encode this sequence of RGB images into a sequence of H264 frame consisting of a single initial H264 keyframe followed by dependent H264 frames? KillianDS First of all: check the x264.h file, it contains more or less the reference for each function and structure. The x264.c file you can find in the download contains a sample implementation. Most people say to base yourself on that one,

Decoding Raw H264 stream in android?

北城以北 提交于 2019-11-26 11:50:10
问题 I have a project where I have been asked to display a video stream in android, the stream is raw H.264 and I am connecting to a server and will receive a byte stream from the server. Basically I\'m wondering is there a way to send raw bytes to a decoder in android and display it on a surface? I have been successful in decoding H264 wrapped in an mp4 container using the new MediaCodec and MediaExtractor API in android 4.1, unfortunately I have not found a way to decode a raw H264 file or

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

蹲街弑〆低调 提交于 2019-11-26 10:12:53
Long Story: There is an H264/MPEG-4 Source I can able to connect this source with RTSP protocol. I can able to get raw UDP packets with RTP protocol. Then send those raw UDP packets to a Decoder[h264/mpeg-4] [DS Source Filter] But those "raw" UDP packets can not be decoded by the Decoder[h264/mpeg-4] filter Shortly: How do I process those raw UDP data in order to be decodable by H264/ MPEG-4 decoder filter? Can any one clearly identify steps I have to do with H264/MPEG stream? Extra Info: I am able to do this with FFmpeg... But I can not really figure out how FFmpeg processes the raw data so

How to enable H264 support in CEF3 latest version ?

不想你离开。 提交于 2019-11-26 09:46:12
问题 I have known that cef3\'s older version like 2623 can enable H264 support through modify chromium\\src\\cef\\cef.gypi file. But in recent versions like 3071 or 3029, cef3 has removed cef.gypi file. I have googled this, but what I found is still through modify the cef.gypi file. Since this methold is only valid for older versions. Is there another way that I can make newer version enable H264 support ? Thanks very much! 回答1: Indeed the compile option to support proprietary codecs was moved.

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

血红的双手。 提交于 2019-11-26 08:50:42
问题 Long Story: There is an H264/MPEG-4 Source I can able to connect this source with RTSP protocol. I can able to get raw UDP packets with RTP protocol. Then send those raw UDP packets to a Decoder[h264/mpeg-4] [DS Source Filter] But those \"raw\" UDP packets can not be decoded by the Decoder[h264/mpeg-4] filter Shortly: How do I process those raw UDP data in order to be decodable by H264/ MPEG-4 decoder filter? Can any one clearly identify steps I have to do with H264/MPEG stream? Extra Info: I