45 Commits

Author SHA1 Message Date
Rien Maertens
220d387994
Add MIT License
Closes #21
2020-04-18 16:17:42 +02:00
Rien Maertens
e680dd5531
Set pixel format to rgb565le 2020-04-18 16:17:42 +02:00
Rien
057e90721d
Merge pull request #18 from beardhatcode/master
Add video4linux2 support
2020-04-14 11:57:51 +02:00
beardhatcode
9e9fbbc771 Add explaination about v4l2 2020-04-14 11:54:01 +02:00
beardhatcode
e687816421 Add video4linux2 support 2020-04-14 10:59:49 +02:00
Rien Maertens
154fbe6fe8
Split action workflow into linting and formatting 2020-04-07 11:53:11 +02:00
Rien Maertens
088d3732c4
Add examples to usage info 2020-04-07 11:48:46 +02:00
Rien
48a7ed84c3
Merge pull request #13 from matteodelabre/specify-output
Allow choosing the video output
2020-04-07 11:34:50 +02:00
Mattéo Delabre
ab6fa11982
Fix formatting 2020-04-07 11:21:10 +02:00
Mattéo Delabre
3609b990ff
Store extra ffmpeg arguments in $@ 2020-04-07 11:17:45 +02:00
Mattéo Delabre
0c707af239
Merge branch 'master' into specify-output 2020-04-07 10:55:20 +02:00
Mattéo Delabre
d0323daef5
Replace arrays with variable substitutions for POSIX compliance
Co-Authored-By: Rien <rien.maertens@posteo.be>
2020-04-07 10:48:51 +02:00
Rien Maertens
52d0187d7e
Don't use ~ in commands 2020-04-06 23:19:54 +02:00
Rien Maertens
1dfb28028d
Add GitHub workflow 2020-04-03 12:16:16 +02:00
Rien Maertens
154d15b890
Apply shellcheck and shfmt 2020-04-03 12:15:53 +02:00
Mattéo Delabre
4344903438
Fix recorded videos playing back too fast
Use the `setpts` video filter to set each frame’s presentation timestamp
to the time it is received by the encoder.
See <https://ffmpeg.org/ffmpeg-filters.html#Examples-141>.
2020-04-03 11:28:42 +02:00
Mattéo Delabre
49f20074f0
Allow choosing the video output
Instead of simply playing back the frames through `ffplay`, I thought it
might be interesting to be able to record the sequence to a video file
or to use it as part of a stream.

I have in mind the use case of making educational videos/live streams
where the tablet can be used as a kind of remote blackboard by teachers,
which is especially relevant currently. But there are certainly other
use cases!

Changes
=======

This commit adds two new options to that effect:

* `-o --output`: Path of the output as understood by `ffmpeg` (usually a
file name). If this is `-` (as it is by default), the existing behavior
of playing the stream through `ffplay` is restored.

* `-f --format`: When recording to an output, this option can be used to
force the encoding format. If this is `-` (again, the default),
`ffmpeg`’s auto format detection is used (based on the file extension).

Because of the possible confusion between the newly added `--output`
option and the existing `--destination` option for specifying the source
address, I suggest renaming the `--destination` option to `--source`
(this is implemented in this commit).

Examples
========

Record to a file
----------------

```sh
./reStream.sh -o remarkable.mp4
```

Caveat: The recorded file plays back too fast.
I am not sure how to fix this.

Create an UDP MPEG-TS stream
----------------------------

```sh
./reStream.sh -o "udp://127.0.0.1:1234" -f "mpegts"
```

This sends frames over UDP to the specified port using the MPEG-TS
format (see <https://trac.ffmpeg.org/wiki/StreamingGuide>). This stream
can then be connected, for example, to OBS for live streaming (see
<https://connect.ed-diamond.com/Linux-Pratique/LP-096/Enrichir-sa-diffusion-de-contenus-multimedias-avec-OBS>
in French).
2020-04-02 20:54:11 +02:00
Rien
d1fa399c86
Merge pull request #12 from matteodelabre/fix-destination-flag
Fix incorrect handling of flags
2020-04-02 16:39:55 +02:00
Mattéo Delabre
ac981508f7
Fix incorrect handling of flags
Previously, arguments were examined by a for loop, but this loop is not
affected by the `shift` commands executed inside of it.

Because the loop always advances one argument further on each iteration,
this bug goes unnoticed with the `--portrait` option (`shift` is called
once, which matches the behavior of the loop). However, handling of the
`--destination` argument is broken because of that (`shift` is called
twice but the loop only advances one argument).

This commit replaces the `for` loop by a `while` loop which always
examines the next argument and properly takes `shift`s into account.
This is based on the following SO answer:
<https://stackoverflow.com/a/7069755/3452708>
2020-04-02 16:17:21 +02:00
Rien Maertens
382944058e
Add parameters to README, ssh timeout to 1s
Changed the README to reflect the command line options added with
bcf62e3. Also incorporates the SSH timeout of 1 second added by the
initial PR (#10).

Co-authored-by: Aaron David Schneider <aaron.david.schneider@gmail.com>
2020-04-02 14:20:48 +02:00
Rien
bcf62e3ae7
Merge pull request #11 from AaronDavidSchneider/detailed_options
add command-line options
2020-04-02 10:59:56 +02:00
Aaron David Schneider
8465062425 change name to -d 2020-04-02 10:23:58 +02:00
Aaron David Schneider
1f63880a8e add command-line options 2020-04-01 16:51:01 +02:00
Rien Maertens
2cc3f88274
Add -p flag functionality to README 2020-03-31 15:32:20 +02:00
Rien
f2ada8f208
Merge pull request #9 from beardhatcode/master
Add -p flag for portrait
2020-03-31 15:30:38 +02:00
Robbert Gurdeep Singh
0adb3e4fdc Add -p flag for portrait 2020-03-31 15:25:30 +02:00
Rien Maertens
e5edbed205
Simple troubleshooting stuff 2020-03-30 21:35:15 +02:00
Rien Maertens
1c917c1d14
Clarify SSH key setup 2020-03-30 21:33:44 +02:00
Rien Maertens
f3f5dd40fa
SSH key and ssh-agent instructions 2020-03-30 14:54:16 +02:00
Rien Maertens
53051fbdf5
Add instructions to make lz4 executable 2020-03-25 16:33:22 +01:00
Rien Maertens
8ca1557e7b
Replace which zstd by which lz4 (forgotten)
Fixes #5. Thanks @chkgk!
2020-03-18 16:19:12 +01:00
Rien Maertens
51d608cbd5
Update README with change to lz4 2020-03-18 00:19:28 +01:00
Rien Maertens
9f6ba5dd1d
Use lz4 instead of zstd, add prebuilt static library 2020-03-17 23:44:55 +01:00
Rien Maertens
c9af230f3a
Update README.md
Add instructions to fix zstd
2020-03-12 11:25:47 +01:00
Rien Maertens
726d0842f8
Update README
- add installation instructions
- remove mention of script copying zstd
2020-03-12 08:43:17 +01:00
Rien Maertens
d0c5ffe9e1
Search for zstd in home directory
This is possibly a solution for #2.
2020-03-12 08:29:19 +01:00
Rien Maertens
cf96c489eb
Rename zstd arm executable
`which zstd` would wrongly find zstd on host because the arm binary has
the same name. As suggested by #1 we rename the binary to zstd.arm.

Fixes #1
2020-03-12 08:26:28 +01:00
Rien Maertens
b2b37607f1
Add demo 2020-03-12 00:29:18 +01:00
Rien Maertens
eb034a63bd
Better documentation 2020-03-12 00:17:13 +01:00
Rien Maertens
b638810082
Use the default SSH host location, also test if zstd is present on host 2020-03-02 09:34:16 +01:00
Rien Maertens
98709fc0c4
Fix landscape_param 2020-02-24 09:30:12 +01:00
Rien Maertens
7558b0935a
Graceful fallback to gzip if zstd is not present 2020-02-12 14:47:52 +01:00
Rien Maertens
0cdbae1cb2
Add installation instructions 2020-02-12 13:51:59 +01:00
Rien Maertens
fe77c2cd58
Add README 2020-02-12 13:19:06 +01:00
Rien Maertens
b52f9afc28
Create reStream.sh 2020-02-12 13:13:14 +01:00