Commit Graph

226 Commits

Author SHA1 Message Date
Michael Niedermayer 660a8b43ab avformat/avienc: write last frame duration
Fixes small part of Ticket 3052

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-19 20:23:04 +01:00
Michael Niedermayer be44856483 avformat/avienc: factor frame skip code out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-19 20:18:03 +01:00
Michael Niedermayer af19d2ed1e libavformat/avienc: Make unchanged function arguments const
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-24 18:34:21 +02:00
Michael Niedermayer 3c020b6959 avformat/avienc: Dont search for startcodes in inserted empty avi frames
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-17 00:39:09 +02:00
Michael Niedermayer ac293b6685 Merge commit '194be1f43ea391eb986732707435176e579265aa'
* commit '194be1f43ea391eb986732707435176e579265aa':
  lavf: switch to AVStream.time_base as the hint for the muxer timebase

Conflicts:
	doc/APIchanges
	libavformat/filmstripenc.c
	libavformat/movenc.c
	libavformat/mxfenc.c
	libavformat/oggenc.c
	libavformat/swf.h
	libavformat/version.h
	tests/ref/lavf/mkv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 19:49:17 +02:00
Michael Niedermayer 2d70282254 Merge commit 'd754ed41727b1fcbab335b510248a9758a73320c'
* commit 'd754ed41727b1fcbab335b510248a9758a73320c':
  riffenc: take an AVStream instead of an AVCodecContext

Conflicts:
	libavformat/nutenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 17:47:12 +02:00
Anton Khirnov 194be1f43e lavf: switch to AVStream.time_base as the hint for the muxer timebase
Previously, AVStream.codec.time_base was used for that purpose, which
was quite confusing for the callers. This change also opens the path for
removing AVStream.codec.

The change in the lavf-mkv test is due to the native timebase (1/1000)
being used instead of the default one (1/90000), so the packets are now
sent to the crc muxer in the same order in which they are demuxed
(previously some of them got reordered because of inexact timestamp
conversion).
2014-06-18 15:12:34 +02:00
Anton Khirnov d754ed4172 riffenc: take an AVStream instead of an AVCodecContext
It will be useful in the following commits.

Also, rename the AVCodecContext pointer name from 'stream' to 'codec'.
2014-06-18 15:03:55 +02:00
Carl Eugen Hoyos 27d460fe98 Refuse to mux H.264 with fourcc H264 into avi without startcode.
Fixes ticket #3638.
2014-05-23 16:20:22 +02:00
Carl Eugen Hoyos e705d0ce1c Set dwSuggestBufferSize to largest chunk size for every stream in avi.
Fixes playback with WMP 9 for files with large (rawvideo) frames
as explained in ticket #2145.

Fixes ticket #2818.
2014-05-19 00:05:40 +02:00
Michael Niedermayer 4f32efdff0 Merge commit 'c3311d472a7528c67f76d0d061704ae70a99b32e'
* commit 'c3311d472a7528c67f76d0d061704ae70a99b32e':
  avienc: sanitize variable naming in write_header()

Conflicts:
	libavformat/avienc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-18 14:14:33 +02:00
Anton Khirnov c3311d472a avienc: sanitize variable naming in write_header()
Do not call an AVCodecContext 'stream', that is highly confusing.
Also, add a local variable for the current AVStream in the loop over all
streams.
2014-05-18 10:24:02 +02:00
Daniel Verkamp 5e7d21c7ad ff_put_wav_header: add flag to force WAVEFORMATEX
Partially undoes commit 2c4e08d89327595f7f4be57dda4b3775e1198d5e:

    riff: always generate a proper WAVEFORMATEX structure in
    ff_put_wav_header

A new flag, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX, is added to force the
use of WAVEFORMATEX rather than PCMWAVEFORMAT even for PCM codecs.

This flag is used in the Matroska muxer (the cause of the original
change) and in the ASF muxer, because the specifications for
these formats indicate explicitly that WAVEFORMATEX should be used.

Muxers for other formats will return to the original behavior of writing
PCMWAVEFORMAT when writing a header for raw PCM.

In particular, this causes raw PCM in WAV to generate the canonical
44-byte header expected by some tools.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-30 16:41:35 +02:00
Carl Eugen Hoyos 63c03ea98d Fix writing RGB 5:5:5 rawvideo into avi.
WMP expects bits per pixel to be set to 16 for RGB 5:5:5 rawvideo.
2014-04-14 15:34:38 +02:00
Carl Eugen Hoyos 8b122937af Warn if rawvideo and an unreadable pix_fmt are written.
Print an error if a combination of rawvideo and an unusual pix_fmt
that will be impossible to decode are written to avi or mov.
Fixes ticket #3545.
2014-04-11 23:35:11 +02:00
Michael Niedermayer 309171bea9 Merge commit '3407172b36a93cec410c6a287dbeec0f41257512'
* commit '3407172b36a93cec410c6a287dbeec0f41257512':
  avienc: K&R formatting cosmetics

Conflicts:
	libavformat/avienc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-04 22:21:58 +01:00
Keiji Costantini 3407172b36 avienc: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-03-04 18:53:58 +01:00
James Darnley 2efdccac87 lavf/avienc: cosmetic indent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 23:00:17 +01:00
James Darnley fa20babb46 lavf/avienc: use metadata_header_padding
The muxer will write at least the number of bytes requested and possibly
up to 3 bytes more.  This is because the muxer writes 32-bit integers
and the format requires 4-byte alignment anyway.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:58:59 +01:00
Peter Ross fcbb94712d riffenc: add option to ff_put_bmp_header to ignore extradata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 15:42:35 +01:00
Erik Olofsson f5bffd3a1a libavf/avienc: store language metadata for XSUB streams
Formatted in such a way that DivX certified players can decode it.
Verified on Sony Playstation 3 and Philips DVP3380.

Fixes ticket 2385

Signed-off-by: Erik Olofsson <eaj.olofsson@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-09 20:33:04 +01:00
Michael Niedermayer c79c7ffc9d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avienc: drop the vfr flag.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-09 00:18:50 +01:00
Anton Khirnov d42db44cfe avienc: drop the vfr flag.
AVI does not really support vfr properly, only by padding with null
packets.
2013-11-08 21:02:29 +01:00
Michael Niedermayer 72eddc10fa Merge commit 'd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9'
* commit 'd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9':
  lavf: Reset the entry count and allocation size variables on av_reallocp failures

Conflicts:
	libavformat/avienc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-27 12:13:41 +02:00
Martin Storsjö d872fb0f7f lavf: Reset the entry count and allocation size variables on av_reallocp failures
When av_reallocp fails, the associated variables that keep track of
the number of elements in the array (and in some cases, the
separate number of allocated elements) need to be reset.

Not all of these might technically be needed, but it's better to
reset them if in doubt, to make sure variables don't end up
conflicting.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:14:03 +03:00
Michael Niedermayer fcd64dcc37 avformat/avienc: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-20 22:50:06 +02:00
Michael Niedermayer 20dfab33f5 Merge commit '5626f994f273af80fb100d4743b963304de9e05c'
* commit '5626f994f273af80fb100d4743b963304de9e05c':
  avformat: Use av_reallocp() where suitable

Conflicts:
	libavformat/avidec.c
	libavformat/avienc.c
	libavformat/aviobuf.c
	libavformat/oggparsevorbis.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-19 11:01:26 +02:00
Alexandra Khirnova 5626f994f2 avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-18 18:28:38 +02:00
Michael Niedermayer b9e7bde6bd lavf/avienc: use av_freep() avoid stale pointers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-16 22:49:17 +02:00
Clément Bœsch 7308439158 lavf: Don't explicitly flush after each written packet in muxers
Since 596e5d4783, this is not necessary anymore. It also allows to
actually disable the flushing, improving write performance (but
possibly giving worse latency in real-time streaming).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:17:33 +03:00
Michael Niedermayer cc0db8cf30 avienc: Disallow the first frame to be skiped
Fixes Ticket2386

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-22 14:11:42 +02:00
Clément Bœsch 8de9bb6e5e lavf: remove some flushing in write_packet muxers callbacks.
Since 4f112a8e3, this is not necessary anymore. Also, it allows to
actually disable the flushing.
2013-04-14 21:16:53 +02:00
Tobias Rapp 7f09b888e8 avienc: fix overflow of audio sample count
Fixes an overflow of the sample count field within the audio stream header
chunk if audio stream data exceeds 2GB.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-11 18:33:24 +02:00
Stefano Sabatini a0f2d3fff5 lavf/avienc: return proper error codes, and provide some more feedback 2012-11-17 11:15:00 +01:00
Michael Niedermayer bacebe1f95 avienc: force a valid timebase for video
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-01 20:26:59 +01:00
Stefano Sabatini be0b37c649 lavf/avienc: fix/extend error message, in case of too large number of skipped frames 2012-10-31 14:46:40 +01:00
Stefano Sabatini f35d5f966f lavf/avienc: enable debug log 2012-10-31 14:46:24 +01:00
Michael Niedermayer fadfbb354b Merge commit '71e92414bfd79e56ea6fff174a665ff7b9b86e68'
* commit '71e92414bfd79e56ea6fff174a665ff7b9b86e68':
  lavf: move RIFF INFO tag writing from avienc to riff
  avconv: fix disabling auto mappings with -map_metadata

Conflicts:
	ffmpeg_opt.c
	libavformat/riff.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 14:30:25 +02:00
Victor Vasiliev 71e92414bf lavf: move RIFF INFO tag writing from avienc to riff
It will be useful in the wav muxer.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-16 18:50:36 +02:00
Diego Biurrun 11d4e92ed9 avformat: Remove non-compiling and/or silly commented-out printf/av_log statements 2012-10-01 10:24:28 +02:00
Michael Niedermayer f276a490f0 Merge commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b'
* commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b':
  avformat: fix typo in avformat_close_input
  mp3enc: write Xing TOC
  mp3enc: support MPEG-2 and MPEG-2.5 in Xing header.
  mp3enc: downgrade some errors in writing Xing frame to warnings
  lavf: flush the output AVIOContext in av_write_trailer().
  lavf: cosmetics, reformat av_write_trailer().
  avio: flush the internal buffer in avio_close()
  Enhance doc on asyncts audiofilter
  cmdutils: avoid setting data pointers to invalid values in alloc_buffer()
  libavcodec: remove av_destruct_packet_nofree()

Conflicts:
	libavcodec/avpacket.c
	libavformat/mp3enc.c
	libavformat/nutenc.c
	libavformat/utils.c
	libavformat/version.h
	tests/ref/lavf/voc
	tests/ref/lavf/voc_s16

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-16 14:24:11 +02:00
Anton Khirnov 3b4bb19e63 lavf: flush the output AVIOContext in av_write_trailer().
This is consistent with stdio and is what we want to do in all cases.

Fixes a bug in the voc muxer which didn't flush in write_trailer()
previously. This is the cause of the change in the test results.
2012-09-15 18:25:07 +02:00
Michael Niedermayer 7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer d1dad7c824 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpc8: return more meaningful error codes.
  mpc: return more meaningful error codes.
  wv,mpc8: don't return apetag data in packets.
  rtmp: do not warn about receiving metadata packets
  x86: h264dsp: Adjust YASM #ifdefs
  x86: yadif: Mark mmxext optimizations as such
  h264: convert loop filter strength dsp function to yasm.
  Improve descriptiveness of a number of codec and container long names

Conflicts:
	libavcodec/flvdec.c
	libavcodec/libopenjpegdec.c
	libavformat/apetag.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-31 22:41:00 +02:00
Diego Biurrun 0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Michael Niedermayer 2cb4d51654 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  v410dec: Implement explode mode support
  zerocodec: fix direct rendering.
  wav: init st to NULL to avoid a false-positive warning.
  wavpack: set bits_per_raw_sample for S32 samples to properly identify 24-bit
  h264: refactor NAL decode loop
  RTMPTE protocol support
  RTMPE protocol support
  rtmp: Add ff_rtmp_calc_digest_pos()
  rtmp: Rename rtmp_calc_digest to ff_rtmp_calc_digest and make it global
  swscale: add missing HAVE_INLINE_ASM check.
  lavfi: place x86 inline assembly under HAVE_INLINE_ASM.
  vc1: Add a test for interlaced field pictures
  swscale: Mark all init functions as av_cold
  swscale: x86: Drop pointless _mmx suffix from filenames
  lavf: use conditional notation for default codec in muxer declarations.
  swscale: place inline assembly bilinear scaler under HAVE_INLINE_ASM.
  dsputil: ppc: cosmetics: pretty-print
  dsputil: x86: add SHUFFLE_MASK_W macro
  configure: respect CC_O setting in check_cc

Conflicts:
	Changelog
	configure
	libavcodec/v410dec.c
	libavcodec/zerocodec.c
	libavformat/asfenc.c
	libavformat/version.h
	libswscale/utils.c
	libswscale/x86/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-23 21:25:09 +02:00
Ronald S. Bultje fd48721849 lavf: use conditional notation for default codec in muxer declarations.
This removes the use of macro nesting in these code constructs, which
makes it easier to parse in pre-processors.
2012-07-22 16:10:21 -07:00
Michael Niedermayer eaf655384b avienc: use av_assert
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-17 17:10:05 +02:00
Michael Niedermayer 875851294f avienc: create xsub in avi files that are closer to whats in the wild
Fixes ticket1332

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-27 22:45:52 +02:00