Commit Graph
100 Commits
Author SHA1 Message Date
Anton Khirnov 13f6917ca9 avconv: set discard on input streams automatically. 2012-02-26 19:30:50 +01:00
Anton Khirnov d3783f47ee lavf: don't set codec timebase in avformat_find_stream_info().
It's not supposed to be set outside of lavc.
2012-02-26 07:51:12 +01:00
Anton Khirnov 832ba44d8d avconv: saner output video timebase.
r_frame_rate should in theory have something to do with input framerate,
but in practice it is often made up from thin air by lavf. So unless we
are targeting a constant output framerate, it's better to just use input
stream timebase.

Brings back dropped frames in nuv and cscd tests introduced in
cd1ad18a65
2012-02-26 07:48:45 +01:00
Anton Khirnov 87d7a92b62 rawdec: set timebase to 1/fps. 2012-02-26 07:30:21 +01:00
Anton Khirnov d43040e28b avconv: refactor vsync code.
No functional changes, just make it more readable.
2012-02-26 07:28:27 +01:00
Anton Khirnov 493a86e25b FATE: remove a bunch of useless -vsync 0
No changes in the test results.
2012-02-26 07:28:04 +01:00
Anton Khirnov 03ca0a5b30 lavc: merge two if()s with the same condition. 2012-02-25 07:48:52 +01:00
Anton Khirnov d55fa6f9cb lavc: factorize setting got_packet_ptr in avcodec_encode_video2() 2012-02-25 07:48:46 +01:00
Anton Khirnov 52953d61ca lavc: signal no output when a NULL frame is passed to audio encoder without delay 2012-02-25 07:48:36 +01:00
Anton Khirnov 655b24c01c lavf: move the packet keyframe setting code.
compute_pkt_fields() is for unreliable estimates or guessing. The
keyframe information from the parser is (at least in theory) reliable,
so it should be used even when the other guessing is disabled with the
AVFMT_FLAG_NOFILLIN flag.

Therefore, move setting the packet keyframe flag based on parser
information from compute_pkt_fields() to read_frame_internal().
2012-02-24 19:43:02 +01:00
Anton Khirnov 5ff42e3138 lavf/output-example: use new audio encoding API correctly. 2012-02-24 09:44:18 +01:00
Anton Khirnov 6e9ed7c7ae lavf/output-example: more proper usage of the new API.
Passing the codec into avformat_new_stream() is preferred.
2012-02-24 09:44:17 +01:00
Anton Khirnov ff311c0918 lavc: drop encode() support for video.
All video encoders have been converted to encode2(), all new encoders
should also use only encode2().
2012-02-23 20:26:26 +01:00
Anton Khirnov 171273fec8 snowenc: switch to encode2(). 2012-02-23 20:26:14 +01:00
Anton Khirnov 8d3348c2c4 snowenc: don't abuse input picture for storing information. 2012-02-23 20:26:04 +01:00
Anton Khirnov 7340008f18 a64multienc: switch to encode2().
We have no decoder, so cannot test if the output is decodable.
2012-02-23 19:56:55 +01:00
Anton Khirnov cfc6ab3199 a64multienc: don't write into output buffer when there's no output. 2012-02-23 19:56:45 +01:00
Anton Khirnov 4da6d194e5 libxvid: switch to encode2(). 2012-02-23 19:55:23 +01:00
Anton Khirnov 760b004086 tiffenc: switch to encode2(). 2012-02-23 19:53:20 +01:00
Anton Khirnov 62acb4937e tiffenc: properly forward error codes in encode_frame(). 2012-02-23 19:52:08 +01:00
Anton Khirnov 2257f66ec5 lavc: drop libdirac encoder.
Libschroedinger is the preferred way to encode dirac video now, it
produces better output and has a nicer API.
2012-02-23 19:50:46 +01:00
Anton Khirnov 577fed3b7c gifenc: switch to encode2(). 2012-02-23 19:50:46 +01:00
Anton Khirnov d8f3365fb0 libvpxenc: switch to encode2(). 2012-02-23 19:50:46 +01:00
Anton Khirnov 0ecf54f9dc flashsvenc: switch to encode2(). 2012-02-23 19:50:46 +01:00
Anton Khirnov 84db922bf9 libxavs: switch to encode2(). 2012-02-23 19:25:50 +01:00
Anton Khirnov d3b577f00d libxavs: add an AVClass at the beginning of XavsContext. 2012-02-23 19:25:50 +01:00
Anton Khirnov a5f848c86d libxavs: split extradata writing out of encode_nals().
This is done in preparation for the following patch implementing
encode2().

This commit is analogous to 05d699222d for
libx264.
2012-02-23 19:25:50 +01:00
Anton Khirnov 8e8124e173 ljpegenc: switch to encode2(). 2012-02-23 19:25:50 +01:00
Anton Khirnov 3c0ed7d1a8 asv1enc: switch to encode2(). 2012-02-23 14:11:08 +01:00
Anton Khirnov df53a47317 libschroedingerenc: switch to encode2(). 2012-02-23 13:54:34 +01:00
Anton Khirnov 278d88689b ffv1enc: switch to encode2(). 2012-02-23 13:51:29 +01:00
Anton Khirnov f7fa73ac91 libtheoraenc: switch to encode2(). 2012-02-23 13:48:34 +01:00
Anton Khirnov 6d9c27dc85 jpeglsenc: switch to encode2(). 2012-02-23 11:12:39 +01:00
Anton Khirnov 148fc99506 lclenc: switch to encode2(). 2012-02-23 11:11:42 +01:00
Anton Khirnov 21b46747ad qtrleenc: switch to encode2(). 2012-02-23 11:08:50 +01:00
Anton Khirnov 0584e3ca97 lavf: don't set AVCodecContext.has_b_frames in compute_pkt_fields().
It is not supposed to be done outside lavc.

This is basically a revert of 818062f2f3.

It is unclear what issue this was supposed to fix, if it reappears again
it will have to be fixed in a more proper place.

The wtv-demux test change is because the sample starts with a B-frame.
2012-02-22 19:31:06 +01:00
Anton Khirnov 5d42ac7ffb mpegvideo_enc: only allocate output packet when we know there will be output
Fixes a memleak.
2012-02-21 22:47:01 +01:00
Anton Khirnov 55fd7da107 pcxenc: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov fb11e22fda sgienc: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov 61eaf45c99 targaenc: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov 1e742ea3c8 targaenc: don't modify input frame.
Set the pict_type/key_frame properties on the coded picture.
2012-02-20 07:50:44 +01:00
Anton Khirnov 3227770092 roqvideoenc: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov 4fd7cfef0b roqvideoenc: add const qualifier to the input frame. 2012-02-20 07:50:44 +01:00
Anton Khirnov 1ea5755046 pnmenc: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov bc9c70e5a3 huffyuv: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov 2abee9be82 v410enc: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov 11505f39e1 zmbvenc: switch to encode2(). 2012-02-20 07:50:44 +01:00
Anton Khirnov 8c8c7b5e37 zmbvenc: move header writing to the end of encode_frame().
This makes switching to encode2() simpler, because it allows us to know
exactly how large should the output buffer be before we start writing
into it.
2012-02-20 07:50:44 +01:00
Anton Khirnov 445a7d48b1 mpegvideo_enc: switch to encode2(). 2012-02-19 08:26:30 +01:00
Anton Khirnov 5455384219 mpegvideo_enc: force encoding delay of at least 1 frame when low_delay=0
This allows the following commit to extrapolate better dts for the first
frame. Pts difference between the first two frames is reused as the
difference between pts and dts of the first frame.
2012-02-19 08:22:48 +01:00
Anton Khirnov e9b380a7a5 pamenc: switch to encode2(). 2012-02-17 20:46:37 +01:00
Anton Khirnov 3cc77ded4f svq1enc: switch to encode2(). 2012-02-17 20:46:37 +01:00
Anton Khirnov 6a047213ac dvenc: switch to encode2(). 2012-02-17 20:46:37 +01:00
Anton Khirnov b3566a6a39 dpxenc: switch to encode2(). 2012-02-17 20:46:37 +01:00
Anton Khirnov 83c7fe3245 pngenc: switch to encode2(). 2012-02-17 20:46:37 +01:00
Anton Khirnov ab3a410cf0 v210enc: switch to encode2(). 2012-02-17 20:46:37 +01:00
Anton Khirnov f0366fec56 xwdenc: switch to encode2(). 2012-02-17 20:46:37 +01:00
Anton Khirnov 3dffa1b46c cljr: implement encode2. 2012-02-12 08:05:57 +01:00
Anton Khirnov 177bb4bf50 cljr: set the properties of the coded_frame, not input frame. 2012-02-12 08:05:38 +01:00
Anton Khirnov 89829242a6 dnxhdenc: switch to encode2. 2012-02-12 08:03:46 +01:00
Anton Khirnov 3f77c41171 bmpenc: switch to encode2(). 2012-02-12 08:02:28 +01:00
Anton Khirnov cd1ad18a65 rawenc: switch to encode2().
This changes a number of FATE results, since before this commit, the
timestamps in all tests using rawenc were made up by lavf.

In most cases, the previous timestamps were completely bogus.

In some other cases -- raw formats, mostly h264 -- the new timestamps
are bogus as well. The only difference is that timestamps invented by
the muxer are replaced by timestamps invented by the demuxer.

cscd     -- avconv sets output codec timebase from r_frame_rate
and r_frame_rate is in this case some guessed number 31.42 (377/12),
which is not accurate enough to represent all timestamps. This results
in some frames having duplicate pts. Therefore, vsync 0 needs to be
changed to vsync 2 and avconv drops two frames. A proper fix in the
future would be to set output timebase to something saner in avconv.

nuv      -- previous timestamps for video were wrong AND the cscd
comment applies, one frame is dropped.

vp8-signbias -- the file contains two frames with identical timestamps,
so -vsync 0 needs to be removed/changed to -vsync 2 and avconv drops one
frame.

vc1-ism -- apparrently either the demuxer lies about timestamps or the
file is broken, since dts == pts on all packets, but reordering clearly
takes place.
2012-02-08 21:51:24 +01:00
Anton Khirnov 38d5533228 pixdesc: mark pseudopaletted formats with a special flag.
This makes it possible to dintinguish them from PAL8.

Fixes an invalid write in avpicture_layout().
2012-02-08 21:01:31 +01:00
Anton Khirnov 8e37038a34 avconv: switch to avcodec_encode_video2(). 2012-02-08 21:00:00 +01:00
Anton Khirnov 06484d0b8a libx264: implement encode2(). 2012-02-08 20:59:07 +01:00
Anton Khirnov 05d699222d libx264: split extradata writing out of encode_nals().
This is done in preparation for the following patch.
2012-02-08 20:58:48 +01:00
Anton Khirnov 52f82a1148 lavc: add avcodec_encode_video2() that encodes from an AVFrame -> AVPacket
Deprecate avcodec_encode_video().
2012-02-08 20:54:24 +01:00
Anton Khirnov 722410ade5 avconv: estimate next_dts from framerate if it is set. 2012-02-07 20:14:54 +01:00
Anton Khirnov b34856a116 avconv: better next_dts usage.
next_dts is used for estimating the dts of the next packet if it's
missing. Therefore, it makes no sense to set it from the pts of the last
decoded frame. Also it should be estimated from the current packet
duration/ticks_per_frame always, not only when a frame was successfully
decoded.
2012-02-07 20:14:41 +01:00
Anton Khirnov 23576b3fbb avconv: rename InputStream.pts to last_dts.
It more accurately describes what does this variable store.
2012-02-07 20:13:15 +01:00
Anton Khirnov 6e98390258 avconv: reduce overloading for InputStream.pts.
It currently has different meanings at different times (dts of the last
read packet/pts of the last decoded frame). Reduce obfuscation by
storing pts of the decoded frame in the frame itself.
2012-02-07 20:12:04 +01:00
Anton Khirnov 3101bb6669 avconv: rename InputStream.next_pts to next_dts.
It's used to predict dts, not pts.
2012-02-07 20:11:22 +01:00
Anton Khirnov 1270e12e49 avconv: rework -t handling for encoding.
Current code compares the desired recording time with InputStream.pts,
which has a very unclear meaning. Change the code to use actual
timestamps of the frames passed to the encoder.

In several tests, one less frame is encoded, which is more correct.

In the idroq test one more frame is encoded, which is again more
correct.

Behavior with stream copy should be unchanged.
2012-02-07 20:11:11 +01:00
Anton Khirnov c9af832623 avconv: set encoder timebase for subtitles.
The actual number (1/1000) will probably require some
discussion/tweaking in the future, but should be good enough for now,
since the timestamps in AVSubtitle are in this timebase by definition.
2012-02-07 20:07:14 +01:00
Anton Khirnov 4be1d7dc20 pva-demux test: add -vn
The output is obviously not supposed to contain video (since only
-acodec copy is specified), but that only happens because of the way -t
handling is implemented currently.
2012-02-07 20:06:57 +01:00
Anton Khirnov 324fbadff9 avconv: remove debugging cruft from do_video_out(). 2012-02-03 13:45:02 +01:00
Anton Khirnov 61a099680c avconv: factorize setting stream_index for the output packet. 2012-02-03 13:44:59 +01:00
Anton Khirnov d2afbd9a56 frame{crc/md5}: set the stream timebase from codec timebase.
Right now those muxers use the default timebase in all cases(1/90000).

This patch avoid unnecessary rescaling and makes the printed timestamps
more readable.

Also, extend the printed information to include the timebases and packet
pts/duration and align the columns.

Obviously changes the results of all fate tests which use those two
muxers.
2012-02-03 09:29:02 +01:00
Anton Khirnov e15e2a6d2a libx264: fix indentation. 2012-02-02 22:23:17 +01:00
Anton Khirnov dd6d3b0e02 lavf: add functions for accessing the fourcc<->CodecID mapping tables.
Fixes bug 212.
2012-01-31 16:53:35 +01:00
Anton Khirnov bc90199848 lavc: set AVCodecContext.codec in avcodec_get_context_defaults3().
This way, if the AVCodecContext is allocated for a specific codec, the
caller doesn't need to store this codec separately and then pass it
again to avcodec_open2().

It also allows to set codec private options using av_opt_set_* before
opening the codec.
2012-01-31 16:53:35 +01:00
Anton Khirnov 0e72ad95f9 lavc: make avcodec_close() work properly on unopened codecs.
I.e. free the priv_data and other stuff allocated in
avcodec_alloc_context3() and not segfault.
2012-01-31 07:56:21 +01:00
Anton Khirnov af08d9aeea lavc: add avcodec_is_open().
It allows to check whether an AVCodecContext is open in a documented
way. Right now the undocumented way this check is done in lavf/lavc is
by checking whether AVCodecContext.codec is NULL. However it's desirable
to be able to set AVCodecContext.codec before avcodec_open2().
2012-01-31 07:55:24 +01:00
Anton Khirnov f7fe41a04f lavf: rename AVInputFormat.value to raw_codec_id.
It's only used by raw demuxers for storing the codec id.
2012-01-31 07:50:31 +01:00
Anton Khirnov 9a463917d3 lavf: remove the pointless value field from flv and iv8
The demuxers don't use it in any way.
2012-01-31 07:48:03 +01:00
Anton Khirnov afa4069e3b lavc/lavf: remove unnecessary symbols from the symbol version script. 2012-01-31 07:26:31 +01:00
Anton Khirnov f5f49a66a2 lavc: reorder AVCodec fields.
Put all private fields at the end and mark them as such so they can be
easily changed/removed.

This breaks ABI.
2012-01-31 07:26:18 +01:00
Anton Khirnov 183eaa9a25 lavf: reorder AVInput/OutputFormat fields.
Put all private fields at the end and mark them as such so they can be
easily changed/removed.

This breaks ABI.
2012-01-31 07:21:06 +01:00
Anton Khirnov d7edd359ec avconv: deprecate the -deinterlace option
Its quality is horrible, yadif should always be used instead.
2012-01-30 21:43:08 +01:00
Anton Khirnov 91b3bfba88 avplay: use the correct array size for stride.
AV_NUM_DATA_POINTERS instead of 4.
2012-01-28 19:45:45 +01:00
Anton Khirnov 9bfe218299 lavc: extend doxy for avcodec_alloc_context3(). 2012-01-28 19:45:33 +01:00
Anton Khirnov 44911f2985 APIchanges: mention avcodec_alloc_context()/2/3
There was no minor bump for making avcodec_alloc_context3() public and
deprecating the other two, so I'm using the first next lavc bump.
2012-01-28 19:45:10 +01:00
Anton Khirnov 2d9535ad31 avcodec_align_dimensions2: set only 4 linesizes, not AV_NUM_DATA_POINTERS.
This function is video-only, so there's no point in setting more
linesizes.

Fixes stack corruption in avplay.
2012-01-28 19:44:55 +01:00
Anton Khirnov c5254755c0 lavf: remove disabled FF_API_SET_PTS_INFO cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 374e469b8d lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov bf868727d7 lavf: remove disabled FF_API_REORDER_PRIVATE cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov fd87ba3220 lavf: remove disabled FF_API_SEEK_PUBLIC cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov bd4c51312b lavf: remove disabled FF_API_STREAM_COPY cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 2a0f868cfa lavf: remove disabled FF_API_PRELOAD cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 1329827e79 lavf: remove disabled FF_API_NEW_STREAM cruft 2012-01-27 10:52:43 +01:00