Commit Graph

2262 Commits

Author SHA1 Message Date
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
Ganesh Ajjanagadde a956840cbc ffmpeg: check return value of avio_closep for progress report
avio_closep is not guaranteed to succeed, and its return value can
contain information regarding failure of preceding writes and silent
loss of data (man 2 close, man fclose). Users should know when the
progress was not successfully logged, and so a diagnostic is printed
here.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2016-01-05 19:06:21 -08:00
Rodger Combs a5fd3a1a2b ffmpeg: use lavf API for applying bitstream filters 2015-12-28 08:34:30 -06:00
Hendrik Leppkes be52b95d31 Merge commit 'e63e3797a1ed9346f529848e6ba3d27fd2d2cc8d'
* commit 'e63e3797a1ed9346f529848e6ba3d27fd2d2cc8d':
  avconv: pass the global codec side data to the muxer

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-17 13:20:37 +01:00
Moritz Barsnick 9d1fb9ef31 ffmpeg: add progress speed to status line and report
This adds a computation of the progress speed versus realtime ("Nx")
to the status line and to the report log. It uses the progress time
as already calculated for total output time as a base.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-17 02:17:02 +01:00
Tom Marecek 46cbb4c231 ffmpeg: change command line option -dump to work without -loglevel debug
-hex and -dump command line options do nothing unless -loglevel debug is set.

-dump by itself is useful for monitoring live streams (to get the current PTS for example)  however when it is used with -loglevel debug for an RTMP stream, librtmp also dumps the packet data which makes the output too noisy.

do_pkt_dump is only set in check_keyboard_interaction or by the -dump command line option so this change should have no effect on any other parts of the code..

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-11 13:39:21 +01:00
Simon Thelen 5b6c0fdb43 ffmpeg: When streamcopying, only add the input seek position when copying timestamps.
Using -ss as an input option shifts timestamps down by the seek, so it
doesn't have to be added to the recording time when checking whether to
stop.

Fixes #977

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 04:24:22 +01:00
Clément Bœsch 7234e04e35 ffmpeg: enable echoing with command and debug modes
Allow seeing text when pressing 'c' or 'd'.
2015-12-04 15:47:06 +01:00
Michael Niedermayer 9d44e23618 ffmpeg: Check pkt_dts for AV_NOPTS_VALUE
Fixes integer overflow
Fixes: 1536b9b096a8f95b742bae9d3d761cc6/signal_sigsegv_294aaed_2039_8d1797aeb823ea43858d0fa45c9eb899.ogv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-04 13:37:04 +01:00
Rodger Combs bf2590aed3 ffmpeg: fix -copy_prior_start 0 with -copyts and input -ss
Also rearranged the relevant check to reduce code duplication

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-20 19:20:30 +01:00
Maksym Veremeyenko d21b690e55 ffmpeg: preserve profile for audio stream copy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-20 18:09:47 +01:00
Bryan Huh 1fe82abac7 ffmpeg: Simplify fps code related to delta0
Small refactor of fps code for improved readability. In particular
the "cor" variable was unnecessary and misleading because it would
always be set to -delta0.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-16 01:53:47 +01:00
Bryan Huh dfa98c4f83 ffmpeg: Fixing typos and adding comments to fps code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-16 01:53:47 +01:00
Michael Niedermayer 6770a9d689 ffmpeg: Fix integer overflow with cur_dts being AV_NOPTS_VALUE
Since de0e219a8a cur_dts is sometimes invalid
2015-11-11 17:46:19 +01:00
Michael Niedermayer 363673fbe0 ffmpeg: Print a warning if a pkt duration is already set before using the frame rate
I didnt find any case that triggers this but if it gets triggered it needs to be
investigated

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 15:04:21 +01:00
Michael Niedermayer 46070cc20a ffmpeg: set muxer packet duration based on framerate only for CFR
a set ost->frame_rate does not imply CFR in ffmpeg

The changed fate tests had all wrong packet durations
(like 1/1000 or 1/90000)

There might be more cases in which is_cfr could be set

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 15:04:21 +01:00
Hendrik Leppkes d3d4bc4784 Merge commit '3efd71b4d0b4a73ccbbbdc092e6bbd54d92633f4'
* commit '3efd71b4d0b4a73ccbbbdc092e6bbd54d92633f4':
  avconv: set packet duration for CFR video streams

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-10 18:37:25 +01:00
Simon Thelen 70fb5eadc5 ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
Fixes a segfault when trying to write nonexistent rtp information.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-09 23:43:11 +01:00
Ganesh Ajjanagadde 92e483f8ed all: use FFDIFFSIGN to resolve possible undefined behavior in comparators
FFDIFFSIGN was created explicitly for this purpose, since the common
return a - b idiom is unsafe regarding overflow on signed integers. It
optimizes to branchless code on common compilers.

FFDIFFSIGN also has the subjective benefit of being easier to read due
to lack of ternary operators.

Tested with FATE.

Things not covered by this are unsigned integers, for which overflows
are well defined, and also places where overflow is clearly impossible,
e.g an instance where the a - b was being done on 24 bit values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-03 16:28:30 -05:00
Ganesh Ajjanagadde b45daad2aa ffmpeg: use log10 instead of log()/log(10)
This is more concise and conveys the intent better.
Furthermore, it is likely more precise as well due to lack of floating
point division.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-29 19:05:29 -04:00
Hendrik Leppkes 9f7de99517 Merge commit 'cd0e08813a0484002b5defbf557c859f123953ae'
* commit 'cd0e08813a0484002b5defbf557c859f123953ae':
  avconv: support infinite loop for the loop option

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:21:41 +01:00
Hendrik Leppkes c2f861ca42 Replace remaining occurances of av_free_packet with av_packet_unref 2015-10-27 14:35:30 +01:00
Hendrik Leppkes 856b19d593 Merge commit 'a5d42043093a39636a1f4021a37dd9c612479f6f'
* commit 'a5d42043093a39636a1f4021a37dd9c612479f6f':
  avformat: Always return ref-counted AVPacket

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:12:27 +01:00
Marton Balint ddc6bd8c95 ffmpeg: add abort_on option to allow aborting on empty output
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-22 19:03:01 +02:00