Code Monkey home page Code Monkey logo

gnuradio_raptorcodes_video's Introduction

Before running the following codes, please make sure that you have correctly installed GNURadio and ffmpeg in your linux OS. You should also install Python in your linux since we need it to convert C++ APIs into Python APIs for GNURadio.

How to install GNURadio, please refer to:
http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGR

How to install ffmpeg and x264 under Ubuntu, please refer to:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

Note: Please run the commands at the receiving side first, then start to run the commands at the sending side.



Sender Side:

1. Compile the C++ codes of Raptor codes in https://github.com/ywu40/RaptorCodes_Cplusplus_Python
sudo swig -c++ -python raptor_decoder.i
sudo python setup_decoder.py build_ext --inplace

2. After compiling, two files are generated:
_raptor_decoder.so
raptor_decoder.py

3.Copy the following files to GNURadio installing directory gnuradio/gr-digital/examples/narrowband
_raptor_decoder.so
raptor_decoder.py
test_raptor_video_tx.py
test_raw_video_tx.py
foreman_cif.264

1)test_raptor_video_tx.py is use to test the performance of sending the video data with Raptor codes protection
2)test_raw_video_tx.py is to send the video data without any FEC protection
3)foreman_cif.264 is the testing stream

4. Send the video data over usrp with Raptor codes

python test_raptor_video_tx.py --tx-freq=908M --rx-freq=921975000 --rx-gain=30 --tx-gain=30 --tx-amplitude=1 -p 1 -T 200

1)p: packet loss rate (%)
2)T: source symbols size

5. Send the video data over usrp without Raptor codes

python test_raw_video_tx.py --tx-freq=908M --rx-freq=921975000 --rx-gain=30 --tx-gain=30 --tx-amplitude=1 -k 200

1)p: packet loss rate (%)
2)T: source symbols size



Receiver Side:

1. Compile the C++ codes of Raptor codes in https://github.com/ywu40/RaptorCodes_Cplusplus_Python
sudo swig -c++ -python raptor_decoder.i
sudo python setup_decoder.py build_ext --inplace

2. After step 1, copy the following files to the directory gnuradio/gr-digital/examples/narrowband
_raptor_decoder.so
raptor_decoder.py
test_raptor_video_rx.py
test_raw_video_rx.py

1)test_raptor_video_rx.py is use to receive the video data with Raptor codes protection
2)test_raw_video_rx.py is to receive the video data without any FEC protection


3. Receive the video data over usrp with Raptor codes

python test_raptor_video_rx.py --rx-freq=908M --tx-freq=921975000 --rx-gain=30 --tx-gain=30 --tx-amplitude=1 -p 1

1)p: packet loss rate (%)
2)T: source symbols size

4. Receive the video data over usrp without Raptor codes

python test_raw_video_rx.py --rx-freq=908M --tx-freq=921975000 --rx-gain=30 --tx-gain=30 --tx-amplitude=1 -p 1

1)p: packet loss rate (%)
2)T: source symbols size

5. ffplay
1) Play the video stream with Raptor codes protection
ffplay -f h264 output_raptor.264

2) Play the video stream without Raptor codes protection
ffplay -f h264 output_no_raptor.264

6. h.264 streams are converted to yuv
avconv -i output_raptor.264 -s 352x288 out_raptor.yuv

Note:
a)avconv is a tool of ffmpeg
b)out_raptor.yuv is the yuv (raw video) format
c)-i: input file
d)-s: the video resolution (or size), in this experiment is CIF (352*288)

7. use mplayer to play the yuv file
You can use mplayer as a YUV player with the example command below.
mplayer foreman.qcif -demuxer rawvideo -rawvideo qcif

command format:
mplayer “yuv filename” -demuxer rawvideo -rawvideo “qcif,cif”

gnuradio_raptorcodes_video's People

Contributors

ywu40 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.