Re: [Libav-user] Bitrate parameter ignored when writing videos
On 8/10/16, Masneri, Stefanowrote: > I am trying to write an .mp4 video with a specified bitrate and gopsize set > to 1. > Apparently libavcodec ignores the settings I provide and creates a video > with a much higher bitrate > > Here's the code I use to setup the output video: > > m_pcVideoSt->codec->gop_size = m_iGopSize; /* emit one intra frame every > m_iGopSize frames at most */ > m_pcVideoSt->codec->pix_fmt = AV_PIX_FMT_YUV420P; /* default pix_fmt */ > m_pcVideoSt->codec->max_b_frames = 1; > AVDictionary* pcOpts = nullptr; > int res1 = av_dict_set(, "b", "20k", 0); > int res = avcodec_open2(m_pcVideoSt->codec, codec, ); > > m_pcVideoSt is of type AVStream* > > This is the output of ffprobe ran on the video I wrote: > > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'testGray.mp4': > Metadata: > major_brand : isom > minor_version : 512 > compatible_brands: isomiso2avc1mp41 > encoder : Lavf56.40.101 > Duration: 00:00:20.00, start: 0.00, bitrate: 8905 kb/s > Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, > 720x576, 8904 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) > Metadata: > handler_name: VideoHandler > > When watching the video, it seems that the quality is low for the first few > frames, but then the quality gets much better (explaining the 8905Kb/s > bitrate). > Any idea on what I am missing? Above I do not see relevant code that calls encoder. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
[Libav-user] Bitrate parameter ignored when writing videos
I am trying to write an .mp4 video with a specified bitrate and gopsize set to 1. Apparently libavcodec ignores the settings I provide and creates a video with a much higher bitrate Here's the code I use to setup the output video: m_pcVideoSt->codec->gop_size = m_iGopSize; /* emit one intra frame every m_iGopSize frames at most */ m_pcVideoSt->codec->pix_fmt = AV_PIX_FMT_YUV420P; /* default pix_fmt */ m_pcVideoSt->codec->max_b_frames = 1; AVDictionary* pcOpts = nullptr; int res1 = av_dict_set(, "b", "20k", 0); int res = avcodec_open2(m_pcVideoSt->codec, codec, ); m_pcVideoSt is of type AVStream* This is the output of ffprobe ran on the video I wrote: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'testGray.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.40.101 Duration: 00:00:20.00, start: 0.00, bitrate: 8905 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576, 8904 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name: VideoHandler When watching the video, it seems that the quality is low for the first few frames, but then the quality gets much better (explaining the 8905Kb/s bitrate). Any idea on what I am missing? ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Need to understand where demuxer for mp4 is hooked with h264 decoder ?
Hi, It seems *demuxer for mp4* is sending data to decoder but without *headers* (i.e. sps and pps) and the packets received is having only *size* (first 4 bytes) at the beginning. My decoder need sps and pps else its giving error that "No proper header" while decoding. Can you please suggest what to be done ? -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Need-to-understand-where-demuxer-for-mp4-is-hooked-with-h264-decoder-tp4662406p4662410.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user