ltc-tools icon indicating copy to clipboard operation
ltc-tools copied to clipboard

[QUESTION] Can ltcgen create realtime output to stdout/pipe?

Open bbgdzxng1 opened this issue 3 years ago • 0 comments

I'm looking to pipe output from ltcgen to stdout so that an LTC containing can be continuously multi/broadcast over the network using a secondary tool like FFmpeg or similar. [I appreciate that transcoding and selection of output protocol will add latency and inaccuracy to the timecode].

Pre-generating a file works as expected.

$ ltcgen --fps "30000/1001df" --duration "00:01:00:00" "out.wav" && ffmpeg -re -hide_banner -channel_layout "mono" -i "out.wav" -channel_layout "mono" -codec:a "mp2" -f "mpegts" "udp://239.0.0.1:1234?ttl=1"

However, if I attempt the same output with piped output via stdout, the pipeline will fail.

$ ltcgen --fps "30000/1001df" --duration 0 - | ffmpeg -hide_banner -channel_layout "mono" -i - -codec:a "mp2" -f "mpegts" "udp://239.0.0.1:1234?ttl=1"

Is there a way to use ltcgen to generate a realtime output to stdout, suitable for use with pipes or FIFO named pipes?

I'm using ltcgen version 0.7.0...

~ $ ltcgen --version
ltcgen 0.7.0

Copyright (C) 2012 Robin Gareus <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~ $ ltcgen --help
ltcgen - generate linear time code audio-file.
Usage: ltcgen [OPTION] <output-file>

Options:
 -d, --date datestring      set date, format is either DDMMYY or MM/DD/YY
 -f, --fps fps              set frame-rate NUM[/DEN][ndf|df] default: 25/1ndf 
 -g, --volume float         set output level in dBFS default -18db
 -h, --help                 display this help and exit
 -l, --duration time        set duration of file to encode [[[HH:]MM:]SS:]FF.
 -m, --timezone tz          set timezone in minutes-west of UTC
 -r, --reverse              encode backwards from start-time
 -s, --samplerate sr        specify samplerate (default 48000)
 -t, --timecode time        specify start-time/timecode [[[HH:]MM:]SS:]FF
 -u, --userbits bcd         specify fixed BCD user bits (max. 8 BCD digits)
                            CAUTION: This ignores any date/timezone settings!
 -V, --version              print version information and exit
 -z, --timezone tz          set timezone +HHMM

Unless a timecode (-t) is given, the current time/date are used.
Date (-d) and timezone (-z, -m) are only used if a timecode is given.
The timezome may be specified either as HHMM zone, or in minutes-west of UTC.

If the duration is <=0, ltcgen write until it receives SIGINT.

The output file-format is WAV, signed 16 bit, mono.

Report bugs to <[email protected]>.
Website and manual: <https://github.com/x42/ltc-tools>

Thanks

bbgdzxng1 avatar Oct 30 '21 23:10 bbgdzxng1