]> git.sesse.net Git - nageru/blob - defs.h
Support setting x264 bitrate parameters from the command line.
[nageru] / defs.h
1 #ifndef _DEFS_H
2 #define _DEFS_H
3
4 #define OUTPUT_FREQUENCY 48000
5 #define MAX_FPS 60
6 #define WIDTH 1280
7 #define HEIGHT 720
8 #define MAX_CARDS 16
9
10 // For deinterlacing. See also comments on InputState.
11 #define FRAME_HISTORY_LENGTH 5
12
13 #define AUDIO_OUTPUT_CODEC_NAME "pcm_s32le"
14 #define DEFAULT_AUDIO_OUTPUT_BIT_RATE 0
15 #define DEFAULT_X264_OUTPUT_BIT_RATE 4500  // 5 Mbit after making room for some audio and TCP overhead.
16
17 #define LOCAL_DUMP_PREFIX "record-"
18 #define LOCAL_DUMP_SUFFIX ".nut"
19 #define DEFAULT_STREAM_MUX_NAME "nut"  // Only for HTTP. Local dump guesses from LOCAL_DUMP_SUFFIX.
20 #define MUX_OPTS { \
21         /* Make seekable .mov files. */ \
22         { "movflags", "empty_moov+frag_keyframe+default_base_moof" }, \
23         \
24         /* Make for somewhat less bursty stream output when using .mov. */ \
25         { "frag_duration", "125000" }, \
26         \
27         /* Keep nut muxer from using unlimited amounts of memory. */ \
28         { "write_index", "0" } \
29 }
30
31 // In bytes. Beware, if too small, stream clients will start dropping data.
32 // For mov, you want this at 10MB or so (for the reason mentioned above),
33 // but for nut, there's no flushing, so such a large mux buffer would cause
34 // the output to be very uneven.
35 #define MUX_BUFFER_SIZE 10485760
36
37 // In number of frames. Comes in addition to any internal queues in x264
38 // (frame threading, lookahead, etc.).
39 #define X264_QUEUE_LENGTH 50
40
41 #define X264_DEFAULT_PRESET "ultrafast"
42 #define X264_DEFAULT_TUNE "film"
43
44 #endif  // !defined(_DEFS_H)