h.264

MediaCodec createInputSurface

做~自己de王妃 提交于 2020-01-02 02:02:13
问题 I want to use MediaCodec to encode a Surface into H.264. With API 18, there is a way to encode content from a surface by calling createInputSurface() and then drawing on that surface. I get IllegalStateException on createInputSurface(). Here's additional logcat output: D/H264Encoder(17570): MediaFormat: {frame-rate=25, bitrate=1000000, height=600, mime=video/avc, color-format=19, i-frame-interval=75, width=800} D/NvOsDebugPrintf( 125): NvMMLiteOpen : Block : BlockType = 4 D/NvOsDebugPrintf(

H.264 (or similar) encoder in C#?

╄→гoц情女王★ 提交于 2020-01-01 08:53:32
问题 Does anyone know of an open source H.264 encoder in C# (or any other managed language)? I might be able to make do with a python implementation as well. The libraries that I’ve found (e.g. x264) are written in pretty low level c (procedural with lots of macros) and assembly. Tweaking them is turning out to be far more complex than I'd thought. My project has no concern for performance or compatibility. We just want to test how some ideas will impact the perception of the outputted video. We’d

MediaCodec Video Streaming From Camera wrong orientation & color

早过忘川 提交于 2020-01-01 03:44:47
问题 I'm trying to stream video capturing directly from camera for android devices. So far I have been able to capture each frame from android camera's onPreviewFrame (byte[] data, Camera camera) function, encode the data & then successfully decode the data and show to the surface. I used android's MediaCodec for the encoding & decoding. But the color & the orientation of the video is not correct [ 90 degree rotated ]. After searching a while I have found this YV12toYUV420PackedSemiPlanar function

Decode android's hardware encoded H264 camera feed using ffmpeg in real time

孤街醉人 提交于 2020-01-01 01:11:08
问题 I'm trying to use the hardware H264 encoder on Android to create video from the camera, and use FFmpeg to mux in audio (all on the Android phone itself) What I've accomplished so far is packetizing the H264 video into rtsp packets, and decoding it using VLC (over UDP ), so I know the video is at least correctly formatted. However, I'm having trouble getting the video data to ffmpeg in a format it can understand. I've tried sending the same rtsp packets to a port 5006 on localhost (over UDP),

Decoding h264 in iOS 8 with video tool box

时光怂恿深爱的人放手 提交于 2019-12-31 12:09:21
问题 Need to decode h264 stream and get the pixel buffers I know its possible with video tool box on iOS 8 1.How do I convert the h264 stream to CMSampleBufferRef ? 2.How do I use the video tool box to decode? 回答1: I assume you get the stream in Annex B format, if it is already in AVCC format (read MP4), then you can you the AssetReader and do not need to do much. For an Annex B stream (this is what ppl. often call raw h264 stream). extract SPS/PPS NAL units and create a parameter set from then.

Decoding h264 in iOS 8 with video tool box

▼魔方 西西 提交于 2019-12-31 12:09:17
问题 Need to decode h264 stream and get the pixel buffers I know its possible with video tool box on iOS 8 1.How do I convert the h264 stream to CMSampleBufferRef ? 2.How do I use the video tool box to decode? 回答1: I assume you get the stream in Annex B format, if it is already in AVCC format (read MP4), then you can you the AssetReader and do not need to do much. For an Annex B stream (this is what ppl. often call raw h264 stream). extract SPS/PPS NAL units and create a parameter set from then.

H264 profile-iop explained

跟風遠走 提交于 2019-12-30 19:58:33
问题 Identify h264 profile and level from profile-level-id in sdp? How does one identify what the constraints actually mean? For example I have a profile-type-id: 42801e that translates to: How am I to relate that to the features defined in the table here? The above reference identified that the Constraint_set0_flag: 1 means that it's the Constrained Baseline Profile . But how to relate the flag to the three different NO's (from the table) that differentiate the Baseline profile from the

Media Foundation IMFSinkWriter::Finalize() method fails under Windows 7 when muxing H.264 frames into MP4

不问归期 提交于 2019-12-30 11:10:47
问题 I'm writing a tool in C# that muxes H.264 frames into MP4 files, and I'm using Media Foundation's media sink with sink writer to do this. Things work pretty well under Win8, but under Windows 7 the same code throws an exception, HResult: 0xC00D36E6 (MF_E_ATTRIBUTENOTFOUND), when invoking sink writer's Finalize method. As a result, the generated MP4 file is not properly closed, and is (of course) not playable. The mftrace log shows that the failure under Windows 7 occurs somewhere after (or

Re-encoding h.264 content with a different bit rate using Android MediaCodec

烂漫一生 提交于 2019-12-30 03:30:17
问题 I'm attempting to re-encode a h.264 mp4 file with a different bit rate using the Android MediaCodec API's introduced in 4.2. I am able decode and play the content (prior to changing the bit rate) using the MediaCodec API but if I attempt to re-encode the content with a different bit rate prior to decoding it I get garbled out put (a green screen with grey pixelation). The code I am using is based on the Android Test Case android.media.cts.DecoderTest Android Test Case android.media.cts

FFmpeg c++ H264 decoding error

心已入冬 提交于 2019-12-29 01:58:45
问题 I have a program which capture video from webcam, encode with ffmpeg, encoded packet then write to buffer. At the receiver side, read from buffer decode with ffmpeg and play. Now I merge sender and receiver in one program for testing. It works fine with AV_CODEC_ID_MPEG1VIDEO, but when I change the ffmpeg codec to AV_CODEC_ID_H264, at the decoding progress, it shows error: The whole program is here FYI, I made a loop to let the whole progress run twice. What is the cause of the error, is