popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.01k stars 334 forks source link

RTP Streams sometimes will not play #563

Open tuxfoo opened 7 years ago

tuxfoo commented 7 years ago

Hello I am having issues playing UDP/RTP streams with omxplayer

If this is user error can someone please tell me how to fix this, thanks. Would be nice to just keep omxplayer listening.

Sometimes it works but most of the time omplayer will exit with just "Have a nice day!" and occasionally omxplayer will first display codec information before the crash

I am listening on a udp port omxplayer -g --live udp://0.0.0.0:8090

I am attempting to stream a DVD to omxplayer using VLClsb vlc dvdsimple:// --sout-transcode-hurry-up --sout-avcodec-strict=-2 --sout-x264-preset ultrafast --sout '#transcode{vcodec=h264,vb=1500,acodec=mp4a,ab=256,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=raspberry-pi,port=8090,mux=ts},dst=display}' :sout-keep

When attempting to play a rtp stream omxplayer crashs with just "Have a nice day" my log is as follows

11:10:28 T:18446744073177394336   DEBUG: DllBcm: Using omx system library
11:10:28 T:18446744073177396876   DEBUG: DllOMX: Using omx system library
11:10:28 T:18446744073177398230   DEBUG: DllAvFormat: Using libavformat system library
11:10:28 T:18446744073177404805   DEBUG: DBus connection succeeded
11:10:28 T:18446744073177408284   DEBUG: Keyboard: DBus connection succeeded
11:10:28 T:18446744073177408705   DEBUG: OMXThread::Create - Thread with id 1897919520 started
11:10:28 T:18446744073177408934   DEBUG: DllAvUtilBase: Using libavutil system library
11:10:28 T:18446744073177409091   DEBUG: DllAvCodec: Using libavcodec system library
11:10:28 T:18446744073177409175   DEBUG: DllAvFormat: Using libavformat system library
11:10:28 T:18446744073177427158   DEBUG: COMXPlayer::OpenFile - avformat_open_input udp://0.0.0.0:8090
11:10:29 T:18446744073177583676   DEBUG: COMXPlayer::OpenFile - avformat_open_input enabled SEEKING
11:10:39 T:18446744073187714321   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.clock input port 80 output port 81 m_handle 0x13ee150
11:10:39 T:18446744073187714946   DEBUG: OMXClock::OMXStop
11:10:39 T:18446744073187715219   DEBUG: OMXClock::OMXSetSpeed(0.00) pause_resume:1
11:10:39 T:18446744073187715670   DEBUG: DllAvUtilBase: Using libavutil system library
11:10:39 T:18446744073187715758   DEBUG: DllAvCodec: Using libavcodec system library
11:10:39 T:18446744073187715827   DEBUG: DllAvFormat: Using libavformat system library
11:10:39 T:18446744073187716032   DEBUG: OMXClock::OMXStop
11:10:39 T:18446744073187716876   DEBUG: OMXThread::Run - Exited thread with  id 1897919520
11:10:39 T:18446744073187717541   DEBUG: OMXThread::StopThread - Thread stopped
11:10:39 T:18446744073187727103   DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.clock handle 0x13ee150

Sometimes codec info gets displayed before "Have a nice day" when attempting to play a rtp stream, my log is as follows when this happens

11:09:16 T:18446744073105295295   DEBUG: DllBcm: Using omx system library
11:09:16 T:18446744073105297914   DEBUG: DllOMX: Using omx system library
11:09:16 T:18446744073105299259   DEBUG: DllAvFormat: Using libavformat system library
11:09:16 T:18446744073105304807   DEBUG: DBus connection succeeded
11:09:16 T:18446744073105307620   DEBUG: Keyboard: DBus connection succeeded
11:09:16 T:18446744073105308038   DEBUG: OMXThread::Create - Thread with id 1897919520 started
11:09:16 T:18446744073105308322   DEBUG: DllAvUtilBase: Using libavutil system library
11:09:16 T:18446744073105308415   DEBUG: DllAvCodec: Using libavcodec system library
11:09:16 T:18446744073105308490   DEBUG: DllAvFormat: Using libavformat system library
11:09:16 T:18446744073105326411   DEBUG: COMXPlayer::OpenFile - avformat_open_input udp://0.0.0.0:8090
11:09:16 T:18446744073105414423   DEBUG: COMXPlayer::OpenFile - avformat_open_input enabled SEEKING
11:09:26 T:18446744073114916073   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.clock input port 80 output port 81 m_handle 0x952190
11:09:26 T:18446744073114916714   DEBUG: OMXClock::OMXStop
11:09:26 T:18446744073114916990   DEBUG: OMXClock::OMXSetSpeed(0.00) pause_resume:1
11:09:26 T:18446744073114917453   DEBUG: DllAvUtilBase: Using libavutil system library
11:09:26 T:18446744073114917536   DEBUG: DllAvCodec: Using libavcodec system library
11:09:26 T:18446744073114917604   DEBUG: DllAvFormat: Using libavformat system library
11:09:26 T:18446744073114920606   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.video_decode input port 130 output port 131 m_handle 0x9829c8
11:09:26 T:18446744073114922636   DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.video_decode) - port(130), nBufferCountMin(1), nBufferCountActual(60), nBufferSize(81920), nBufferAlignmen(16)
11:09:26 T:18446744073114937142   DEBUG: COMXVideo::Open - decoder_component(0x0x9829c8), input_port(0x82), output_port(0x83) deinterlace 1 hdmiclocksync 0
11:09:26 T:18446744073114938906   DEBUG: OMXThread::Create - Thread with id 1868583968 started
11:09:26 T:18446744073114939227   DEBUG: OMXThread::Create - Thread with id 1860195360 started
11:09:26 T:18446744073114939660   DEBUG: DllAvUtilBase: Using libavutil system library
11:09:26 T:18446744073114939780   DEBUG: DllAvCodec: Using libavcodec system library
11:09:26 T:18446744073114939852   DEBUG: DllAvFormat: Using libavformat system library
11:09:26 T:18446744073114939957   DEBUG: DllAvUtilBase: Using libavutil system library
11:09:26 T:18446744073114940052   DEBUG: DllAvCodec: Using libavcodec system library
11:09:26 T:18446744073114940149   DEBUG: DllAvFormat: Using libswresample system library
11:09:26 T:18446744073114941024   DEBUG: DllAvUtilBase: Using libavutil system library
11:09:26 T:18446744073114941305   DEBUG: OMXClock::OMXStop
11:09:26 T:18446744073114968258   DEBUG: OMXThread::Run - Exited thread with  id 1860195360
11:09:26 T:18446744073114968974   DEBUG: OMXThread::StopThread - Thread stopped
11:09:26 T:18446744073114969434   DEBUG: OMXThread::Run - Exited thread with  id 1868583968
11:09:26 T:18446744073114969711   DEBUG: OMXThread::StopThread - Thread stopped
11:09:26 T:18446744073114982602   DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.video_decode handle 0x9829c8
11:09:26 T:18446744073114994368   DEBUG: OMXThread::Run - Exited thread with  id 1897919520
11:09:26 T:18446744073114994679   DEBUG: OMXThread::StopThread - Thread stopped
11:09:26 T:18446744073115003816   DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.clock handle 0x952190

Some system info

root@raspberrypi:/home/pi# dpkg -s ffmpeg
Package: ffmpeg
Status: install ok installed
Priority: optional
Section: video
Installed-Size: 1804
Maintainer: Christian Marillat <marillat@deb-multimedia.org>
Bugs: mailto:marillat@deb-multimedia.org
Architecture: armhf
Source: ffmpeg-dmo
Version: 10:2.6.9-dmo1
Replaces: libav-tools, libavcodec52
Depends: libavcodec56 (>= 10:2.6.9), libavdevice56 (>= 10:2.6.9), libavfilter5 (>= 10:2.6.9), libavformat56 (>= 10:2.6.9), libavresample2 (>= 10:2.6.9), libavutil54 (>= 10:2.6.9), libc6 (>= 2.4), libpostproc53 (>= 10:2.6.9), libsdl1.2debian (>= 1.2.11), libswresample1 (>= 10:2.6.9), libswscale3 (>= 10:2.6.9)
root@raspberrypi:/home/pi# dpkg -s omxplayer
Package: omxplayer
Status: install ok installed
Priority: optional
Section: video
Installed-Size: 12788
Maintainer: Sergio Conde <skgsergio@gmail.com>
Architecture: armhf
Version: 0.3.7~git20160923~dfea8c9
Provides: omxplayer
Depends: libpcre3, libfreetype6, fonts-freefont-ttf, dbus, libssl1.0.0, libsmbclient, libssh-4, libasound2
Suggests: fbset, x11-xserver-utils
Description: Command line media player for Raspberry Pi
 OMXPlayer source: https://github.com/popcornmix/omxplayer/
 OMXPlayer builds: http://omxplayer.sconde.net/
tuxfoo commented 7 years ago

I seem to have much better luck using ac3 instead of mp4a. How ever I rather use mp4a to avoid too much network congestion. With ac3 it works most of the time, so maybe it is a issue decoding mp4a audio?

hgshoggins commented 7 years ago

I would also like to have any update on this because I'm actually trying to create a GStreamer pipeline to achieve the same thing, but without much luck so far, and it's driving me crazy.

The question is : when it's about RTP streaming, what exactly does omxplayer expect as a format, especially when it's live and there are no headers present to indicate the format at the beginning of a file ?

tuxfoo commented 7 years ago

I have found that omxplayer has a lot of trouble with RTP and transcoded audio. For my purposes, I ended up not transcoding audio when using RTP and it works fine with most audio formats I have tested.

StCyr commented 6 years ago

I have found that omxplayer has a lot of trouble with RTP and transcoded audio.

Interesting, I've strange issues with RTP and audio.

My audio stream is encoded using vlc and the following settings:

acodec=aac,ab=128,channels=2,samplerate=44100

For my purposes, I ended up not transcoding audio when using RTP and it works fine with most audio formats I have tested.

Which formats did you test?