diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/options.c | 38 | ||||
-rw-r--r-- | src/options.h | 5 | ||||
-rw-r--r-- | src/sydra.c | 2 |
3 files changed, 19 insertions, 26 deletions
diff --git a/src/options.c b/src/options.c index 684a1d3..b4e5971 100644 --- a/src/options.c +++ b/src/options.c @@ -208,13 +208,12 @@ int options_parse(options_t* opt, int argc, char* argv[]) PARSE_STRING_PARAM("-vs","--video-source", opt->video_src_) PARSE_STRING_PARAM("-ve","--video-encoder", opt->video_enc_) PARSE_STRING_PARAM("-vp","--video-payloader", opt->video_payloader_) - PARSE_STRING_PARAM("-V","--videosink", opt->videosink_) PARSE_STRING_PARAM("-as","--audio-source", opt->audio_src_) - PARSE_STRING_PARAM("-ae","--audio-encoder-stream", opt->audio_enc_stream_) + PARSE_STRING_PARAM("-ae","--audio-encoder", opt->audio_enc_) PARSE_STRING_PARAM("-ap","--audio-payloader", opt->audio_payloader_) PARSE_STRING_PARAM("-o","--rtp-host", opt->rtp_host_) PARSE_INT_PARAM("-O","--rtp-port-base", opt->rtp_port_base_, 10) - PARSE_STRING_PARAM("-ar","--audio-encoder-rec", opt->audio_enc_rec_) + PARSE_STRING_PARAM("-V","--videosink", opt->preview_videosink_) PARSE_STRING_PARAM("-m","--rec-mux", opt->rec_mux_) PARSE_STRING_PARAM("-r","--rec-name-format", opt->rec_name_format_) else @@ -262,19 +261,18 @@ void options_default(options_t* opt) opt->video_src_ = strdup("v4l2src ! videoconvert ! videoscale ! video/x-raw,format=I420,width=864,height=480,framerate=25/1,pixel-aspect-ratio=1/1 ! identity"); opt->video_enc_ = strdup("vp8enc keyframe-max-dist=25 error-resilient=2 end-usage=1 target-bitrate=1800000 cpu-used=4 deadline=1000000 threads=2"); opt->video_payloader_ = strdup("rtpvp8pay"); - opt->videosink_ = strdup("xvimagesink"); opt->audio_src_ = strdup("autoaudiosrc ! audio/x-raw,format=S16LE,channels=1,rate=48000 ! identity"); - opt->audio_enc_stream_ = strdup("opusenc bitrate=64000 cbr=true packet-loss-percentage=0 inband-fec=false"); + opt->audio_enc_ = strdup("opusenc bitrate=64000 cbr=true packet-loss-percentage=0 inband-fec=false"); opt->audio_payloader_ = strdup("rtpopuspay"); opt->rtp_host_ = strdup("127.0.0.1"); opt->rtp_port_base_ = 5100; - opt->audio_enc_rec_ = strdup("audioconvert ! vorbisenc bitrate=96000"); - opt->rec_mux_ = strdup("matroskamux"); + opt->preview_videosink_ = strdup("xvimagesink"); - opt->rec_name_format_ = strdup("./recordings/%Y-%m-%d_%H-%M-%S.mkv"); + opt->rec_mux_ = strdup("oggmux"); + opt->rec_name_format_ = strdup("./recordings/%Y-%m-%d_%H-%M-%S.ogg"); } void options_clear(options_t* opt) @@ -301,18 +299,16 @@ void options_clear(options_t* opt) free(opt->video_enc_); if(opt->video_payloader_) free(opt->video_payloader_); - if(opt->videosink_) - free(opt->videosink_); if(opt->audio_src_) free(opt->audio_src_); - if(opt->audio_enc_stream_) - free(opt->audio_enc_stream_); + if(opt->audio_enc_) + free(opt->audio_enc_); if(opt->audio_payloader_) free(opt->audio_payloader_); if(opt->rtp_host_) free(opt->rtp_host_); - if(opt->audio_enc_rec_) - free(opt->audio_enc_rec_); + if(opt->preview_videosink_) + free(opt->preview_videosink_); if(opt->rec_mux_) free(opt->rec_mux_); if(opt->rec_name_format_) @@ -332,17 +328,16 @@ void options_print_usage() printf(" [-L|--log] <target>:<level>[,<param1>[,<param2>..]]\n"); printf(" add a log target, can be invoked several times\n"); printf(" [-U|--debug] don't daemonize and log to stdout with maximum log level\n"); - printf(" [-n|--appname] <name> set the application name (will be used by xvimagesink for window title\n"); + printf(" [-n|--appname] <name> set the application name (will be used by xvimagesink for window title)\n"); printf(" [-vs|--video-source pipeline for raw video (i.e. videotestsrc)\n"); printf(" [-ve|--video-encoder pipeline for video encoder (stream and recording)\n"); - printf(" [-vp|--video-payloader video payloader element (i.e. rtpvp8pay\n"); - printf(" [-V|--videosink video sink element (i.e. xvimagesink\n"); + printf(" [-vp|--video-payloader video payloader element (i.e. rtpvp8pay)\n"); printf(" [-as|--audio-source pipeline for raw audio (audiotestsrc)\n"); - printf(" [-ae|--audio-encoder-stream pipeline for audio encoder (stream only)\n"); + printf(" [-ae|--audio-encoder pipeline for audio encoder (stream only)\n"); printf(" [-ap|--audio-payloader audio payloader element (i.e. rptopuspay)\n"); printf(" [-o|--rtp-host remote host for RTP packets\n"); printf(" [-O|--rtp-port-base base number for remote ports\n"); - printf(" [-ar|--audio-encoder-rec pipeline for audio encoder (recording only)\n"); + printf(" [-V|--videosink video sink element for local preview (i.e. xvimagesink)\n"); printf(" [-m|--rec-mux muxer elemenent (i.e. matroskamux)\n"); printf(" [-r|--rec-name-format] <format> the recording file name format, see manpage of strftime for the syntax\n"); } @@ -371,13 +366,12 @@ void options_print(options_t* opt) printf(" video_src: >>%s<<\n", opt->video_src_); printf(" video_enc: >>%s<<\n", opt->video_enc_); printf(" video_payloader: >>%s<<\n", opt->video_payloader_); - printf(" video_sink: >>%s<<\n", opt->videosink_); printf(" audio_src: >>%s<<\n", opt->audio_src_); - printf(" audio_enc_stream: >>%s<<\n", opt->audio_enc_stream_); + printf(" audio_enc: >>%s<<\n", opt->audio_enc_); printf(" audio_payloader: >>%s<<\n", opt->audio_payloader_); printf(" rtp_host: >>%s<<\n", opt->rtp_host_); printf(" rtp_port_base: %d\n", opt->rtp_port_base_); - printf(" audio_enc_rec: >>%s<<\n", opt->audio_enc_rec_); + printf(" preview_video_sink: >>%s<<\n", opt->preview_videosink_); printf(" rec_mux: >>%s<<\n", opt->rec_mux_); printf(" rec_name_format: '%s'\n", opt->rec_name_format_); } diff --git a/src/options.h b/src/options.h index 4b11723..7231347 100644 --- a/src/options.h +++ b/src/options.h @@ -55,16 +55,15 @@ struct options_struct { char* video_src_; char* video_enc_; char* video_payloader_; - char* videosink_; char* audio_src_; - char* audio_enc_stream_; + char* audio_enc_; char* audio_payloader_; char* rtp_host_; int rtp_port_base_; - char* audio_enc_rec_; + char* preview_videosink_; char* rec_mux_; char* rec_name_format_; }; diff --git a/src/sydra.c b/src/sydra.c index 2c03b92..e366ba4 100644 --- a/src/sydra.c +++ b/src/sydra.c @@ -332,7 +332,7 @@ static GstElement* create_pipeline(options_t* opt) opt->video_enc_, NULL, NULL, opt->video_payloader_, NULL }; struct media_elements audio = { "audio", opt->audio_src_, NULL, NULL, - opt->audio_enc_stream_, NULL, NULL, + opt->audio_enc_, NULL, NULL, opt->audio_payloader_, NULL }; if(!create_media_elements(&video, pipeline, rtp, 0) || !create_media_elements(&audio, pipeline, rtp, 1) || |