]> git.sesse.net Git - nageru/blob - defs.h
Release Nageru 1.7.2.
[nageru] / defs.h
1 #ifndef _DEFS_H
2 #define _DEFS_H
3
4 #include <libavformat/version.h>
5
6 // This flag is only supported in FFmpeg 3.3 and up, and we only require 3.1.
7 #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 39, 100)
8 #define MUX_SKIP_TRAILER "+skip_trailer"
9 #else
10 #define MUX_SKIP_TRAILER ""
11 #endif
12
13 #define OUTPUT_FREQUENCY 48000  // Currently needs to be exactly 48000, since bmusb outputs in that.
14 #define MAX_FPS 60
15 #define FAKE_FPS 25  // Must be an integer.
16 #define MAX_VIDEO_CARDS 16
17 #define MAX_ALSA_CARDS 16
18 #define MAX_BUSES 256  // Audio buses.
19
20 // For deinterlacing. See also comments on InputState.
21 #define FRAME_HISTORY_LENGTH 5
22
23 #define AUDIO_OUTPUT_CODEC_NAME "pcm_s32le"
24 #define DEFAULT_AUDIO_OUTPUT_BIT_RATE 0
25 #define DEFAULT_X264_OUTPUT_BIT_RATE 4500  // 5 Mbit after making room for some audio and TCP overhead.
26
27 #define LOCAL_DUMP_PREFIX "record-"
28 #define LOCAL_DUMP_SUFFIX ".nut"
29 #define DEFAULT_STREAM_MUX_NAME "nut"  // Only for HTTP. Local dump guesses from LOCAL_DUMP_SUFFIX.
30 #define DEFAULT_HTTPD_PORT 9095
31 #define MUX_OPTS { \
32         /* Make seekable .mov files, and keep MP4 muxer from using unlimited amounts of memory. */ \
33         { "movflags", "empty_moov+frag_keyframe+default_base_moof" MUX_SKIP_TRAILER }, \
34         \
35         /* Make for somewhat less bursty stream output when using .mov. */ \
36         { "frag_duration", "125000" }, \
37         \
38         /* Keep nut muxer from using unlimited amounts of memory. */ \
39         { "write_index", "0" } \
40 }
41
42 // In bytes. Beware, if too small, stream clients will start dropping data.
43 // For mov, you want this at 10MB or so (for the reason mentioned above),
44 // but for nut, there's no flushing, so such a large mux buffer would cause
45 // the output to be very uneven.
46 #define MUX_BUFFER_SIZE 10485760
47
48 // In number of frames. Comes in addition to any internal queues in x264
49 // (frame threading, lookahead, etc.).
50 #define X264_QUEUE_LENGTH 50
51
52 #define X264_DEFAULT_PRESET "ultrafast"
53 #define X264_DEFAULT_TUNE "film"
54
55 #endif  // !defined(_DEFS_H)