Streaming RX portsdown

Area for discussing streaming over the Internet, especially as it relates to ATV
Forum rules
This forum is run by the BATC (British Amateur Television Club), it is service made freely available to all interested parties, please do not abuse this privilege.

Thank you
Post Reply
F4DVK
Posts: 23
Joined: Mon Nov 27, 2017 6:24 pm

Streaming RX portsdown

Post by F4DVK » Sat Nov 17, 2018 9:57 am

Hi,

I programmed streaming with the following code:

ffmpeg -f v4l2 -video_size "640x480" -i /dev/video0 -f alsa -i pulse \
-acodec libmp3lame -ac 1 -ab 48k -ar 22050 \
-vcodec libx264 -preset veryfast -b:v 256k -minrate 256k -maxrate 512k -bufsize 320k -s 640x480 \
-f flv "rtmp://rtmp.batc.org.uk/live/f5zbc-xxxxxx"

Streaming is clearly visible on the internet, but no video display on the portsdown.

He stuck to: "Valid Stream Detected"

Do you have an idea for my problem?

Thank you.
Stephane

G8GKQ
Site Admin
Posts: 1237
Joined: Sun Mar 22, 2009 1:21 pm

Re: Streaming RX portsdown

Post by G8GKQ » Sat Nov 17, 2018 8:40 pm

Hi Stephane

I tried looking, but your stream was not there when I got back from /P operation today. I do not know what Linux version and what hardware you are using, but try the following changes:

ffmpeg -f v4l2 -video_size "640x480" -i /dev/video0 -f alsa -i pulse \
-acodec libmp3lame -ac 1 -ab 48k -ar 22050 \
-framerate 25 -vcodec libx264 -preset veryfast -b:v 256k -minrate 256k -maxrate 512k -bufsize 320k -s 640x480 \
-g 25 -f flv "rtmp://rtmp.batc.org.uk/live/f5zbc-xxxxxx"

Portsdown streamer uses:

Code: Select all

          $PATHRPI"/ffmpeg" -loglevel $MODE_DEBUG -thread_queue_size 2048\
            -f v4l2 -video_size "$VIDEO_WIDTH"x"$VIDEO_HEIGHT" \
            -i $VID_USB \
            -f alsa -thread_queue_size 2048 -ac $AUDIO_CHANNELS -ar $AUDIO_SAMPLE \
            -i hw:$AUDIO_CARD_NUMBER,0 \
            -framerate 25 -c:v h264_omx -b:v 512k \
            -ar 22050 -ac $AUDIO_CHANNELS -ab 64k \
            -vf "$CAPTION""$SCALE"yadif=0:1:0 -g 25 \
            -f flv $STREAM_URL/$STREAM_KEY &
h264omx is hardware encoding.

Hope that helps

Dave

F4DVK
Posts: 23
Joined: Mon Nov 27, 2017 6:24 pm

Re: Streaming RX portsdown

Post by F4DVK » Sun Nov 18, 2018 7:45 am

HI Dave,

Thanks for your help.

I tried the changes, but still no video on the raspberry.

I use a PC with ubuntu18.04 and an easycap for video input.

Thank you.
Stephane

G8GKQ
Site Admin
Posts: 1237
Joined: Sun Mar 22, 2009 1:21 pm

Re: Streaming RX portsdown

Post by G8GKQ » Sun Nov 18, 2018 2:58 pm

Stephane

I think that the Portsdown player (actually omxplayer) is unhappy about your stream parameters. Here is the info on a stream that works:

Code: Select all

pi@raspberrypi:~ $ omxplayer --timeout 2  -I rtmp://batc.org.uk/live/gb3zz
[flv @ 0x1dffa0] audio stream discovered after head already parsed
[flv @ 0x1dffa0] video stream discovered after head already parsed
Input #0, flv, from 'rtmp://batc.org.uk/live/gb3zz':
  Metadata:
    Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
    displayWidth    : 720
    displayHeight   : 576
    fps             : 25
    profile         :
    level           :
  Duration: 00:00:00.00, start: 42147.110000, bitrate: N/A
    Stream #0:0: Audio: mp3, 22050 Hz, stereo, s16p, 64 kb/s
    Stream #0:1: Video: h264 (High), yuv420p(progressive), 720x576, 25 fps, 25 tbr, 1k tbn
Video codec omx-h264 width 720 height 576 profile 100 fps 25.000000
Audio codec mp3 channels 2 samplerate 22050 bitspersample 16
Subtitle count: 0, state: off, index: 1, delay: 0
V:PortSettingsChanged: 720x576@25.00 interlace:0 deinterlace:0 anaglyph:0 par:0.94 display:0 layer:0 alpha:255 aspectMode:0
have a nice day ;)
and here is the info from the f5zbc stream:

Code: Select all

pi@raspberrypi:~ $ omxplayer --timeout 2 -I rtmp://batc.org.uk/live/f5zbc
[flv @ 0x1820fa0] audio stream discovered after head already parsed
[flv @ 0x1820fa0] video stream discovered after head already parsed
Input #0, flv, from 'rtmp://batc.org.uk/live/f5zbc':
  Metadata:
    Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
    displayWidth    : 720
    displayHeight   : 480
    fps             : 29
    profile         :
    level           :
  Duration: 00:00:00.00, start: 25280.503000, bitrate: N/A
    Stream #0:0: Audio: mp3, 22050 Hz, mono, s16p, 48 kb/s
    Stream #0:1: Video: h264 (High 4:2:2), yuv422p(progressive), 720x480, 30.30 fps, 29.97 tbr, 1k tbn, 59.94 tbc
Video codec omx-h264 width 720 height 480 profile 122 fps 29.970030
Audio codec mp3 channels 1 samplerate 22050 bitspersample 16
Subtitle count: 0, state: off, index: 1, delay: 0
have a nice day ;)
I have tried to make it work in omxplayer by changing the player parameters, but have not had any success.

Please could you try:
  • Forcing the video coding to h264 (High), yuv420p(progressive)
  • Forcing 25 fps
  • Forcing Display Height to 576
I think that the first is the most difficult, but the most likely to succeed. You can try these commands on your RPi. Let me know how you get on.

Dave

F4DVK
Posts: 23
Joined: Mon Nov 27, 2017 6:24 pm

Re: Streaming RX portsdown

Post by F4DVK » Sun Nov 18, 2018 9:19 pm

Hi Dave,

Thanks for your help.

With the modifications it works!

Thank you.
Stephane.

G8GKQ
Site Admin
Posts: 1237
Joined: Sun Mar 22, 2009 1:21 pm

Re: Streaming RX portsdown

Post by G8GKQ » Mon Nov 19, 2018 4:28 pm

Stephane

Please could you post here a copy of your working ffmpeg code? So that the next person can do it easily?

Thanks

Dave, G8GKQ

F4DVK
Posts: 23
Joined: Mon Nov 27, 2017 6:24 pm

Re: Streaming RX portsdown

Post by F4DVK » Mon Nov 19, 2018 6:38 pm

The problem is with the "yuv422p".

I left the resolution as the original video.
This code can probably be improved.

ffmpeg -f v4l2 -video_size "720x480" -r 25 -i /dev/video0 -f alsa -i pulse \
-acodec libmp3lame -ac 1 -ab 48k -ar 22050 \
-vcodec libx264 -preset veryfast -b:v 256k -minrate 256k -maxrate 512k -bufsize 320k -s 720x480 \
-vf format=yuv420p \
-f flv "rtmp://rtmp.batc.org.uk/live/f5zbc-xxxxxx"

Thanks again Dave.

Stephane.

G8GKQ
Site Admin
Posts: 1237
Joined: Sun Mar 22, 2009 1:21 pm

Re: Streaming RX portsdown

Post by G8GKQ » Mon Nov 19, 2018 8:42 pm

Thanks Stephane - good to know. Dave

Post Reply

Return to “Streaming”