1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

2231 Commits

Author SHA1 Message Date
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
Hendrik Leppkes
dd8a4b0f8c Merge commit 'fb472e1a11a4e0caed2c3c91da01ea8e35d9e3f8'
* commit 'fb472e1a11a4e0caed2c3c91da01ea8e35d9e3f8':
  avconv: add support for Intel QSV-accelerated transcoding

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-22 16:18:02 +02:00
Marton Balint
b69b43e2c4 ffmpeg: exit on corrupt packets or decoded frames if exit_on_error flag is present
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-22 05:07:46 +02:00
Marton Balint
e2b416b68e ffmpeg: factorize checking decoder result
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-22 05:07:46 +02:00
Marton Balint
f4730a5845 ffmpeg: exit on av_write_trailer failure if exit_on_error is set
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-22 05:07:45 +02:00
Marton Balint
a1240c0522 ffmpeg: log failed av_write_trailer
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-22 05:07:45 +02:00
Hendrik Leppkes
a34dfc93ef ffmpeg: add deprecation guards around remaining AVFMT_RAWPICTURE usage 2015-10-14 14:52:43 +02:00
Hendrik Leppkes
435dfc15df ffmpeg: remove trailing whitespace that sneaked into the previous merge 2015-10-14 14:52:42 +02:00
Hendrik Leppkes
9ccd90626f Merge commit '16b0c929621f84983b83b9735ce973acb12723bc'
* commit '16b0c929621f84983b83b9735ce973acb12723bc':
  avconv: Add loop option.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-14 14:28:20 +02:00
Ganesh Ajjanagadde
3ae98497c2 ffmpeg: modify tty state when stderr is redirected
Removes unnecessary isatty(), fixes Ticket2964

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2015-10-11 17:41:15 -04:00
Ganesh Ajjanagadde
2f4374fae1 ffmpeg: avoid possible undefined behavior
On lines 1633,1634 FFABS(pts) is performed. However, if av_stream_get_end_pts
returns AV_NOPTS_VALUE always, pts remains stuck at INT64_MIN, leading
to undefined behavior on FFABS.

One could conceive of a solution using FFNABS. However, such a solution
has to deal with the implementation defined rounding of integer division
with at least one negative operand in ANSI C89. C99 forces truncation to
zero, but I am not sure that all of our platforms compile with full C99
support, and in particular whether we can safely assume a fixed
rounding behavior across all platforms.

This solution is simple, and I doubt changing INT64_MIN to INT64_MIN + 1
has any practical loss - if it is stuck at its initial value, the stream
is messed up anyway.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-09 21:19:39 +02:00
Hendrik Leppkes
580c4fc98a Merge commit '6064f697a321174232a3fad351afb21150c3e9e5'
* commit '6064f697a321174232a3fad351afb21150c3e9e5':
  lavc: Enable side data only packets by default

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-12 15:12:05 +02:00
Hendrik Leppkes
83a5df54ea Remove left-over FF_API_DESTRUCT_PACKET cruft 2015-09-05 16:51:53 +02:00
Hendrik Leppkes
144fb06806 Remove left-over FF_API_AVFILTERBUFFER cruft 2015-09-05 16:27:19 +02:00
Michael Niedermayer
cf410f8fb9 ffmpeg: Drop redundant ist check
stream copy always has a input stream, it cannot use complex video/audio filters with unambigous input
Fixes CID1322348

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-04 11:42:23 +02:00
Michael Niedermayer
628a73f8f3 ffmpeg: force 128k default audio bitrate if nothing is specified and there is no specific default
This prevents breaking existing command lines in case the "ab" default is removed from libavcodec

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-28 23:07:12 +02:00
Andreas Cadhalpun
c363843a53 add missing FF_API_DESTRUCT_PACKET guards
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-22 19:16:13 +02:00
Michael Niedermayer
b3d2035ec3 ffmpeg: use av_err2str()
Found-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 12:11:09 +02:00
Michael Niedermayer
45f3d4e63e ffmpeg: Use correct codec_id for av_parser_change() check
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:37:32 +02:00
Michael Niedermayer
ac0ba6f233 ffmpeg: Check av_parser_change() for failure
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:37:32 +02:00
Michael Niedermayer
c8890941d6 ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
The null muxer has AVFMT_RAWPICTURE set but can be fed with non-raw material

related to Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:37:09 +02:00
Michael Niedermayer
15ff3f3fdf ffmpeg: check avpicture_fill() return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:18:57 +02:00
Ronald S. Bultje
229843aa35 Replace av_dlog with ff_dlog.
ff_dlog checks compilability, and is non-public. av_dlog is deprecated
and no longer exists if FF_API_DLOG=0.
2015-08-18 10:24:01 -04:00
Andreas Cadhalpun
fbc8eb6857 ffmpeg: use av_buffersrc_add_frame instead of av_buffersrc_add_ref
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-16 18:17:00 +02:00
Michael Niedermayer
4ada49f9db ffmpeg: Use the decoders dimensions in sub2video_get_blank_frame()
Fixes Ticket4744 part3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-15 17:41:48 +02:00
Michael Niedermayer
bd5d11d9f5 ffmpeg: Use actual frame dimensions in checks in sub2video_update()
Fixes Ticket4744 part2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-15 17:41:48 +02:00
Michael Niedermayer
0ac83047f6 ffmpeg: Print sub2video: rectangle coordinates in case of overflows
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-15 17:41:48 +02:00
Andreas Cadhalpun
9c29aa7143 ffmpeg: replace deprecated av_log_ask_for_sample with av_log
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-12 00:14:13 +02:00
Michael Niedermayer
6dbaeed6b7 ffmpeg: switch swscale option handling to AVDictionary similar to what the other subsystems use
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-08 14:44:15 +02:00
Hendrik Leppkes
99f8fc725d ffmpeg: remove access to private FILE struct members on Windows
The FILE struct is opaque in MSVC 2015, and the members of this struct
were never meant to be accessed in any case.

No conditions are known where this check was needed to get characters
from stdin.
2015-08-04 20:05:18 +02:00
Hendrik Leppkes
2ab5002e3c ffmpeg: avoid scanf in keyboard command parsing
Mixing stdio and low-level IO on stdin is not safe.
2015-08-04 20:04:53 +02:00
Michael Niedermayer
d2077c860e Revert "ffmpeg: modify tty state when stderr is redirected"
faults in fate otherwise breaks the terminal.
To reproduce, add a abort() into wav_read_header()
run make fate-acodec-adpcm-ima_wav

This reverts commit 92e62f49cf.
2015-07-30 23:49:54 +02:00