h.264

Change h.264 quality when using SinkWriter to encode video

那年仲夏 提交于 2019-12-06 04:24:29
I am using Microsoft Media Foundation to encode a H.264 video file. I am using the SinkWriter to create the video file. The input is a buffer ( MFVideoFormat_RGB32 ) where I draw the frames and the output is a MFVideoFormat_H264 . The encoding works and it creates a video file with my frames in it. But I want to set the quality for that video file. More specifically, I want to set the CODECAPI_AVEncCommonQuality property on the H.264 encoder. In order to get a handle to the H.264 encoder, I call GetServiceForStream on the SinkWriter. Then I set the CODECAPI_AVEncCommonQuality property. The

Parsing h.264 NAL units from a quicktime MOV file

心不动则不痛 提交于 2019-12-06 04:23:27
问题 I'm trying to get h.264 NAL units from a MOV file on the iPhone, in order to RTP h.264 video from the iPhone camera to a server. Apple's API does not allow direct access to the encoded bitstream from the camera output, so I can only access the MOV file, while it's being written. I've parsed the MOV file into Atoms , according to Apple's MOV structure reference but now i need to extract the NAL units from the mdat atom in order to pack it to RTP and stream it. I'd be glad for some help here

Embedding HTML5 video for Mobile Safari on an iPhone 3GS vs an iPhone 4

蓝咒 提交于 2019-12-06 04:03:22
问题 I have an H.264/AAC encoded video in an mp4 file on the server, the mime-type video/mp4 is added to the web server (IIS 7), and I have a page with a video tag: <video id="html5-video" width="360" height="202" poster="/images/poster.png" controls> <source src="/video/Web-360x202-14MB.mp4" type="video/mp4"> </video> Works great on an iPhone 4, but on an iPhone 3GS (same iOS version, 4.3.2) is only shows the poster image and tapping it doesn't start the video. When I try to open the video file

H264 Video Streaming over RTMP on iOS

倾然丶 夕夏残阳落幕 提交于 2019-12-06 03:04:45
With a bit of digging, I have found a library that extracts NAL units from .mp4 file while it is being written. I'm attempting to packetize this information to flv over RTMP using libavformat and libavcodec . I setup a video stream using: -(void)setupVideoStream { int ret = 0; videoCodec = avcodec_find_decoder(STREAM_VIDEO_CODEC); if (videoCodec == nil) { NSLog(@"Could not find encoder %i", STREAM_VIDEO_CODEC); return; } videoStream = avformat_new_stream(oc, videoCodec); videoCodecContext = videoStream->codec; videoCodecContext->codec_type = AVMEDIA_TYPE_VIDEO; videoCodecContext->codec_id =

Is there any easy way to extract h.264 raw stream in annexb format?

萝らか妹 提交于 2019-12-06 02:31:31
问题 When I extract video stream with ffmpeg using command-line: ffmpeg -i {some file} -vcodec copy -an -f {rawvideo|h264|whatever} out.h264 with some media files produced by Adobe Media Encoder, only .m4v (encoded as h.264 blu-ray) files can produce some usable results. Some other format(like .f4v) can produce h.264 stream, but without PPS/SPS, and each slice starts with size instead of 00 00 00 01 sequence. I wish I can extract annexb format raw streams from as many as possible files that

Decode h264 video stream to get image buffer

佐手、 提交于 2019-12-06 02:23:17
I followed this post to decode my h264 video stream frames. My data frames as bellow: My code: NSString * const naluTypesStrings[] = { @"0: Unspecified (non-VCL)", @"1: Coded slice of a non-IDR picture (VCL)", // P frame @"2: Coded slice data partition A (VCL)", @"3: Coded slice data partition B (VCL)", @"4: Coded slice data partition C (VCL)", @"5: Coded slice of an IDR picture (VCL)", // I frame @"6: Supplemental enhancement information (SEI) (non-VCL)", @"7: Sequence parameter set (non-VCL)", // SPS parameter @"8: Picture parameter set (non-VCL)", // PPS parameter @"9: Access unit delimiter

Encode a video into h264 using bufferedimages?

情到浓时终转凉″ 提交于 2019-12-06 02:11:56
问题 Im attempting to translate a large set of bufferedimages (pre-saved images created on the fly by my application) into a video using java and hopefully a library that can help with the process. I've explored a number of different options, such as jcodec (there was no documentation on how to use it). Xuggler (couldn't get it to run due to compatibility issues with jdk5 and its related libraries). and a number of other libraries that had very poor documentation. I'm trying to find a library that

Using AVAssetWriter with raw NAL Units

随声附和 提交于 2019-12-05 21:21:17
问题 I noticed in the iOS documentation for AVAssetWriterInput you can pass nil for the outputSettings dictionary to specify that the input data should not be re-encoded. The settings used for encoding the media appended to the output. Pass nil to specify that appended samples should not be re-encoded. I want to take advantage of this feature to pass in a stream of raw H.264 NALs, but I am having trouble adapting my raw byte streams into a CMSampleBuffer that I can pass into AVAssetWriterInput's

How do I convert an h.264 stream to MP4 using ffmpeg and pipe the result to the client?

依然范特西╮ 提交于 2019-12-05 19:04:13
I have an h.264 encoded stream of video on my server (node.js) and I want to use ffmpeg to convert it to an MP4 stream. Then I want to pipe that MP4 stream from the child process to the client using the response of an HTTP server that I have set up. I am very confused about all the options ffmpeg has and not sure how to pipe the output of the child process to the HTTP response. I have tried several combinations of ffmpeg options but the video does not play in the browser (or show any sign of receiving data) and I don't know if I am converting it to MP4 corretly. I am also not sure I am piping

ffmpeg: make a copy from a decoded frame (AVFrame)

最后都变了- 提交于 2019-12-05 18:59:35
I want to make a backup frame (AVFrame) from a special frame(let's say pic ). So, I have written AVFrame* bkf = avcodec_alloc_frame(); memcpy(bkf,pic,sizeof(AVFrame)); bkf->extended_data = pic->extended_data; bkf->linesize[0] = pic->linesize[0]; memcpy(bkf->data, pic->data, sizeof(pic->data)); bkf->reordered_opaque = pic->reordered_opaque; bkf->sample_rate = pic->sample_rate; bkf->channel_layout = pic->channel_layout; bkf->pkt_pts = pic->pkt_pts; bkf->pkt_pos = pic->pkt_pos; bkf->width = pic->width; bkf->format = pic ->format; to copy pic to bkf . But after running, I saw a lot of distortion.