Commit Graph

7993 Commits

Author SHA1 Message Date
Martin Piatka
ce2a3eca46 tools/thumbnailgen: Don't busywait for connection 2023-06-16 13:43:02 +02:00
Martin Piatka
2651e5caf5 tools/ipc_frame_unix: Add blocking wait for connect 2023-06-16 13:43:02 +02:00
Martin Piatka
f4360d107d tools/thumbnailgen: Don't reinitialize jpeg ctx on each frame 2023-06-16 13:43:02 +02:00
Martin Piatka
a01475050c tools: Add preview thumbnail generator 2023-06-16 13:43:01 +02:00
Martin Pulec
efa621163b vidcap file: flush decoder context on seek
Also check if ring_buffer is available before flushing it, it crashes
without audio.
2023-06-16 12:22:44 +02:00
Martin Pulec
c6350eb030 vidcap file: use frame size from AVFrame
AVCodecContext doesn't need to have the actual sample count always set
(as does not AC3 in Elephants Dream render).
2023-06-16 09:19:29 +02:00
Martin Pulec
16d11f013d AppRun Filejail: whitelist -t file:<name> 2023-06-15 16:43:46 +02:00
Martin Pulec
e1b28f83d6 keyboard_control: option to force in gdb
doesn't seem to be necessary at least since gdb 9.2 in Ubuntu 20.04
2023-06-15 16:14:08 +02:00
Martin Pulec
3a0a1d450f vidcap file: use ring buffer for data
Use ring-buffer instead of raw data, where the remaining data must have
been memmoved.
2023-06-15 14:05:34 +02:00
Martin Pulec
e4d4510068 vidcap file: print also PTS (+fix unit)
Print also decompressed video pts - this is useful to match the delay
with corresponding received video packet.

+ fixed duration unit (not nanoseconds but seconds)
2023-06-15 11:29:58 +02:00
Martin Pulec
3ab44b2074 vidcap file: print pkt timebase+dur (debug only)
This allows to evaluate exact pts/dts values, not only the value
converted to (double) seconds.

+ moved all the stuff to a separate function
2023-06-15 11:29:58 +02:00
Martin Pulec
19abf7a9ab vidcap_file_worker: refactored
Mostly idempotent, only functional differences is that packet is
unreferenced at the beginning of while-loop (unreferencing not
referenced packet snoldn't hurt).

+ fixed wrong time unit for decompressing duration
2023-06-15 11:29:58 +02:00
Martin Pulec
4db0975c60 vidcap_file_worker: needless reallocation removed 2023-06-15 11:29:58 +02:00
Martin Pulec
ef751e16ff print_decoder_error: no extra space after mod_name
mod_name usually already contains trailing space (eg. "[lavd] ") so do
not produce an extra one.

+ reindent
2023-06-15 11:29:58 +02:00
Martin Pulec
cd42c7a6c2 vidcap file: simplify vid dec err handling
+ specify if failed when sending packed or receiving frame
2023-06-15 11:29:58 +02:00
Martin Pulec
da178fe3de vidcap file: seek - flush buffers
At the beginning, there may be several audio frames decoded prior to
first video frame successfully decoded, which is unnecessary after the
seek.

see also GH-322
2023-06-15 11:29:53 +02:00
Martin Pulec
2e52cd4528 vidcap file: print video frame type
used in GH-322 comment
2023-06-14 13:51:00 +02:00
Martin Pulec
c4dcc5051b vidcap file: s/clampi/CLAMP/
Replaced clampi with CLAMP - since the clampi is the only use of the
function, it can be removed.
2023-06-14 12:04:04 +02:00
Martin Pulec
2a9acfce33 vidcap file: dump FF format in verbose 2023-06-14 11:04:44 +02:00
Martin Pulec
d9bd7aa84f vidcap file: reformat
mostly refactoring - moved video init code to a function. Only change is
that video AVCodec is now not set by av_find_best_stream() but
avcodec_find_decoder() (but it is consistent how the original FFmpeg
demux_decode.c example does it).
2023-06-14 11:04:42 +02:00
Martin Pulec
c392d8983e vidcap file: fix setting interlacing when nodecod
If decoding is disabled, recent updates would cause a crash, because
s->vid_ctx is NULL. Set progressive in this case.

+ fixed a clang warning
2023-06-14 10:03:49 +02:00
Martin Pulec
a3e576b204 vidcap file: report unknown explicitly
Older FFmpeg (as on U20.04) doesn't set the field older so be more
explicit in the error message.
2023-06-13 17:05:40 +02:00
Martin Pulec
61f0f03be0 audio.cpp: remove unused rang references 2023-06-13 16:35:49 +02:00
Martin Pulec
83f8d55913 audio codec: do not pass empty channels to dec
libavcodec audio decoder has assertion on channel non-emptiness (which
is perhpas correct - there cannot be anything done there) so do not pass
emtpy channels.

refer to GH-316
2023-06-13 16:06:11 +02:00
Martin Pulec
e665af8927 vidcap file: noop for audio if unneeded
+ removed an include added by mistake (is not availablie in older FFmpeg
  and not necessarily needed in current)
2023-06-13 15:07:16 +02:00
Martin Pulec
f41c516b17 REPORTING-BUGS.md: minimal working->broken sample 2023-06-13 14:23:23 +02:00
Martin Pulec
ea64814da6 main: added audio-codec shortopt
Most prospective shorcuts (A/C/a/c) were already takem, so using
'u' as in aUdio-codec.
2023-06-13 14:21:06 +02:00
Martin Pulec
c6f3d372ee vidcap file: support for interlaced file
closes GH-321
2023-06-13 13:37:45 +02:00
Martin Pulec
1970b34ccd vidcap file: print video video_desc not only size
+ log as INFO

refer to GH-321
2023-06-13 13:22:32 +02:00
Martin Pulec
2d29ea28c7 video lavc: print reconfigured format in debug 2023-06-13 12:19:34 +02:00
Martin Pulec
1328564352 get_video_desc_from_string: added 1080i59-like syntax 2023-06-13 12:04:39 +02:00
Martin Pulec
5761bb8bbb vidcap file: added seek option 2023-06-13 11:38:01 +02:00
Martin Pulec
87be38ed23 vidcap file: allow tilda (~) shortcut 2023-06-13 10:20:55 +02:00
Martin Pulec
10ddebf68e fixed CID 40892{2,3,5} 2023-06-13 09:13:40 +02:00
Martin Pulec
eab5c08294 screen_x11: removed custom FPS indicator
As now screen_linux requests generic indicator, if screen_x11 were
initialized with screen_linux, FPS would be printed twice.
2023-06-12 15:31:59 +02:00
Martin Pulec
c5213dc0fa screen_linux: use generic indicator
screen_pw uses generic indicator but whe initialized with `-t screen`,
it won't be used

+ updated the description for generic_fps_indicator_prefix (the
  semantics changed slightly)
2023-06-12 15:27:20 +02:00
Martin Pulec
d7082b647e vidcap: missing audio notavail checks 2023-06-12 15:22:26 +02:00
Martin Pulec
64f2bb7da4 video_capture: fixed a typo in macro name 2023-06-12 13:27:13 +02:00
Martin Pulec
5029aa2258 CoreAudio: allow selection by name (substring) 2023-06-12 13:21:55 +02:00
Martin Pulec
83d819600e CoreAudio play: print more errors
Avoid the cases when there some error occurs but nothing is printed to
the output.
2023-06-12 11:37:23 +02:00
Martin Pulec
683ddaf381 CoreAudio: removed OS X 10.5 compat
Mac OS X 10.5 is unsupported by Apple for more than 10 years and it is
questionable if UltraGrid even compiles there. There is no indication
(requests, questions) that anyone uses that.
2023-06-12 11:35:13 +02:00
Martin Pulec
4be9decd7e CoreAudio small help fixes 2023-06-12 11:13:29 +02:00
Martin Pulec
f062be0f89 WASAPI cap.: support for loopback 2023-06-12 10:59:16 +02:00
Martin Pulec
9b76fb62b0 vidcap aggregate: pass parent to slaves
See also a24e194d (similar change for switcher). This patch is slightly
different because the slaves are connected to aggregate parent (it
doesn't initialize own module) whereas switcher has the state and acts
as a parent to its slaves. Shouldn't make much difference if path to the
module isn't important.

This fixes vidcap _file_ requiring root to register keybindings.
2023-06-09 16:13:39 +02:00
Martin Pulec
83526c4240 aggregate,switcher: set audio connection to all devs
When specified:

1. `uv -t embedded -t switcher -t testcard -t testcard`
2. `uv -t embedded -t switcher -t testcard -s analog -t decklink`

First example set the _embedded_ audio connection to both testcards. In
the second example, _embedded_ is set only for the first device
(testcard) whereas for decklink the user specified _analog_ is not
overriden.
2023-06-09 16:13:39 +02:00
Martin Pulec
67385e37ae set acap to vidcap even when set after
Previous commit modified the behavior that audio connection (embedded et
al.) specification is applied to following capture. To be more
user-friendly when there is only one vidcap device, set the audio also
to previous device (similarly it has been done for -F), so:

   uv -s embedded -t testcard
   uv -t testcard -s embedded  # <- this now works again
   uv -t switcher -t testcard -s embedded # this doesn't (ambigous)
2023-06-09 16:13:39 +02:00
Martin Pulec
a25b285e25 main: make audio cap opt relative to video
`-s` parameter now sets audio only to following video capture, just like
`-F` (capture filter) does.

This allows different setting for different audio connectors for
different video sources, namely for switcher, eg.:

    uv -t switcher -s analog -t decklink:device=1 -s embedded -t \
      decklink:device=2

refer to GH-318
2023-06-09 16:13:11 +02:00
Martin Pulec
813725cacf vidcap testcard: check FPS positivity 2023-06-09 13:56:38 +02:00
Martin Pulec
544c9e3d23 GL display: print compiled features 2023-06-09 13:56:34 +02:00
Martin Pulec
854b4a9777 vidcap testcard: set color_spec,fps later
set fps and color spec to 0 and set to default if not changed by
command-line

- this allows setting mode=4k (which doesn't set FPS)
- pixfmt_default variable is no longer needed
2023-06-09 12:26:40 +02:00