Re: [Libav-user] warning of "[libmp3lame @ 00CAB020] frame_size is too large" while calling avcodec_encode_audio2()

2012-09-26 Thread jettoblack
zhao0130 wrote > I am using ffmpeg api to transcode a movie (.mp4 -> .mov). I got a warning > while calling avcodec_encode_audio2(): "[libmp3lame @ 00CAB020] frame_size > is too large". I believe this should be due to that the frame size of > decoding AVCodecContext, 1024, is different from that

Re: [Libav-user] Setting libx264 bitrate via API

2012-08-04 Thread jettoblack
After digging through ffmpeg.c, I finally figured it out. My code was sending pictures into the encoder using a pts in the stream's time_base of 1/9 (e.g. 3003, 6006, 9009). The solution was to first rescale the AVFrame's pts from the stream's time_base to the codec time_base to get a simpl

Re: [Libav-user] Setting libx264 bitrate via API

2012-07-23 Thread jettoblack
rsg wrote > > Hi, > > I am also facing a similar issue. > When I set the bit rate using > > out_vcodec->bit_rate = 20; > > the quality of the video goes very bad. But when I set qmin and qmax, the > bitrate setting is ignored. > Only when i set a high value (approx 100MB) for the b

[Libav-user] Setting libx264 bitrate via API

2012-07-20 Thread jettoblack
Hello, I'm trying to do the equivalent of this via the API: ffmpeg -i test.m2t -c:v libx264 -b:v 50 -s 640x360 -ac 2 test.mov This gives a ABR file at 500kbits/sec. I thought setting the video bitrate should be as simple as: out_vcodec->bit_rate = 50; When using CODEC_ID_MPEG2VIDEO o

Re: [Libav-user] Example for recompressing a video?

2012-06-07 Thread jettoblack
Hi Nicolas, Thanks again for your time so far. I understand what you mean and I mistakenly thought that a compilable example would be preferred over a limited snippet. I put the snippet below in case you don't mind taking a quick look again. I would definitely appreciate any assistance you can o

Re: [Libav-user] Example for recompressing a video?

2012-06-05 Thread jettoblack
Hi Nicolas, Very helpful, thank you. I trimmed this code down to just the essentials of the audio section since video isn't a problem. What I see is that: - The call to avresample_convert() seems to always succeed, so I think decode and resample are working ok - The first call to avcodec_encode_a

Re: [Libav-user] Example for recompressing a video?

2012-06-04 Thread jettoblack
Hi Christian and Nicolas, Thanks for the input. I managed to get video encoding working and everything looks good there. The solution was to use the picture.best_effort_timestamp as the pts of encoded frame instead of the pkt.pts (since I have now learned that a pkt could contain 0 or more pictur

[Libav-user] Example for recompressing a video?

2012-05-31 Thread jettoblack
Hello, I'd like to use libavformat to recompress a video file, similar to ffmpeg standalone but much simpler (fixed codec parameters, etc.). I've figured out how to remux (without re-encoding), but I'm not sure on recompressing. I used the output-example.c as a starting point, but it generates fa

Re: [Libav-user] How to set mpegts muxrate via API?

2012-05-14 Thread jettoblack
Nevermind, I figured it out. :) Needed to create a AVDictionary containing "muxrate" as a key, and pass that into avformat_write_header(). -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-How-to-set-mpegts-muxrate-via-API-tp4631113p4633928.html Sent from the li

Re: [Libav-user] Add MPEG-2 user data or H.264 SEI metadata while remuxing

2012-05-03 Thread jettoblack
Deepika wrote > > Hi, > > I am looking for this too. Any leads? > > Regards, > Deepika > > Hi Deepika, I've got the basic idea of it working now. For MPEG-2 Video it is relatively simple as you can just append the user data structure to the end of the frame data. It looks like: 0x01b2

Re: [Libav-user] Frame order from TS demux - mpeg2video vs h264

2012-05-03 Thread jettoblack
Kalileo wrote > > On Apr 30, 2012, at 23:53 , jettoblack wrote: > >> On Mon, Apr 30, 2012 at 2:51 AM, Kalileo [via libav-users] < >> ml-node+s943685n4597541h88@.nabble> wrote: >> >>> >>> The decoder gives you the (decoded) pictures in the

Re: [Libav-user] Frame order from TS demux - mpeg2video vs h264

2012-05-01 Thread jettoblack
On Tue, May 1, 2012 at 2:20 AM, Carl Eugen Hoyos [via libav-users] < ml-node+s943685n4600239...@n4.nabble.com> wrote: > jettoblack writes: > > > I tried that and for H.264 it's definitely wrong if I use the frames > > in-order from the demuxer. It does work fine for

Re: [Libav-user] Frame order from TS demux - mpeg2video vs h264

2012-04-30 Thread jettoblack
On Mon, Apr 30, 2012 at 2:51 AM, Kalileo [via libav-users] < ml-node+s943685n4597541...@n4.nabble.com> wrote: > > The decoder gives you the (decoded) pictures in the correct order. > > That's what I expected, and it does for MPEG-2 codec video, but not for H.264 codec within a MPEG-2 transport str

[Libav-user] Frame order from TS demux - mpeg2video vs h264

2012-04-29 Thread jettoblack
Hello, I have a question about determining the display order of picture frames when demuxing a MPEG-2 transport stream that contains either MPEG-2 video or H.264 video. I'm using ffmpeg git head latest as of the past couple days. My code uses libavformat to demux the stream, add some metadata whi

[Libav-user] Add MPEG-2 user data or H.264 SEI metadata while remuxing

2012-04-03 Thread jettoblack
Hello, I'm imagining a program that will accept an incoming MPEG-2 transport stream, demux, add some metadata to the video packets, then remux and write/stream back out. There will be no decompression or recompression of the a/v codec data. For MPEG-2 video, the data would be added as MPEG-2 user