1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

2285 Commits

Author SHA1 Message Date
Clément Bœsch
ad2d2ebd4e ffmpeg: remove unused ist parameter in do_subtitle_out() 2016-10-16 19:22:19 +02:00
Michael Niedermayer
44453c09e4 ffmpeg: Use av_fifo_freep() to avoid stale pointers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-14 17:05:25 +02:00
James Zern
7f7c494a33 ffmpeg_cleanup: fix crash with unrecognized codec
since:
3e5e5bd Merge commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc'

Signed-off-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-14 17:02:33 +02:00
Hendrik Leppkes
3e5e5bdfef Merge commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc'
* commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc':
  avconv: buffer the packets written while the muxer is not initialized

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-08 11:38:47 +02:00
Hendrik Leppkes
ab7e83efed ffmpeg: explicitly write headers for files with no streams
Recent changes to ffmpeg.c tied output file init to stream init, which broke
stream-less files, specifically ffmetadata output.
2016-10-07 16:02:14 +02:00
Hendrik Leppkes
82c4d57553 Merge commit '1c169782cae6c5c430ff62e7d7272dc9d0e8d527'
* commit '1c169782cae6c5c430ff62e7d7272dc9d0e8d527':
  avconv: explicitly postpone writing the header until all streams are initialized

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 14:39:00 +02:00
Hendrik Leppkes
6f74e3cde6 Merge commit 'beb62dac629603eb074a44c44389c230b5caac7c'
* commit 'beb62dac629603eb074a44c44389c230b5caac7c':
  Use AVFrame.pts instead of deprecated pkt_pts.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:16:36 +02:00
Hendrik Leppkes
04a3577263 ffmpeg: remove unused and errorneous AVFrame timestamp check
Decoders have previously not used AVFrame.pts, and with the upcoming
deprecation of pkt_pts (in favor of pts), this would lead to an errorneous
interpration of timestamps.
2016-10-07 12:21:18 +02:00
Rodger Combs
1f7d586052
ffmpeg: don't reconfigure terminal if we're not taking input from stdin 2016-10-06 18:31:06 -05:00
wm4
4f8262e373 ffmpeg: use new encode API 2016-10-01 17:23:02 +02:00
wm4
8f6f232228 ffmpeg: use new decode API
This is a bit messy, mainly due to timestamp handling.

decode_video() relied on the fact that it could set dts on a flush/drain
packet. This is not possible with the old API, and won't be. (I think
doing this was very questionable with the old API. Flush packets should
not contain any information; they just cause a FIFO to be emptied.) This
is replaced with checking the best_effort_timestamp for AV_NOPTS_VALUE,
and using the suggested DTS in the drain case.

The modified tests (fate-cavs and others) still fails due to dropping
the last frame. This happens because the timestamp of the last frame
goes backwards (ffprobe -show_frames shows the same thing). I suspect
that this "worked" due to the best effort timestamp logic picking the
DTS over the decreasing PTS. Since this logic is in libavcodec (where
it probably shouldn't be), this can't be easily fixed. The timestamps
of the cavs samples are weird anyway, so I chose not to fix it.

Another strange thing is the timestamp handling in the video path of
process_input_packet (after the decode_video() call). It looks like
the code to increase next_dts and next_pts should be run every time
a frame is decoded - but it's needed even if output is skipped.
2016-10-01 17:22:22 +02:00
wm4
b2fea2fdee ffmpeg: move subframe warning to libavcodec
With the new decode API, doing this in ffmpeg.c is impractical. There
was resistance against removing the warning, so put it into libavcodec.

Not bothering with reducing the warning to verbose log level for
subsequent wanrings. The warning should be rare, and only happen when
developing new codecs for the old API.

Includes a change suggested by Michael Niedermayer.
2016-10-01 17:22:02 +02:00
Anton Khirnov
bfbf86ef18 ffmpeg: pass the hwaccel frames context to the decoder 2016-09-29 15:57:32 +02:00
James Almer
3597d32e88 Merge commit '6ed0f70f97c882813199b3bafd724ceeb43659de'
* commit '6ed0f70f97c882813199b3bafd724ceeb43659de':
  avconv: factor out initializing stream parameters for streamcopy

Conflicts:
    ffmpeg.c

Merged-by: James Almer <jamrial@gmail.com>
2016-09-28 12:59:07 -03:00
James Almer
4a05d2eda7 ffmpeg: stop using AVStream.codec on stream copy
This commit is based on commit 35c8580 from Anton Khirnov <anton@khirnov.net>
which was skipped in b8945c4.

The avcodec_copy_context() call in the encode path is left in place for now
as AVStream.codec is apparently still required even after porting ffmpeg to
the new bsf API.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-27 10:42:51 -03:00
James Almer
3ac76d7618 ffmpeg: fix memleak of encoder options AVDictionary on failure
Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-25 16:17:41 -03:00
Michael Niedermayer
9083e044f1 ffmpeg: Fix bistream typos
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-25 19:06:51 +02:00
Clément Bœsch
5ef1959080 ffmpeg: switch to the new BSF API
This commit is initially largely based on commit 4426540 from Anton
Khirnov <anton@khirnov.net> and two following fixes (80fb19b and
fe7b21c) which were previously skipped respectively in 98e3153, c9ee36e,
and 7fe7cdc.

mpeg4-bsf-unpack-bframes FATE reference is updated because the bsf
filter now actually fixes the extradata (mpeg4_unpack_bframes_init()
changing one byte is now honored on the output extradata).

The FATE references for remove_extra change because the packet flags
were wrong and the keyframes weren't marked, causing the bsf relying on
these proprieties to not actually work as intended.

The following was fixed by James Almer:

The filter option arguments are now also parsed correctly.

A hack to propagate extradata changed by bitstream filters after the
first av_bsf_receive_packet() call is added to maintain the current
behavior. This was previously done by av_bitstream_filter_filter() and
is needed for the aac_adtstoasc bsf.

The exit_on_error was not being checked anymore, and led to an exit
error in the last frame of h264_mp4toannexb test. Restoring this
behaviour prevents erroring out. The test is still changed as a result
due to the badly filtered frame now not being written after the failure.

Signed-off-by: Clément Bœsch <u@pkh.me>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-24 14:25:53 -03:00
Clément Bœsch
955b818cf9 ffmpeg: switch to codecpar
This commit is largely based on commit 15e84ed3 from Anton Khirnov
<anton@khirnov.net> which was previously skipped in bbf5ef9d.

There are still a bunch of things raising codecpar related warnings that
need fixing, such as:
- the use of codec->debug in the interactive debug mode
- read_ffserver_streams(): it's probably broken now but there is no test
- lowres stuff
- codec copy apparently required by bitstream filters

The matroska references are updated because they now properly forward
the field_order (previously unknown, now progressive).

Thanks to James Almer for fixing a bunch of FATE issues in this commit.

Signed-off-by: Clément Bœsch <clement@stupeflix.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-21 15:39:28 +02:00
Clément Bœsch
ae1dd0c9a6 lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg
In lavf we have access to st->internal->avctx so it's a better place
than in ffmpeg*.c and will allow moving to codecpar.
2016-09-14 09:57:55 +02:00
Jon Toohill
7f386bbe2a ffmpeg: copy trailing_padding when using -acodec copy
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-13 23:59:41 -03:00
Clément Bœsch
1895e3a24f ffmpeg: fix broken indent/style in write_frame 2016-09-02 11:01:46 +02:00
Marton Balint
2ee8a4f887 ffmpeg: fix -stream_loop with -re
Otherwise the stream failed with EAGAIN.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-08-28 18:22:24 +02:00
Carl Eugen Hoyos
ec9d7047c4 ffmpeg: Do not set too large bits_per_raw_sample. 2016-08-17 18:08:16 +02:00
Hendrik Leppkes
3bf142c773 cmdutils: remove the current working directory from the DLL search path on win32
Reviewed-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-08 18:36:55 +02:00
James Almer
61da882cea Merge commit '90944ee3ab79081845ea1bd97eea475031ce0842'
* commit '90944ee3ab79081845ea1bd97eea475031ce0842':
  avconv: refactor selecting an encoder

Conflicts:
	ffmpeg.c
	ffmpeg_opt.c

Merged-by: James Almer <jamrial@gmail.com>
2016-08-06 13:31:12 -03:00
Timothy Gu
e5c79cd854 Merge commit '5e1840622ce6e41c57d9c407604863d3f3dcc3ae'
* commit '5e1840622ce6e41c57d9c407604863d3f3dcc3ae':
  avconv: fix handling attachments in init_output_stream

Conflicts:
	avconv.c

This is functionally a no-op, as we don't have the bug this is trying to
fix. See 843be56ee1.

Merged-by: Timothy Gu <timothygu99@gmail.com>
2016-08-03 21:28:43 -07:00
Timothy Gu
1b04ea1a6c Merge commit '73c6ec6d659bab11ac424a4ba6ce3a56246295ee' into merge
* commit '73c6ec6d659bab11ac424a4ba6ce3a56246295ee':
  avconv: create simple filtergraphs earlier

Merged-by: Timothy Gu <timothygu99@gmail.com>
2016-08-03 20:53:03 -07:00
Timothy Gu
9aa3023672 Merge commit '49670e4218d34899a1c37abb7a11615efc16f757'
* commit '49670e4218d34899a1c37abb7a11615efc16f757':
  avconv: add a function for determining whether a filtergraph is simple

Conflicts:
	avconv.c

Merged-by: Timothy Gu <timothygu99@gmail.com>
2016-08-03 20:33:57 -07:00
Mark Reid
0a088dea3d ffmpeg.c: copy video profile when using stream_copy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-23 03:52:38 +02:00
James Almer
d688f39dc4 cosmetics: fix some misspelled words
Signed-off-by: James Almer <jamrial@gmail.com>
2016-07-17 13:10:27 -03:00
Clément Bœsch
11ee8a4504 ffmpeg: do not use deprecated AVSubtitleRect.pict 2016-06-25 13:35:46 +02:00
Clément Bœsch
8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Timo Rothenpieler
d865e74e6d ffmpeg: Add cuvid hwaccel support 2016-06-10 16:31:23 +02:00
Michael Niedermayer
6085d6b2ae ffmpeg: Check that r_frame_rate is set before attempting to use it
Avoids unexpected occurance and dependency on NaN behavior and divisions by 0

Testcase: fate-lavf-fate-avi_cram

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-16 14:23:49 +02:00
Ronald S. Bultje
9c4943e671 ffmpeg: copy color properties in case of -c:v copy.
I have no idea why the first hunk uses ost->enc_ctx, because as far as
I understand, that is never used in case of -c:v copy, but this code
block is only entered if encoding_needed=0, which means stream_copy=1.
My point being: review from someone that knows this really well would
be appreciated.
2016-05-10 08:37:56 -04:00
Derek Buitenhuis
172d3568b3 Merge commit '5d273d3efac340ef8de445c955ff44c7abed4e8f'
* commit '5d273d3efac340ef8de445c955ff44c7abed4e8f':
  avconv: VAAPI hwcontext initialisation and hwaccel helper

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-08 22:39:39 +01:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Ronald S. Bultje
2e6636aa87 vp9: add superframe merging bitstream filter.
Fixes ticket 4313.
2016-03-11 11:19:14 -05:00
Ronald S. Bultje
6d8ab358a3 lavf: allow BSFs to drop packets.
If pkt->size == 0 && pkt->side_data_elems == 0 after bsf->filter()
returns, the packet is considered dropped.
2016-03-11 11:19:10 -05:00
Clément Bœsch
6433618dc0 ffmpeg: set sub_text_format to ass (without timing) by default
Fixes Ticket #4783
2016-02-26 21:53:34 +01:00
Derek Buitenhuis
259fef86bb Merge commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1'
* commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1':
  avconv: pass the hw context from filters to the encoder

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 17:08:13 +00:00
Marton Balint
308ac2f7e2 ffmpeg: init input streams before opening encoders
Codec options of streams detected during avformat_find_stream_info are not set
therefore without this patch we initialize the encoders with decoder info
based on decoders without options.

This cause problems for probed DVB teletext streams where
avctx->subtitle_header depend on the txt_format setting.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-19 21:55:25 +01:00
Michael Niedermayer
5590ab45e0 ffmpeg: Check best_effort_timestamp after rescale
Fixes integer overflow
Fixes: Ticket5126

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-18 01:46:59 +01:00
Stefano Sabatini
b91093a411 ffmpeg: replace "flush Media" with "flush_media" in benchmark_all output
Simplify parsing and consistency.
2016-01-29 10:58:18 +01:00
Hendrik Leppkes
7dae3461c0 Merge commit '63f7f8d1dbf6ce27440fdd56ef38c822fb11b9c2'
* commit '63f7f8d1dbf6ce27440fdd56ef38c822fb11b9c2':
  avconv: Drop an impossible check

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-19 08:41:32 +01:00
Hendrik Leppkes
4440c8e9c9 Merge commit '7ebf1b4adad40e2b0d88ebd5cfde821a7a0ceab2'
* commit '7ebf1b4adad40e2b0d88ebd5cfde821a7a0ceab2':
  avconv: Simplify poll_filters() return value check

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-19 08:40:32 +01:00
Michael Niedermayer
7a0361b06f ffmpeg: fix sws_dict leak on error exit
Fixes: 1b79b985cdf860ffa228c00ee5497051/signal_sigsegv_1f99d24_3549_86d92054a79f6ff900fbaf03f8012b32.aif

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 01:19:43 +01:00
Ganesh Ajjanagadde
7ab37cae34 ffmpeg: check fclose return values
In the spirit of commit a956840cbc. Simple method to reproduce:
pass -vstats_file /dev/full to ffmpeg.

All raw fclose usages in ffmpeg.c taken care of here.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2016-01-07 16:57:37 -08:00
Ganesh Ajjanagadde
369b161d8e ffmpeg: replace log2 by av_log2
Slight change in output deemed irrelevant here.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2016-01-06 20:36:24 -08:00