]> git.nihav.org Git - nihav-encoder.git/blobdiff - src/main.rs
update null sink for newly introduced stream duration
[nihav-encoder.git] / src / main.rs
index de13de930c45e3ce366e23c68b1d1e785a38c47a..0f1109c789a50a38a42e1a822c876cb98248396d 100644 (file)
@@ -399,7 +399,7 @@ impl Transcoder {
         }
         true
     }
-    fn apply_decoder_options(&self, dec: &mut NADecoder, str_id: u32) {
+    fn apply_decoder_options(&self, dec: &mut dyn NADecoder, str_id: u32) {
         if let Some(str_idx) = self.istr_opts.iter().position(|str| str.id == str_id) {
             let dec_opts = dec.get_supported_options();
             if dec_opts.is_empty() { return; }
@@ -603,7 +603,7 @@ println!("stream {} ({}) can't be handled", istr.id, istr.get_info().get_name())
     }
 }
 
-fn encode_frame(dst_id: u32, encoder: &mut Box<NAEncoder>, cvt: &mut OutputConvert, frm: NAFrameRef) -> bool {
+fn encode_frame(dst_id: u32, encoder: &mut Box<dyn NAEncoder>, cvt: &mut OutputConvert, frm: NAFrameRef) -> bool {
     let buf = frm.get_buffer();
     let cbuf = match cvt {
             OutputConvert::None => buf,
@@ -653,7 +653,30 @@ fn main() {
     let args: Vec<_> = env::args().collect();
 
     if args.len() == 1 {
-        println!("usage: nihav-encoder [-noout] [-vn] [-an] input [lastpts]");
+        println!("usage: nihav-encoder [options] --input inputfile --output outputfile");
+        println!(" use nihav-encoder --help to list all available options");
+        return;
+    }
+    if args.len() == 2 && (args[1] == "--help" || args[1] == "-h") {
+        println!("usage: nihav-encoder [options] --input inputfile --output outputfile");
+        println!(" query options:");
+        println!("  --list-{{decoders,encoders,demuxers,muxers}} - lists all available decoders/encoders/demuxers/muxers");
+        println!("  --query-{{decoder,encoder,demuxer,muxer}}-options name - lists all options recognized by that decoder/encoder/demuxer/muxer");
+        println!(" processing options:");
+        println!("  --input inputfile           - set input file");
+        println!("  --input-format fmt          - force input format");
+        println!("  --demuxer-options options   - set input demuxer options");
+        println!("  --output outputfile         - set output file");
+        println!("  --output-format fmt         - force output format");
+        println!("  --muxer-options options     - set output muxer options");
+        println!("  --no-audio                  - do not decode audio streams");
+        println!("  --no-video                  - do not decode video streams");
+        println!("  --start starttime           - start decoding from given position");
+        println!("  --end endtime               - end decoding at given position");
+        println!("  --istreamX options          - set options for input stream X");
+        println!("  --ostreamX options          - set options for output stream X");
+        println!();
+        println!(" (de)muxer and stream options are passed as comma-separated list e.g. --ostream0 width=320,height=240,flip");
         return;
     }