pi#raspberrypi:~ $ raspistill -w 800 -h 600 -tl 0 -t 0 -o - | test-launch "fdsrc ! image/jpeg ! jpegparse ! rtpjpegpay"
stream ready at rtsp://127.0.0.1:8554/test
But I failed to use vlc in win10 to connect with raspberry pi3. I dont know where the problem is. I can't get any error information. I success in running this command :
raspivid -t 0 -h 1920 -w 1080 -fps 30 -o - | ./test-launch " fdsrc ! h264parse ! rtph264pay name=pay0 pt=96 "
So, I think my command is okay. Could someone help me?Thanks.
HaHa, I think I have resolved my own question ( 哈哈哈,我认为我解决了自己的问题 )。Now, let me help you.
The server is
raspistill -w 800 -h 600 -tl 0 -t 0 -o - | test-launch "fdsrc ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96"
The client is
gst-launch-1.0.exe rtspsrc location=rtsp://192.168.1.30:8554/test ! rtpjpegdepay ! jpegparse ! multifilesink location="%d.jpeg"
or
gst-launch-1.0.exe rtspsrc location=rtsp://192.168.1.30:8554/test ! rtpjpegdepay ! jpegparse ! jpegdec ! videoconvert ! autovideosink
vlc can't resolv the flow from server temporarily. So don't to use it !
Related
I want to use the gstreamer plugin fallbacksrc on linux.
fallbacksrc (with ximagesink) -> OK
gst-launch-1.0 fallbacksrc \
uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm \
fallback-uri=file:///path/to/some/jpg \
! videoconvert \
! ximagesink
It works as expected.
fallbacksrc (with glimagesink) -> NG
gst-launch-1.0 fallbacksrc \
uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm \
fallback-uri=file:///path/to/some/jpg \
! videoconvert \
! glimagesink
It does not work.
error message
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Noformat', utils/fallbackswitch/src/fallbacksrc/imp.rs:1897:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
It seems pad linking(capability) problem. But even if I inserted capsfilter video/x-raw before videoconvert, same error happens.
How to use fallbacksrc with glimagesink ?
Environment
gstreamer version
1.22 (installed by archlinux package repo)
gst-plugins-rs
0.9.7 (installed by archlinux user package repo)
built dpdk 19.11.12 from source and i have written an ext app built using these libraries. I use dpdk-devbind to bind a device to igb_uio .
The device i have is an Intel X550. When i run testpmd it seems to recognize the device but int my app rte_eth_dev_count_avail always returns 0
I would belive this has to either do with the way i have built my dpdk library or my app
this is extract of the Makefile i am using to build my app
RTE_SDK ?= /usr/local/share/dpdk
RTE_TARGET ?= x86_64-default-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
# binary name
APP = myapp
# all source are stored in SRCS-y
SRCS-y := main.c
WERROR_FLAGS += -Werror
CFLAGS += -O3 -g
CFLAGS += $(WERROR_FLAGS) -Wno-address-of-packed-member
CFLAGS += -Wall
CFLAGS += -pie -fPIE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -fstack-protector-strong
CFLAGS += -DSTATSD
LDFLAGS += -z relro -z now
LDFLAGS += -ljansson -lrte_pmd_ixgbe
LDLIBS += -lrte_pmd_ixgbe
# disable since libxenstore.so isn't linked properly
#CONFIG_RTE_LIBRTE_PMD_XENVIRT = n
CONFIG_RTE_LIBRTE_PMD_IXGBE = y
include $(RTE_SDK)/mk/rte.extapp.mk
I build my dpdk libraries using this
RUN make -C /dpdk/dpdk-stable-${DPDK_VERSION}/ config T=x86_64-native-linuxapp-gcc
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_BUILD_SHARED_LIB=n/CONFIG_RTE_BUILD_SHARED_LIB=y/g > /tmp/out && mv /tmp/out build/.config
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n/CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=y/g > /tmp/out && mv /tmp/out build/.config
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_LIBRTE_E1000_DEBUG_RX=n/CONFIG_RTE_LIBRTE_E1000_DEBUG_RX=y/g > /tmp/out && mv /tmp/out build/.config
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_LIBRTE_E1000_DEBUG_TX=n/CONFIG_RTE_LIBRTE_E1000_DEBUG_TX=y/g > /tmp/out && mv /tmp/out build/.config
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_LIBRTE_IXGBE_DEBUG_RX=n/CONFIG_RTE_LIBRTE_IXGBE_DEBUG_RX=y/g > /tmp/out && mv /tmp/out build/.config
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_LIBRTE_IXGBE_DEBUG_TX=n/CONFIG_RTE_LIBRTE_IXGBE_DEBUG_TX=y/g > /tmp/out && mv /tmp/out build/.config
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO/CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_DEBUG/g > /tmp/out && mv /tmp/out build/.config
RUN cd /dpdk/dpdk-stable-${DPDK_VERSION}/ && cat build/.config | sed -e s/CONFIG_RTE_LOG_HISTORY=256/CONFIG_RTE_LOG_HISTORY=2048/g > /tmp/out && mv /tmp/out build/.config
i can bind to the interfaces using dpdk-devbind and testpmd also seems to identify and be able to bind to these devices
but my app is not able to recognize the devices.
What am i missing here ?
these are the logs --log-level=8 for EAL logs and I get this output
Sep 09 04:56:50 {"timestamp": 1662717410.8821511, "level": "info", "message": "Initialising EAL ..."}
Sep 09 04:56:50 EAL: Detected 64 lcore(s)
Sep 09 04:56:50 EAL: Detected 2 NUMA nodes
Sep 09 04:56:50 EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
Sep 09 04:56:50 EAL: Selected IOVA mode 'PA'
Sep 09 04:56:50 EAL: No available hugepages reported in hugepages-1048576kB
Sep 09 04:56:50 EAL: Debug dataplane logs available - lower performance
Sep 09 04:56:50 EAL: Debug dataplane logs available - lower performance
Sep 09 04:56:50 EAL: Probing VFIO support...
Sep 09 04:56:50 EAL: VFIO support initialized
Sep 09 04:56:50 EAL: Probing VFIO support...
Sep 09 04:56:50 EAL: VFIO support initialized
also adding the -d parameter with the directory where the plugins are located /usr/local/lib/ gives me an error where the plugin is not found
the eal param initialized is
--master-lcore 4 -l 4,5,6,7 --log-level 8 -d /usr/local/lib/
Sep 09 04:47:29 EAL: Detected 64 lcore(s)
Sep 09 04:47:29 EAL: Detected 2 NUMA nodes
Sep 09 04:47:29 EAL: librte_compressdev.so.0.200: cannot open shared object file: No such file or directory
Sep 09 04:47:29 EAL: FATAL: Cannot init plugins
Sep 09 04:47:29 EAL: Cannot init plugins
the librte_compressdev.so.0.200 is present in the path
ls -l /usr/local/lib/librte_compressdev.so.0.200
-rwxr-xr-x 1 root root 38024 Sep 8 23:51 /usr/local/lib/librte_compressdev.so.0.200
[based on the live debug]
DPDK 17.11 LTS use libdpdk.so and a complete shared library, which makes all the necessary ethdev PMD available. hence using the current makefile, it pans out properly without any issues.
But moving to DPDK 19.11 LTS, libdpdk.so is no longer availble. hence one have to manually link either in shared or static libraries properly (as pointed out in comments). For example
DPDK_CFLAGS=" -DHAVE_DPDK -I${RTE_SDK}/${RTE_TARGET}/include/ -include ${RTE_SDK}/${RTE_TARGET}/include/rte_config.h "
DPDK_LDFLAGS="-I$RTE_SDK/lib/librte_eal/linux/eal/include \
-DRTE_USE_FUNCTION_VERSIONING \
-I$RTE_SDK/$RTE_TARGET/include -include $RTE_SDK/$RTE_TARGET/include/rte_config.h \
-D_GNU_SOURCE -W -Wall -DALLOW_EXPERIMENTAL_API \
-L$RTE_SDK/$RTE_TARGET/lib -Wl,-lrte_flow_classify -Wl,--whole-archive -Wl,-lrte_pipeline -Wl,--no-whole-archive \
-Wl,--whole-archive -Wl,-lrte_table -Wl,--no-whole-archive -Wl,--whole-archive \
-Wl,-lrte_port -Wl,--no-whole-archive -Wl,-lrte_pdump -Wl,-lrte_ip_frag -Wl,-lrte_meter \
-Wl,-lrte_fib -Wl,-lrte_rib -Wl,-lrte_lpm -Wl,-lrte_acl -Wl,-lrte_power -Wl,-lrte_kni \
-Wl,-lrte_efd -Wl,-lrte_bpf -Wl,-lrte_ipsec -Wl,--whole-archive -Wl,-lrte_cfgfile -Wl,-lrte_gro \
-Wl,-lrte_gso -Wl,-lrte_hash -Wl,-lrte_member -Wl,-lrte_vhost -Wl,-lrte_kvargs -Wl,-lrte_mbuf \
-Wl,-lrte_net -Wl,-lrte_ethdev -Wl,-lrte_cryptodev -Wl,-lrte_security -Wl,-lrte_compressdev \
-Wl,-lrte_eventdev -Wl,-lrte_timer -Wl,-lrte_mempool -Wl,-lrte_stack -Wl,-lrte_mempool_ring \
-Wl,-lrte_ring -Wl,-lrte_pci -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_reorder -Wl,-lrte_sched \
-Wl,-lrte_rcu -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_mempool_bucket -Wl,-lrte_mempool_stack \
-Wl,-lrte_pmd_af_packet \
-Wl,-lrte_pmd_ixgbe \
-Wl,-lrte_pmd_memif \
-Wl,-lrte_pmd_null \
-Wl,-lpcap -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_tap -Wl,-lrte_pmd_virtio -Wl,-lrte_bus_vmbus \
-Wl,-lcrypto -Wl,-lrte_pmd_null_crypto -Wl,-lrte_pmd_crypto_scheduler -Wl,-lrte_pmd_virtio_crypto \
-Wl,-lrte_pmd_skeleton_event -Wl,-lrte_pmd_sw_event \
-Wl,--no-whole-archive -Wl,-lrt -Wl,-lm -Wl,-lnuma -Wl,-ldl -Wl,-export-dynamic -Wl,-export-dynamic \
-L$RTE_SDK/examples/l2fwd/build/lib -L$RTE_SDK/$RTE_TARGET/lib -Wl,--as-needed"
Since DPDk 19.11 LTS makes uses on meson-ninja, my suggestion and recommendation is to make use of pkg-config to built the right CFLAGS and LDFLAGS. Please refer StackOverflow query on using dpdk cmake too
Note: recommended to build a custom target folder rather than make install, since the built and application run is done in docker.
I'm trying to set up a RTSP server for my camera on my Raspberry Pi 4B. I installed GStreamer and libgstrtspserver-1.0-dev (version 1.14.4), and am using the test-launch.c script, compiled with gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
I then try to use the pipeline
./test-launch "v4l2src ! 'video/x-raw, width=1280, height=400, framerate=20/1, format=GRAY8' \
! videoconvert ! 'video/x-raw, format=I420' ! v4l2h264enc ! 'video/x-h264, stream-format=byte-stream, \
alignment=au' ! h264parse ! rtph264pay name=pay0 pt=96"
but when I try to connect to it from my other computer (through VLC or OpenCV), I get the GStreamer-CRITICAL messages on the Raspi (I've set GST_DEBUG=4):
j#JRaspi:~/server $ ./test-launch "v4l2src device='/dev/video0' ! 'video/x-raw, width=1280, height=400, format=GRAY8, framerate=20/1' ! videoconvert ! 'video/x-raw, format=I420' ! v4l2h264enc ! 'video/x-h264, stream-format=byte-stream, alignment=au' ! h264parse ! rtph264pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test
(test-launch:8246): GStreamer-CRITICAL **: 14:56:54.865: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
(test-launch:8246): GStreamer-CRITICAL **: 14:56:54.865: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
(test-launch:8246): GStreamer-CRITICAL **: 14:56:54.865: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
and a failed connection.
I can confirm that
gst-launch-1.0 v4l2src ! 'video/x-raw, width=1280, height=400, framerate=20/1, format=GRAY8' \
! videoconvert ! 'video/x-raw, format=I420' ! autovideosink
works for me (displays the camera feed well), so I'm wondering what's wrong with the back of my pipeline or does the test-launch script not work on the Raspberry Pi for some reason?
I've got a similar pipeline working just fine on my Jetson Nano:
./test-launch "v4l2src ! video/x-raw, width=1280, height=400, framerate=20/1, format=GRAY8 \
! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420 ! omxh264enc ! video/x-h264, \
stream-format=byte-stream, alignment=au ! h264parse ! rtph264pay name=pay0 pt=96"
so I'm kind of lost what's wrong on the Raspberry Pi.
EDIT:
I did some further testing and this circuitous route works for me:
gst-launch-1.0 v4l2src ! 'video/x-raw, width=1280, height=400, \
format=GRAY8' ! videoconvert ! 'video/x-raw, format=I420'\
! v4l2h264enc ! 'video/x-h264, stream-format=byte-stream, alignment=au' \
! h264parse ! rtph264pay name=pay0 pt=96 ! rtph264depay ! h264parse \
! decodebin ! videoconvert ! autovideosink
so I'm wondering if it's a problem with test-launch and Raspberry Pi?
EDIT2:
So I ran G_DEBUG=fatal-criticals gdb -ex run --args test-launch "v4l2src ! 'video/x-raw, width=1280, height=400, format=GRAY8' ! videoconvert ! 'video/x-raw, format=I420' ! v4l2h264enc ! 'video/x-h264, stream-format=byte-stream, alignment=au' ! h264parse ! rtph264pay name=pay0 pt=96"
which printed out:
Reading symbols from test-launch...(no debugging symbols found)...done.
Starting program: /home/joel/Arducam-Stereo-RPI/server/test-launch v4l2src\ \!\ \'video/x-raw,\ width=1280,\ height=400,\ format=GRAY8\'\ \!\ videoconvert\ \!\ \'video/x-raw,\ format=I420\'\ \!\ v4l2h264enc\ \!\ \'video/x-h264,\ stream-format=byte-stream,\ alignment=au\'\ \!\ h264parse\ \!\ rtph264pay\ name=pay0\ pt=96
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
stream ready at rtsp://127.0.0.1:8554/test
[New Thread 0xb657b3a0 (LWP 2529)]
(test-launch:2524): GStreamer-CRITICAL **: 16:46:07.769: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
(test-launch:2524): GStreamer-CRITICAL **: 16:46:07.787: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
(test-launch:2524): GStreamer-CRITICAL **: 16:46:07.788: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
[New Thread 0xb57743a0 (LWP 2530)]
(test-launch:2524): GStreamer-CRITICAL **: 16:46:27.960: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
(test-launch:2524): GStreamer-CRITICAL **: 16:46:27.960: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
(test-launch:2524): GStreamer-CRITICAL **: 16:46:27.960: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
[Thread 0xb57743a0 (LWP 2530) exited]
[Thread 0xb657b3a0 (LWP 2529) exited]
^C
Thread 1 "test-launch" received signal SIGINT, Interrupt.
__GI___poll (timeout=-1, nfds=2, fds=0x2e7e0)
--Type <RET> for more, q to quit, c to continue without paging--
at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) bt
#0 0xb6b4dcd0 in __GI___poll (timeout=-1, nfds=2, fds=0x2e7e0)
at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0xb6b4dcd0 in __GI___poll (fds=0x2e7e0, nfds=2, timeout=-1)
at ../sysdeps/unix/sysv/linux/poll.c:26
#2 0xb6c45eb4 in () at /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0
(gdb)
So I tried sudo apt-get install --reinstall libglib2.0-0 but it didn't change anything
The extra single quotation marks in the pipeline caused the problem.
So a working pipeline would be:
./test-launch "v4l2src ! video/x-raw, width=1280, height=400, format=GRAY8 \
! videoconvert ! video/x-raw, format=I420 ! v4l2h264enc ! video/x-h264, \
stream-format=byte-stream, alignment=au ! h264parse ! rtph264pay name=pay0 pt=96"
I am using the following commands with FFmpeg to encode a .mov video to hls and then also create a playlist for subtitles converting a .srt file to .vtt.
// Creating hls playlist
ffmpeg -hide_banner -y -i /Users/dave/mermaid.mov -c:a aac -ar 48000 -c:v h264 -profile:v baseline -avoid_negative_ts 0 -start_number 0 -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -f hls -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename /Users/dave/mermaid/360/360p_%03d.ts /Users/dave/dave/mermaid/360/360p.m3u8
-c:a aac -ar 48000 -c:v h264 -profile:v baseline -avoid_negative_ts 0 -start_number 0 -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -f hls -vf scale=w=842:h=480:force_original_aspect_ratio=decrease -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename /Users/dave/Desktop/mermaid/480/480p_%03d.ts /Users/dave/Desktop/mermaid/480/480p.m3u8
-c:a aac -ar 48000 -c:v h264 -profile:v baseline -avoid_negative_ts 0 -start_number 0 -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -f hls -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename /Users/dave/Desktop/mermaid/720/720p_%03d.ts /Users/dave/Desktop/mermaid/720/720p.m3u8
-c:a aac -ar 48000 -c:v h264 -profile:v baseline -avoid_negative_ts 0 -start_number 0 -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -f hls -vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease -b:v 5000k -maxrate 5350k -bufsize 7500k -b:a 192k -hls_segment_filename /Users/dave/Desktop/mermaid/1080/1080p_%03d.ts /Users/dave/Desktop/mermaid/1080/1080p.m3u8
// Creating subtitles
ffmpeg -i /Users/dave/mermaid.mov -i /Users/dave/little-mermaid.srt -c copy -c:s webvtt -start_number 0 -hls_time 10000000 -hls_flags single_file -hls_playlist_type vod -f hls -avoid_negative_ts 0 /Users/dave/mermaid/English/master.m3u8
I am also doing this with AWS Media Convert the AWS conversion works fine the subtitles are perfectly in time but the FFMPEG version seems to be out of sync by about 1 second.
Here are both files for to compare the exact same files are used for both.
AWS Media Convert: https://d25hd5yfabpc2n.cloudfront.net/c0017bfe-3617-47a5-9525-86d69c73cf57/master.m3u8
Local FFMPEG: https://d25hd5yfabpc2n.cloudfront.net/stackoverflow/master.m3u8
The only thing I can see if I download both playlists is the AWS one has FRAME-RATE set.
Here is an example of both videos playing the FFMEPG one is noticeably out of sync
https://output.jsbin.com/xopohupivu/
Another thing I have noticed is the AWS webvtt version has this at the top of the webvtt file.
WEBVTT #Elemental Media Engine(TM) 2.16.0.602399
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:191970
Not sure what is happening here can't find any information on how to implement this with FFMPEG.
Thanks
I am trying to save my SVN revision info into a macro while making my code by Microsoft Visual Studio's nmake.
In GNU make, I do something like:
SVN_REVISION=r$(shell svnversion -n)
so I get for example: SVN_REVISION=r10001
Is this possible to do in Microsoft nmake too?
Thank you in advance.
Using the techniques mentioned along with a recursive call to make, it can be done this way:
!IFNDEF MAKE
MAKE=NMAKE
!ENDIF
!IFNDEF SVN_REVISION
! IF [echo off && FOR /F "usebackq" %i IN (`svnrevision -n`) DO SET SVN_REVISION=%i && $(MAKE) /$(MAKEFLAGS) /nologo /f $(MAKEDIR)\Makefile && exit /b ] == 0
! MESSAGE Make completed
! ELSE
! ERROR Error in nmake
! ENDIF
!ELSE
# $(SVN_REVISION) now contains the string returned from the command `svnrevision -n`
!MESSAGE SVN_REVISION is $(SVN_REVISION)
# Put the parts of the makefile that depend on SVN_REVISION here
!ENDIF
#
# To be a valid makefile it must have some rules to perform
all:
#echo;$(SVN_REVISION)