Using gstreamer
Live RTSP stream
← Older revision Revision as of 18:33, 13 March 2019 Line 91: Line 91: * careful with streams at higher resolution than 1920x1088 * careful with streams at higher resolution than 1920x1088 * 10353 - works * 10353 - works −* <b>10393 - doesn't have a streamer yet</b>+* <b>10393 - works</b> =====native resolution===== =====native resolution===== <font size='2'> <font size='2'> OlegAbout Elphel, Inc
File:Elphel andrey oleg olga.jpeg
Andrey.filippov uploaded File:Elphel andrey oleg olga.jpeg
New page
== Licensing =={{CC }} Andrey.filippov
About Elphel, Inc
File:Txt.jpg
Oleg changed visibility of 2 revisions on page File:Txt.jpg: content hidden, edit summary hidden and username hidden Inappropriate comment or personal information
OlegAbout Elphel, Inc
Using gstreamer
Latency tests
← Older revision Revision as of 21:56, 21 February 2019 (2 intermediate revisions by the same user not shown)Line 157: Line 157: * Receive rtsp stream and re-stream as rtp: * Receive rtsp stream and re-stream as rtp: gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.9:554' latency=0 ! udpsink host=127.0.0.1 port=5000 gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.9:554' latency=0 ! udpsink host=127.0.0.1 port=5000 +* Receive rtsp stream then re-stream as rtp and display at the same time + gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.37:554' latency=0 ! rtpjpegdepay ! jpegdec ! timeoverlay ! tee name=t ! queue ! xvimagesink t. ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000 To play that rtp with vlc one would need an sdp file (somefile.sdp): To play that rtp with vlc one would need an sdp file (somefile.sdp): v=0 v=0 Line 168: Line 170: gst-launch-1.0 udpsrc uri=udp://127.0.0.1:5000 ! rtpjpegdepay ! jpegdec ! autovideosink gst-launch-1.0 udpsrc uri=udp://127.0.0.1:5000 ! rtpjpegdepay ! jpegdec ! autovideosink +=Latency tests= +==Test 1: vlc relative to gstreamer== +* Camera: + <font size=2>elphel393~# /usr/bin/str</font> +* PC, console 1 - restream and display at the same time: + <font size=2>~$ gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.9:554' latency=0 ! rtpjpegdepay ! jpegdec ! timeoverlay ! tee name=t ! queue ! xvimagesink t. ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000</font> +* PC, console 2 - run vlc: + <font size=2>~$ vlc test.sdp --network-caching=0</font> +where ''test.sdp'': + <font size=2>v=0 + m=video 5000 RTP/AVP 26 + c=IN IP4 127.0.0.1 + a=rtpmap:26 JPEG/90000</font> [[Category:393]] [[Category:393]] [[Category:353]] [[Category:353]] OlegUsing gstreamer
Latency tests
← Older revision Revision as of 21:56, 21 February 2019 (4 intermediate revisions by the same user not shown)Line 146: Line 146: * I did some benchmarks; a Core 2 Quad Q6600 (2.4 Ghz) is not powerful enough for h264 encoding @fullHD resolution (using 4 treads). * I did some benchmarks; a Core 2 Quad Q6600 (2.4 Ghz) is not powerful enough for h264 encoding @fullHD resolution (using 4 treads). −==Useful links==+=Useful links= * [http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet GStreamer cheat sheet] * [http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet GStreamer cheat sheet] * [http://processors.wiki.ti.com/index.php/Example_GStreamer_Pipelines Example GStreamer pipelines] * [http://processors.wiki.ti.com/index.php/Example_GStreamer_Pipelines Example GStreamer pipelines] * [https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/ GStreamer dynamic pipelines] * [https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/ GStreamer dynamic pipelines] * [https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html Dynamic pipelines] * [https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html Dynamic pipelines] + +=Some other examples= +* Simply playing stream + gst-launch-1.0 -v playbin uri=rtsp://192.168.0.9:554 uridecodebin0::source::latency=0 +* Receive rtsp stream and re-stream as rtp: + gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.9:554' latency=0 ! udpsink host=127.0.0.1 port=5000 +* Receive rtsp stream then re-stream as rtp and display at the same time + gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.37:554' latency=0 ! rtpjpegdepay ! jpegdec ! timeoverlay ! tee name=t ! queue ! xvimagesink t. ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000 +To play that rtp with vlc one would need an sdp file (somefile.sdp): + v=0 + m=video 5000 RTP/AVP 26 + c=IN IP4 127.0.0.1 + a=rtpmap:26 JPEG/90000 + +To play with vlc: + vlc somefile.sdp --network-caching=0 +To play with gstreamer (sdp is not required): + gst-launch-1.0 udpsrc uri=udp://127.0.0.1:5000 ! rtpjpegdepay ! jpegdec ! autovideosink + +=Latency tests= +==Test 1: vlc relative to gstreamer== +* Camera: + <font size=2>elphel393~# /usr/bin/str</font> +* PC, console 1 - restream and display at the same time: + <font size=2>~$ gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.9:554' latency=0 ! rtpjpegdepay ! jpegdec ! timeoverlay ! tee name=t ! queue ! xvimagesink t. ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000</font> +* PC, console 2 - run vlc: + <font size=2>~$ vlc test.sdp --network-caching=0</font> +where ''test.sdp'': + <font size=2>v=0 + m=video 5000 RTP/AVP 26 + c=IN IP4 127.0.0.1 + a=rtpmap:26 JPEG/90000</font> [[Category:393]] [[Category:393]] [[Category:353]] [[Category:353]] OlegUsing gstreamer
Test 1: vlc relative to gstreamer
← Older revision Revision as of 21:22, 21 February 2019 (3 intermediate revisions by the same user not shown)Line 146: Line 146: * I did some benchmarks; a Core 2 Quad Q6600 (2.4 Ghz) is not powerful enough for h264 encoding @fullHD resolution (using 4 treads). * I did some benchmarks; a Core 2 Quad Q6600 (2.4 Ghz) is not powerful enough for h264 encoding @fullHD resolution (using 4 treads). −==Useful links==+=Useful links= * [http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet GStreamer cheat sheet] * [http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet GStreamer cheat sheet] * [http://processors.wiki.ti.com/index.php/Example_GStreamer_Pipelines Example GStreamer pipelines] * [http://processors.wiki.ti.com/index.php/Example_GStreamer_Pipelines Example GStreamer pipelines] * [https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/ GStreamer dynamic pipelines] * [https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/ GStreamer dynamic pipelines] * [https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html Dynamic pipelines] * [https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html Dynamic pipelines] + +=Some other examples= +* Simply playing stream + gst-launch-1.0 -v playbin uri=rtsp://192.168.0.9:554 uridecodebin0::source::latency=0 +* Receive rtsp stream and re-stream as rtp: + gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.9:554' latency=0 ! udpsink host=127.0.0.1 port=5000 +* Receive rtsp stream then re-stream as rtp and display at the same time + gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.37:554' latency=0 ! rtpjpegdepay ! jpegdec ! timeoverlay ! tee name=t ! queue ! xvimagesink t. ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000 +To play that rtp with vlc one would need an sdp file (somefile.sdp): + v=0 + m=video 5000 RTP/AVP 26 + c=IN IP4 127.0.0.1 + a=rtpmap:26 JPEG/90000 + +To play with vlc: + vlc somefile.sdp --network-caching=0 +To play with gstreamer (sdp is not required): + gst-launch-1.0 udpsrc uri=udp://127.0.0.1:5000 ! rtpjpegdepay ! jpegdec ! autovideosink + +=Latency tests= +==Test 1: vlc relative to gstreamer== +* Camera: + elphel393~# /usr/bin/str +* PC, console 1 - restream and display at the same time: + ~$ gst-launch-1.0 -e rtspsrc location='rtsp://192.168.0.9:554' latency=0 ! rtpjpegdepay ! jpegdec ! timeoverlay ! tee name=t ! queue ! xvimagesink t. ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000 +* PC, console 2 - run vlc: + ~$ vlc test.sdp --network-caching=0 +where ''test.sdp'': + v=0 + m=video 5000 RTP/AVP 26 + c=IN IP4 127.0.0.1 + a=rtpmap:26 JPEG/90000 [[Category:393]] [[Category:393]] [[Category:353]] [[Category:353]] OlegUsing gstreamer
File:103992 assy.tar.gz
Andrey.filippov uploaded a new version of File:103992 assy.tar.gz
New page
== Licensing =={{CERN OHLv1.1 }} Andrey.filippov
File:103992 gerber.tar.gz
Andrey.filippov uploaded a new version of File:103992 gerber.tar.gz
New page
== Licensing =={{CERN OHLv1.1 }} Andrey.filippov
File:103992 sch.pdf
Andrey.filippov uploaded a new version of File:103992 sch.pdf
New page
== Licensing =={{CERN OHLv1.1 }} Andrey.filippov
Publications
10393 manual
RTSP
← Older revision Revision as of 21:05, 31 January 2019 (7 intermediate revisions by the same user not shown)Line 151: Line 151: </font> </font> ====RTSP==== ====RTSP==== +* Streams with either '''w''' or '''h''' >2040 might not get played - not supported by live555 often used by various media players. But there's a [https://git.elphel.com/Elphel/live555_patch live555_patch]. * turn on: * turn on: <font size='2'> <font size='2'> Line 162: Line 163: rtsp://192.168.0.9:560 rtsp://192.168.0.9:560 </font> </font> + ====GStreamer==== ====GStreamer==== <font size='2'> <font size='2'> + gst-launch-1.0 -v playbin uri=rtsp://192.168.0.9:554 uridecodebin0::source::latency=0 +or gst-launch-1.0 souphttpsrc is-live=true location=http://192.168.0.9:2323/mimg ! jpegdec ! xvimagesink gst-launch-1.0 souphttpsrc is-live=true location=http://192.168.0.9:2323/mimg ! jpegdec ! xvimagesink </font> </font> OlegUsed files
Output of used_files.py without arguments
← Older revision Revision as of 21:17, 29 January 2019 Line 17: Line 17: Here is the full sequence (target is the project name extracted from .cproject): Here is the full sequence (target is the project name extracted from .cproject): − 1. bitbake target-c cleansstate+ 1. bitbake target -c cleansstate − 2. bitbake target-c unpack -f+ 2. bitbake target -c unpack -f − 3. bitbake target-c configure -f+ 3. bitbake target -c configure -f 4. Scan all files under extra_source directory, find last modification stamp 4. Scan all files under extra_source directory, find last modification stamp − 5. bitbake target-c compile -f+ 5. bitbake target -c compile -f − 6. bitbake target-c install -f # in the case of Linux kernel in triggers compilation of the kernel+ 6. bitbake target -c install -f # in the case of Linux kernel in triggers compilation of the kernel modules modules 7. Scan source files, create list of the used files and then list of excluded files (Eclipse CDT allows 7. Scan source files, create list of the used files and then list of excluded files (Eclipse CDT allows Oleg10393 manual
VLC
← Older revision Revision as of 19:04, 28 January 2019 (One intermediate revision by the same user not shown)Line 168: Line 168: * mjpeg and rtsp * mjpeg and rtsp * More examples at [[Using_gstreamer#Display|Using GStreamer]] * More examples at [[Using_gstreamer#Display|Using GStreamer]] + +====VLC==== +<font size='2'> + vlc rtsp://192.168.0.9:554 --network-caching=0 +</font> ===Record=== ===Record=== OlegEclipse CDT projects with bitbake
Project Files and Directories
← Older revision Revision as of 17:56, 23 January 2019 Line 53: Line 53: *'''scripts''' - a link to a collection of scripts needed for all projects. It contains the following files: *'''scripts''' - a link to a collection of scripts needed for all projects. It contains the following files: **'''run_bitbake.sh''' - script to create an environment and execute bitbake recipe. Used every time Eclipse builds the project. **'''run_bitbake.sh''' - script to create an environment and execute bitbake recipe. Used every time Eclipse builds the project. −**'''used_files.py''' - script to create a list of header files/directories used by bitbake to build the project. It is not needed to run to configure existing projects - all of them are provided with preconfigured '''.cproject''' files. ''TODO: add link to description''+**'''used_files.py''' - script to create a list of header files/directories used by bitbake to build the project. It is not needed to run to configure existing projects - all of them are provided with preconfigured '''.cproject''' files. ''TODO: add link to description'' [[Used_files]] *'''.settings''' - project settings maintained by Eclipse IDE *'''.settings''' - project settings maintained by Eclipse IDE *'''src''' - a hard-coded (in '''used_files.py''') directory name for C/C++ source files. Source files should not be in the project root directory for convenience of filter generation for additional source (headers) directories *'''src''' - a hard-coded (in '''used_files.py''') directory name for C/C++ source files. Source files should not be in the project root directory for convenience of filter generation for additional source (headers) directories Line 63: Line 63: *'''.project''' - Eclipse general project configuration. This file is copied from version-controlled '''eclipse_project_setup''' during setup or manually. *'''.project''' - Eclipse general project configuration. This file is copied from version-controlled '''eclipse_project_setup''' during setup or manually. *'''README.md''' - README file presented by the Git repository web interface *'''README.md''' - README file presented by the Git repository web interface −*'''VERSION''' - project version, used by bitbake build process to determine which dependent recipes have to be re-ran. +*'''VERSION''' - project version, used by bitbake build process to determine which dependent recipes have to be re-ran. + ==Initializing Eclipse Workspace for Existing (Cloned) Projects== ==Initializing Eclipse Workspace for Existing (Cloned) Projects== After running '''setup.py''' for the first time you may create the brand new workspace for Eclipse, that should have all necessary plugins (such as CDT and EGit at least) already installed. Workspace is created with '''setup_eclipse.py''' script, list of projects that it sets up is saved in '''setup_eclipse_paths.xml''' file. '''setup_eclipse.py''' provides usage information when launched without parameters, for normal run it requires full path to Eclipse installation - directory that contains '''eclipse''' executable and '''eclipse.ini''' configuration. Before running '''setup_eclipse.py''' Eclipse should have all the required plugins installed (at least CDT and EGit) using temporary workspace. After running '''setup.py''' for the first time you may create the brand new workspace for Eclipse, that should have all necessary plugins (such as CDT and EGit at least) already installed. Workspace is created with '''setup_eclipse.py''' script, list of projects that it sets up is saved in '''setup_eclipse_paths.xml''' file. '''setup_eclipse.py''' provides usage information when launched without parameters, for normal run it requires full path to Eclipse installation - directory that contains '''eclipse''' executable and '''eclipse.ini''' configuration. Before running '''setup_eclipse.py''' Eclipse should have all the required plugins installed (at least CDT and EGit) using temporary workspace. Andrey.filippovUsed files
Created page with "== Output of used_files.py without arguments == This program creates a list of the source files (such as C headers) used to build the project for Eclipse CDT plugin. It on..."
New page
== Output of used_files.py without arguments ==This program creates a list of the source files (such as C headers) used to build the project
for Eclipse CDT plugin. It only needs to be run for the new projects, the existing ones already
have .cproject file distributed in each subproject repository (in 'eclipse_project_setup' sub-
directory of the root sub-project directory). This sub-directory content is copyied to the sub-
project root by setup.py when it is first run. You may delete .project file (while Eclipse is closed)
and re-run setup.py (in elphel393 directory) restore default project settings if they get corrupted.
The program does not rely on exact duplicating of the environment used by bitbake, instead it
"spies" on the bitbake by noticing which files it accesses during build (using file modification and
access timestamps) and creates list of exclusions. As the access time is recorded only after the first
access after modification, the program first unpacks/touches the sources.
The extra_source directory is the specified in the command line directory (in addition to hard-coded
'src') with sub-tree of the source files (headers) to be filtered.
Here is the full sequence (target is the project name extracted from .cproject):
1. bitbake target-c cleansstate
2. bitbake target-c unpack -f
3. bitbake target-c configure -f
4. Scan all files under extra_source directory, find last modification stamp
5. bitbake target-c compile -f
6. bitbake target-c install -f # in the case of Linux kernel in triggers compilation of the kernel
modules
7. Scan source files, create list of the used files and then list of excluded files (Eclipse CDT allows
to specify directory and exclusion filter)
8. Add (or replace) the record in .cproject file that specifies source directory and the filter
You need to run indexing (right-click on the project in the Navigator panel -> Index -> rebuild
when the workspace is opened with the modified .cproject file.
Do not run this program when Eclipse IDE is opened that includes the current project!
The program should be launched from the project root directory, e.g. for applications:
./scripts/used_files.py sysroots
Program can either overwrite the current .cproject configuration file or create a new modified version
if specified in teh command line argument. In that case program runs in debug mode and generates lists
of files in the project root directory:== Output of used_files.py withou arguments ==
all_sources.lst - all scanned source file with last access timestamps
including.lst - list of the files (relative to specified extra_source directory) used by bitbake
excluding.lst - list of the unused files (they will appear crossed in the Project Navigator)
USAGE:
./used_files.py extra_source [path-to-modified-cproject]
First (mandatory) argument of this program (extra_source) is the relative path additional source/header
files. For Linux kernel development it is 'linux', for php extension - 'php, for applications - 'sysroots'
(symlink to header files)
Second (optional) argument (path-to-modified-cproject) is the relative to project root file to write
modified .cproject content. If specified it forces program to run in debug mode and generate 3 file lists. Andrey.filippov