h.264

ffmpeg decoding slow calling without avformat_find_stream_info

蹲街弑〆低调 提交于 2021-02-08 00:19:43
问题 I am decoding h264 rtp stream with ffmpeg on android. I found a strange problem: if I don't call avformat_find_stream_info ,decoding P frame takes tens of micro seconds, by contrast, calling avformat_find_stream_info before decoding will reduce P frame decoding time to less than 1 ms on average. However, avformat_find_stream_info itself is time consuming on network streams. Are there anything I can do to make decoding fast without calling avformat_find_stream_info ? 回答1: When avformat_find

h264 ffmpeg: How to initialize ffmpeg to decode NALs created with x264

笑着哭i 提交于 2021-02-07 10:58:58
问题 I have encoded some frames using x264, using x264_encoder_encode and after that I have created AVPackets using a function like this: bool PacketizeNals( uint8_t* a_pNalBuffer, int a_nNalBufferSize, AVPacket* a_pPacket ) { if ( !a_pPacket ) return false; a_pPacket->data = a_pNalBuffer; a_pPacket->size = a_nNalBufferSize; a_pPacket->stream_index = 0; a_pPacket->flags = AV_PKT_FLAG_KEY; a_pPacket->pts = int64_t(0x8000000000000000); a_pPacket->dts = int64_t(0x8000000000000000); } I call this

MPEG-TS H.264 with ExoPlayer

坚强是说给别人听的谎言 提交于 2021-02-07 07:36:34
问题 I have two mpeg-ts + h.264 video files, which I attempt to read on an Android device (Samsung Tab A 10.1") with ExoPlayer: SimpleExoPlayerView view = new SimpleExoPlayerView(this); TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveVideoTrackSelection.Factory(new DefaultBandwidthMeter()); TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory); SimpleExoPlayer mediaPlayer = ExoPlayerFactory.newSimpleInstance(this, trackSelector, new DefaultLoadControl()

No decoder available for type 'video/x-h264

隐身守侯 提交于 2021-02-07 06:25:09
问题 I am trying to run one of qt sample apps without any modification. It is called player and it is a multimedia widget demonstration. My system is Ubuntu 16.04 64bit. When I try to play a video, I see the following error in the console: No decoder available for type 'video/x-h264 Here is the full error after trying two different videos: Starting /home/aras/Qt5.7.0_Sept2016/Examples/Qt-5.7/multimediawidgets/build-player-Sept2016-Debug/player... Warning: "No decoder available for type 'video/x

Encoding H.264 CBR videos with FFmpeg

主宰稳场 提交于 2021-02-06 02:36:46
问题 I'm trying to encode a video with ffmpeg into H.264 (via the libx264 library) with a constant bit rate. I know, I know, VBR is often preferred, but for this specific job I'm required to use CBR (just as long as it's so many kilobytes per second; it doesn't have to be an exact kilobytes per frame, afaik). My sample video I'm using to test is from here: http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iTunes.mov.zip (it comes from http:/

Encoding H.264 CBR videos with FFmpeg

∥☆過路亽.° 提交于 2021-02-06 02:33:47
问题 I'm trying to encode a video with ffmpeg into H.264 (via the libx264 library) with a constant bit rate. I know, I know, VBR is often preferred, but for this specific job I'm required to use CBR (just as long as it's so many kilobytes per second; it doesn't have to be an exact kilobytes per frame, afaik). My sample video I'm using to test is from here: http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iTunes.mov.zip (it comes from http:/

Given a constant frame rate H.264 MP4, how to get PTS rounding method used during encoding using ffmpeg?

ぃ、小莉子 提交于 2021-01-29 07:39:13
问题 ffmpeg can convert the video to specified constant frame rate. It has round parameter to specify timestamp(PTS) rounding method. It could be zero , int , down , up and near . Given a constant frame rate H.264 mp4 video, how can we determine which PTS rounding method was used to encode this video? 来源: https://stackoverflow.com/questions/63956476/given-a-constant-frame-rate-h-264-mp4-how-to-get-pts-rounding-method-used-durin

Given a constant frame rate H.264 MP4, how to get PTS rounding method used during encoding using ffmpeg?

耗尽温柔 提交于 2021-01-29 07:35:37
问题 ffmpeg can convert the video to specified constant frame rate. It has round parameter to specify timestamp(PTS) rounding method. It could be zero , int , down , up and near . Given a constant frame rate H.264 mp4 video, how can we determine which PTS rounding method was used to encode this video? 来源: https://stackoverflow.com/questions/63956476/given-a-constant-frame-rate-h-264-mp4-how-to-get-pts-rounding-method-used-durin

How to get width and height from the H264 SPS using ffmpeg

别说谁变了你拦得住时间么 提交于 2021-01-27 17:23:09
问题 I am trying to initialize an FFMPEG H264 codec context filling the extradata field with the SPS frame like this : #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> int main() { const char sps[] = {0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x0a, 0xf8, 0x41, 0xa2}; av_register_all(); av_log_set_level(AV_LOG_DEBUG); AVCodec *const codec = avcodec_find_decoder(CODEC_ID_H264); if (codec != NULL) { AVCodecContext* ctx = avcodec_alloc_context3(codec); ctx->debug = ~0; ctx->extradata

How do I encode KLV packets to an H.264 video using libav*

只愿长相守 提交于 2021-01-21 05:12:10
问题 Currently I am using libav* to encode H.264 videos. I want to add KLVPackets to the bitstream but do not know where to implement it. There is a struct within avcodec, but I am unsure of how to write it out to the frame metadata typedef struct { UID key; int64_t offset; uint64_t length; } KLVPacket; Current FFMPEG code (only left relevant code): av_register_all(); pOutputFormat = av_guess_format(NULL, fileName, NULL); pFormatCtx=avformat_alloc_context(); pVideoStream = av_new_stream(pFormatCtx