Skip to content

Commit

Permalink
examples: Input V3C test file name as a command-line parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tampsa committed Jan 30, 2024
1 parent 5a68623 commit 4e32cb7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
10 changes: 5 additions & 5 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ NOTE: The hook should not be used for extensive media processing. It is meant to
To demonstrate V3C streaming, uvgRTP comes with example V3C sender and V3C receiver programs, found in `uvgRTP/build/examples`. Below are simple step-by-step instructions to run these programs:

1. Build the library according to instructions in [BUILDING.md](../BUILDING.md). Crypto++ is not needed.
2. Build the `v3c_sender` and `v3c_receiver` applications according to building instructions on the top of this page.
3. Download a test sequence from [here](https://ultravideo.fi/uvgRTP_example_sequence_longdress.vpcc).
4. Set the PATH variable in the [v3c_sender](v3c_sender.cc#L20) and [v3c_receiver](v3c_receiver.cc#L49) to the path of the test sequence.
5. Build the `v3c_sender` and `v3c_receiver` applications according to building instructions on the top of this page.
6. Start the `v3c_receiver` program with `./v3c_receiver`
7. Start the `v3c_sender` program with `./v3c_sender`. The program will parse the test sequence for transmission and send it to the receiver.
8. The with `v3c_receiver` will print information on the reception and reconstruction of the V3C bitstream.
4. Place the test sequence in uvgRTP/build/examples/Release
5. Start the `v3c_receiver` program with `./v3c_receiver uvgRTP_example_sequence_longdress.vpcc`. If you have changed the filename, modify the command accordingly.
6. Start the `v3c_sender` program with `./v3c_sender uvgRTP_example_sequence_longdress.vpcc`. The program will parse the test sequence for transmission and send it to the receiver.
7. The with `v3c_receiver` will print information on the reception and reconstruction of the V3C bitstream.

## RTCP example

Expand Down
10 changes: 9 additions & 1 deletion examples/v3c_receiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ std::string PATH = "";

bool write_file(const char* data, size_t len, const std::string& filename);

int main(void)
int main(int argc, char* argv[])
{
if (argc != 2) {
std::cout << "Enter test file name as input parameter" << std::endl;
return EXIT_FAILURE;
}
else {
PATH = argv[1];
}

std::cout << "Starting uvgRTP V3C receive hook example" << std::endl;

/* Initialize uvgRTP context and session*/
Expand Down
15 changes: 8 additions & 7 deletions examples/v3c_sender.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@
#include <string>
#include <atomic>

/* Usage
* 1. Set the PATH in both sender and receiver to the V-PCC file to be transmitted. You can download it from a link on
* Github in uvgrtp/examples
* 2. Start the receiver program
* 3. Start the sender program */

constexpr char LOCAL_IP[] = "127.0.0.1";

// Path to the V-PCC file that you want to send
std::string PATH = "";
void sender_func(uvgrtp::media_stream* stream, const char* cbuf, const std::vector<v3c_unit_info> &units, rtp_flags_t flags, int fmt);

std::atomic<uint64_t> bytes_sent;
int main(void)
int main(int argc, char* argv[])
{
/* This example demonstrates transmitting a file that is in the V3C sample stream format via uvgRTP. It can be used to transmit
* V-PCC encoded files, but with minor modifications (addition of V3C_CAD and V3C_PVD streams) it can also be used for MIV
Expand Down Expand Up @@ -56,6 +50,13 @@ int main(void)
- Remember to use RTP_NO_H26X_SCL flag when sending video frames, as there is no start codes in the video sub-streams
- v3c_sender and v3c_receiver programs use common functions defined in v3c_util. */

if (argc != 2) {
std::cout << "Enter test file name as input parameter" << std::endl;
return EXIT_FAILURE;
}
else {
PATH = argv[1];
}
bytes_sent = 0;
v3c_file_map mmap;

Expand Down

0 comments on commit 4e32cb7

Please sign in to comment.