Skip to content

Commit

Permalink
Merge remote branch 'qatar/master'
Browse files Browse the repository at this point in the history
* qatar/master:
  Handle unicode file names on windows
  rtp: Rename the open/close functions to alloc/free
  Lowercase all ff* program names.
  Refer to ff* tools by their lowercase names.
NOT Pulled  Replace more FFmpeg instances by Libav or ffmpeg.
  Replace `` by $() syntax in shell scripts.
  patcheck: Allow overiding grep program(s) through environment variables.
NOT Pulled  Remove stray libavcore and _g binary references.
  vorbis: Rename decoder/encoder files to follow general file naming scheme.
  aacenc: Fix whitespace after last commit.
  cook: Fix small typo in av_log_ask_for_sample message.
  aacenc: Finish 3GPP psymodel analysis for non mid/side cases.
  Remove RDFT dependency from AAC decoder.
  Add some debug log messages to AAC extradata
  Fix mov debug (u)int64_t format strings.
  bswap: use native types for av_bwap16().
  doc: FLV muxing is supported.
  applehttp: Handle AES-128 encrypted streams
  Add a protocol handler for AES CBC decryption with PKCS7 padding
  doc: Mention that DragonFly BSD requires __BSD_VISIBLE set

Conflicts:
	ffplay.c
	ffprobe.c

Merged-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 24, 2011
2 parents c225615 + b1ac139 commit 7b376b3
Show file tree
Hide file tree
Showing 45 changed files with 818 additions and 139 deletions.
63 changes: 63 additions & 0 deletions cmdutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,76 @@ static const OptionDef* find_option(const OptionDef *po, const char *name){
return po;
}

#if defined(_WIN32) && !defined(__MINGW32CE__)
/* Will be leaked on exit */
static char** win32_argv_utf8 = NULL;
static int win32_argc = 0;

/**
* Prepare command line arguments for executable.
* For Windows - perform wide-char to UTF-8 conversion.
* Input arguments should be main() function arguments.
* @param argc_ptr Arguments number (including executable)
* @param argv_ptr Arguments list.
*/
static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
{
char *argstr_flat;
wchar_t **argv_w;
int i, buffsize = 0, offset = 0;

if (win32_argv_utf8) {
*argc_ptr = win32_argc;
*argv_ptr = win32_argv_utf8;
return;
}

win32_argc = 0;
argv_w = CommandLineToArgvW(GetCommandLineW(), &win32_argc);
if (win32_argc <= 0 || !argv_w)
return;

/* determine the UTF-8 buffer size (including NULL-termination symbols) */
for (i = 0; i < win32_argc; i++)
buffsize += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
NULL, 0, NULL, NULL);

win32_argv_utf8 = av_mallocz(sizeof(char*) * (win32_argc + 1) + buffsize);
argstr_flat = (char*)win32_argv_utf8 + sizeof(char*) * (win32_argc + 1);
if (win32_argv_utf8 == NULL) {
LocalFree(argv_w);
return;
}

for (i = 0; i < win32_argc; i++) {
win32_argv_utf8[i] = &argstr_flat[offset];
offset += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
&argstr_flat[offset],
buffsize - offset, NULL, NULL);
}
win32_argv_utf8[i] = NULL;
LocalFree(argv_w);

*argc_ptr = win32_argc;
*argv_ptr = win32_argv_utf8;
}
#else
static inline void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
{
/* nothing to do */
}
#endif /* WIN32 && !__MINGW32CE__ */

void parse_options(int argc, char **argv, const OptionDef *options,
void (* parse_arg_function)(const char*))
{
const char *opt, *arg;
int optindex, handleoptions=1;
const OptionDef *po;

/* perform system-dependent conversions for arguments list */
prepare_app_arguments(&argc, &argv);

/* parse options */
optindex = 1;
while (optindex < argc) {
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ mdct_select="fft"
rdft_select="fft"

# decoders / encoders / hardware accelerators
aac_decoder_select="mdct rdft sinewin"
aac_decoder_select="mdct sinewin"
aac_encoder_select="mdct sinewin"
aac_latm_decoder_select="aac_decoder aac_latm_parser"
ac3_decoder_select="mdct ac3dsp ac3_parser"
Expand Down
4 changes: 2 additions & 2 deletions doc/faq.texi
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Just create an "input.avs" text file with this single line ...
@example
DirectShowSource("C:\path to your file\yourfile.asf")
@end example
... and then feed that text file to FFmpeg:
... and then feed that text file to ffmpeg:
@example
ffmpeg -i input.avs
@end example
Expand Down Expand Up @@ -348,7 +348,7 @@ ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
rm temp[12].[av] all.[av]
@end example

@section FFmpeg does not adhere to the -maxrate setting, some frames are bigger than maxrate/fps.
@section The ffmpeg program does not respect the -maxrate setting, some frames are bigger than maxrate/fps.

Read the MPEG spec about video buffer verifier.

Expand Down
32 changes: 15 additions & 17 deletions doc/ffmpeg.texi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
\input texinfo @c -*- texinfo -*-

@settitle FFmpeg Documentation
@settitle ffmpeg Documentation
@titlepage
@center @titlefont{FFmpeg Documentation}
@center @titlefont{ffmpeg Documentation}
@end titlepage

@top
Expand All @@ -22,17 +22,15 @@ ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{
@chapter Description
@c man begin DESCRIPTION

FFmpeg is a very fast video and audio converter. It can also grab from
a live audio/video source.
ffmpeg is a very fast video and audio converter that can also grab from
a live audio/video source. It can also convert between arbitrary sample
rates and resize video on the fly with a high quality polyphase filter.

The command line interface is designed to be intuitive, in the sense
that FFmpeg tries to figure out all parameters that can possibly be
that ffmpeg tries to figure out all parameters that can possibly be
derived automatically. You usually only have to specify the target
bitrate you want.

FFmpeg can also convert from any sample rate to any other, and resize
video on the fly with a high quality polyphase filter.

As a general rule, options are applied to the next specified
file. Therefore, order is important, and you can have the same
option on the command line multiple times. Each occurrence is
Expand Down Expand Up @@ -61,7 +59,7 @@ ffmpeg -r 1 -i input.m2v -r 24 output.avi

The format option may be needed for raw input files.

By default, FFmpeg tries to convert as losslessly as possible: It
By default ffmpeg tries to convert as losslessly as possible: It
uses the same audio and video parameters for the outputs as the one
specified for the inputs.

Expand Down Expand Up @@ -495,7 +493,7 @@ Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
macroblock decision
@table @samp
@item 0
FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in FFmpeg).
FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in ffmpeg).
@item 1
FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
@item 2
Expand Down Expand Up @@ -877,22 +875,22 @@ It allows almost lossless encoding.

@section Video and Audio grabbing

FFmpeg can grab video and audio from devices given that you specify the input
format and device.
If you specify the input format and device then ffmpeg can grab video
and audio directly.

@example
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
@end example

Note that you must activate the right video source and channel before
launching FFmpeg with any TV viewer such as xawtv
launching ffmpeg with any TV viewer such as xawtv
(@url{http://linux.bytesex.org/xawtv/}) by Gerd Knorr. You also
have to set the audio recording levels correctly with a
standard mixer.

@section X11 grabbing

FFmpeg can grab the X11 display.
Grab the X11 display with ffmpeg via

@example
ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
Expand All @@ -910,7 +908,7 @@ variable. 10 is the x-offset and 20 the y-offset for the grabbing.

@section Video and Audio file format conversion

FFmpeg can use any supported file format and protocol as input:
Any supported file format and protocol can serve as input to ffmpeg:

Examples:
@itemize
Expand All @@ -930,7 +928,7 @@ It will use the files:
The Y files use twice the resolution of the U and V files. They are
raw files, without header. They can be generated by all decent video
decoders. You must specify the size of the image with the @option{-s} option
if FFmpeg cannot guess it.
if ffmpeg cannot guess it.

@item
You can input from a raw YUV420P file:
Expand Down Expand Up @@ -1057,7 +1055,7 @@ file to which you want to add them.
@ignore
@setfilename ffmpeg
@settitle FFmpeg video converter
@settitle ffmpeg video converter
@c man begin SEEALSO
ffplay(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation
Expand Down
4 changes: 2 additions & 2 deletions doc/ffplay.texi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
\input texinfo @c -*- texinfo -*-

@settitle FFplay Documentation
@settitle ffplay Documentation
@titlepage
@center @titlefont{FFplay Documentation}
@center @titlefont{ffplay Documentation}
@end titlepage

@top
Expand Down
12 changes: 6 additions & 6 deletions doc/ffprobe.texi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
\input texinfo @c -*- texinfo -*-

@settitle FFprobe Documentation
@settitle ffprobe Documentation
@titlepage
@center @titlefont{FFprobe Documentation}
@center @titlefont{ffprobe Documentation}
@end titlepage

@top
Expand All @@ -22,7 +22,7 @@ ffprobe [options] [@file{input_file}]
@chapter Description
@c man begin DESCRIPTION

FFprobe gathers information from multimedia streams and prints it in
ffprobe gathers information from multimedia streams and prints it in
human- and machine-readable fashion.

For example it can be used to check the format of the container used
Expand All @@ -33,15 +33,15 @@ If a filename is specified in input, ffprobe will try to open and
probe the file content. If the file cannot be opened or recognized as
a multimedia file, a positive exit code is returned.

FFprobe may be employed both as a standalone application or in
ffprobe may be employed both as a standalone application or in
combination with a textual filter, which may perform more
sophisticated processing, e.g. statistical processing or plotting.

Options are used to list some of the formats supported by ffprobe or
for specifying which information to display, and for setting how
ffprobe will show it.

FFprobe output is designed to be easily parsable by a textual filter,
ffprobe output is designed to be easily parsable by a textual filter,
and consists of one or more sections of the form:
@example
[SECTION]
Expand Down Expand Up @@ -119,7 +119,7 @@ with name "STREAM".
@ignore
@setfilename ffprobe
@settitle FFprobe media prober
@settitle ffprobe media prober
@c man begin SEEALSO
ffmpeg(1), ffplay(1), ffserver(1) and the FFmpeg HTML documentation
Expand Down
18 changes: 9 additions & 9 deletions doc/ffserver.texi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
\input texinfo @c -*- texinfo -*-

@settitle FFserver Documentation
@settitle ffserver Documentation
@titlepage
@center @titlefont{FFserver Documentation}
@center @titlefont{ffserver Documentation}
@end titlepage

@top
Expand All @@ -22,12 +22,12 @@ ffserver [options]
@chapter Description
@c man begin DESCRIPTION

FFserver is a streaming server for both audio and video. It supports
ffserver is a streaming server for both audio and video. It supports
several live feeds, streaming from files and time shifting on live feeds
(you can seek to positions in the past on each live feed, provided you
specify a big enough feed storage in ffserver.conf).

FFserver runs in daemon mode by default; that is, it puts itself in
ffserver runs in daemon mode by default; that is, it puts itself in
the background and detaches from its TTY, unless it is launched in
debug mode or a NoDaemon option is specified in the configuration
file.
Expand All @@ -39,7 +39,7 @@ information.

@section How does it work?

FFserver receives prerecorded files or FFM streams from some ffmpeg
ffserver receives prerecorded files or FFM streams from some ffmpeg
instance as input, then streams them over RTP/RTSP/HTTP.

An ffserver instance will listen on some port as specified in the
Expand All @@ -57,7 +57,7 @@ file.

@section Status stream

FFserver supports an HTTP interface which exposes the current status
ffserver supports an HTTP interface which exposes the current status
of the server.

Simply point your browser to the address of the special status stream
Expand Down Expand Up @@ -249,8 +249,8 @@ For example: @samp{http://localhost:8080/test.asf?date=2002-07-26T23:05:00}.
Use @file{configfile} instead of @file{/etc/ffserver.conf}.
@item -n
Enable no-launch mode. This option disables all the Launch directives
within the various <Stream> sections. FFserver will not launch any
ffmpeg instance, so you will have to launch them manually.
within the various <Stream> sections. Since ffserver will not launch
any ffmpeg instances, you will have to launch them manually.
@item -d
Enable debug mode. This option increases log verbosity, directs log
messages to stdout and causes ffserver to run in the foreground
Expand All @@ -261,7 +261,7 @@ rather than as a daemon.
@ignore
@setfilename ffserver
@settitle FFserver video server
@settitle ffserver video server
@c man begin SEEALSO
Expand Down
4 changes: 2 additions & 2 deletions doc/general.texi
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,9 @@ to configure.
BSD make will not build FFmpeg, you need to install and use GNU Make
(@file{gmake}).

@subsubsection FreeBSD
@subsubsection FreeBSD, DragonFly BSD

FreeBSD will not compile out-of-the-box due to broken system headers.
These systems will not compile out-of-the-box due to broken system headers.
Passing @code{--extra-cflags=-D__BSD_VISIBLE} to configure will work
around the problem. This may have unexpected sideeffects, so use it at
your own risk. If you care about FreeBSD, please make an attempt at
Expand Down
4 changes: 2 additions & 2 deletions ffmpeg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* FFmpeg main
* ffmpeg main
* Copyright (c) 2000-2003 Fabrice Bellard
*
* This file is part of FFmpeg.
Expand Down Expand Up @@ -85,7 +85,7 @@

#include "libavutil/avassert.h"

const char program_name[] = "FFmpeg";
const char program_name[] = "ffmpeg";
const int program_birth_year = 2000;

/* select an input stream for an output stream */
Expand Down
4 changes: 2 additions & 2 deletions ffplay.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* FFplay : Simple Media Player based on the FFmpeg libraries
* ffplay : Simple Media Player based on the FFmpeg libraries
* Copyright (c) 2003 Fabrice Bellard
*
* This file is part of FFmpeg.
Expand Down Expand Up @@ -56,7 +56,7 @@
#include <unistd.h>
#include <assert.h>

const char program_name[] = "FFplay";
const char program_name[] = "ffplay";
const int program_birth_year = 2003;

//#define DEBUG
Expand Down
4 changes: 2 additions & 2 deletions ffprobe.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* FFprobe : Simple Media Prober based on the FFmpeg libraries
* ffprobe : Simple Media Prober based on the FFmpeg libraries
* Copyright (c) 2007-2010 Stefano Sabatini
*
* This file is part of FFmpeg.
Expand Down Expand Up @@ -28,7 +28,7 @@
#include "libavdevice/avdevice.h"
#include "cmdutils.h"

const char program_name[] = "FFprobe";
const char program_name[] = "ffprobe";
const int program_birth_year = 2007;

static int do_show_format = 0;
Expand Down
2 changes: 1 addition & 1 deletion ffserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

#include "cmdutils.h"

const char program_name[] = "FFserver";
const char program_name[] = "ffserver";
const int program_birth_year = 2000;

static const OptionDef options[];
Expand Down
Loading

0 comments on commit 7b376b3

Please sign in to comment.