RTSP to Twitch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RTSP to Twitch

Sébastien Bonaimé
Hi,

I would like to stream a Revotech H6EV200-S-30-L 0S77
(https://www.desertcart.com.my/products/57000744-revotech-hd-1920-x-1080p-2-0mp-indoor-ip-camera-mini-type-security-metal-camera-onvif-p2p-ip-cctv-cam-system-i706-black)
camera pointing to a bird nest through my raspberry pi4 to my twitch
channel.

First, I need to configure CBR or VBR in the camera. Using ffprobe
with the url of the camera I have the following results:
VBR 3072 smart_codec enable
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
1920x1080, 25 fps, 25 tbr, 90k tbn, 180k tbc
CBR 3072 smart_codec enable
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
1920x1080, 25 tbr, 90k tbn, 180k tbc

FFmpeg version is
ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg
developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)

included x264 codec are : libx264 libx264rgb h264_omx h264_v4l2m2m h264_vaapi

Here is my command line

url='rtsp://user:password@192.168.1.32:8554/0/av0'
twitch_url='rtmp://cdg.contribute.live-video.net/app/MY_twith_key'

     QUAL="ultrafast"  # one of the many FFMPEG preset
     CBR="3500k" # constant bitrate (should be between 1000k - 3000k)

        ffmpeg  -probesize  10M  -rtsp_transport tcp -thread_queue_size 1000k \
                  -i $url \
                -vsync 0 -enc_time_base -1 \
                 -bufsize 1024k -preset "$QUAL" \
                -b:v $CBR  -minrate $CBR -maxrate $CBR   -keyint_min 24 -g 24 \
                -crf 10  -c:v libx264    \
                -f flv $twitch_url


With camera in CBR mode, I can't reach 25 FPS but only 14. And the
stream to twitch does not last more than ew seconds. What can I do to
improve the command ?

Thanks

[rtsp @ 0x8952e0] Missing PPS in sprop-parameter-sets, ignoring
Input #0, rtsp, from 'rtsp://user:password@192.168.1.32:8554/0/av0':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : 0
  Duration: N/A, start: 0.040000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
1920x1080, 25 fps, 25 tbr, 90k tbn, 180k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x8fd140] MB rate (734400000) > level limit (16711680)
[libx264 @ 0x8fd140] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x8fd140] profile Constrained Baseline, level 6.2
[libx264 @ 0x8fd140] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html -
options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1
8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0
threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1
interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=24
keyint_min=13 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf
mbtree=0 crf=10.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
vbv_maxrate=3500 vbv_bufsize=1024 crf_max=0.0 nal_hrd=none filler=0
ip_ratio=1.40 aq=0
Output #0, flv, to 'rtmp://cdg.contribute.live-video.net/app/MY_twith_key':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : 0
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007),
yuvj420p(pc), 1920x1080, q=-1--1, 3500 kb/s, 25 fps, 1k tbn, 90k tbc
    Metadata:
      encoder         : Lavc58.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 3500000/0/3500000 buffer size: 1024000
vbv_delay: -1
[libx264 @ 0x8fd140] non-strictly-monotonic PTS
frame=  190 fps= 14 q=23.0 size=    3136kB time=00:00:08.88
bitrate=2892.7kbits/s speed=0.66x
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: RTSP to Twitch

Moritz Barsnick
Hi Sébastien,

On Wed, Mar 10, 2021 at 12:55:25 +0100, Sébastien Bonaimé wrote:

> included x264 codec are : libx264 libx264rgb h264_omx h264_v4l2m2m h264_vaapi

>         ffmpeg  -probesize  10M  -rtsp_transport tcp -thread_queue_size 1000k \
>                   -i $url \
>                 -vsync 0 -enc_time_base -1 \
>                  -bufsize 1024k -preset "$QUAL" \
>                 -b:v $CBR  -minrate $CBR -maxrate $CBR   -keyint_min 24 -g 24 \
>                 -crf 10  -c:v libx264    \
>                 -f flv $twitch_url
>
> With camera in CBR mode, I can't reach 25 FPS but only 14. And the
> stream to twitch does not last more than ew seconds. What can I do to
> improve the command ?

- Do you really need to reencode for twitch? Does it need CBR?
  Otherwise, you could just use the "copy" codec.

- AFAIU, you cannot combine "-b:v" and "-crf". I believe (fro mlooking
  at your logs) that the latter is being ignored.

- CRF 10 is really really low. What are you trying to achieve? Is the
  default of CRF 27 not good enough? CRF 10 is bound to take a lot of
  additional compute power (if not ignored).

- You listed other available encoders. Have you tried any of them? (I
  have no experience with HW accel on RaspPi, others may pitch in.)

> FFmpeg version is
> ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg developers

You should try to get hold of a newer version of ffmpeg. You may have
to compile yourself though. A newer version probably won't help with
the speed of libx264, but the support for the other HWAccels may have
improved.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: RTSP to Twitch

Michael Shaffer
In reply to this post by Sébastien Bonaimé
On Wed, Mar 10, 2021 at 6:56 AM Sébastien Bonaimé <[hidden email]>
wrote:

> Hi,
>
> I would like to stream a Revotech H6EV200-S-30-L 0S77
> (
> https://www.desertcart.com.my/products/57000744-revotech-hd-1920-x-1080p-2-0mp-indoor-ip-camera-mini-type-security-metal-camera-onvif-p2p-ip-cctv-cam-system-i706-black
> )
> camera pointing to a bird nest through my raspberry pi4 to my twitch
> channel.
>
> First, I need to configure CBR or VBR in the camera. Using ffprobe
> with the url of the camera I have the following results:
> VBR 3072 smart_codec enable
>     Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
> 1920x1080, 25 fps, 25 tbr, 90k tbn, 180k tbc
> CBR 3072 smart_codec enable
>     Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
> 1920x1080, 25 tbr, 90k tbn, 180k tbc
>
> FFmpeg version is
> ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg
> developers
>   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
>
> included x264 codec are : libx264 libx264rgb h264_omx h264_v4l2m2m
> h264_vaapi
>
> Here is my command line
>
> url='rtsp://user:password@192.168.1.32:8554/0/av0'
> twitch_url='rtmp://cdg.contribute.live-video.net/app/MY_twith_key'
>
>      QUAL="ultrafast"  # one of the many FFMPEG preset
>      CBR="3500k" # constant bitrate (should be between 1000k - 3000k)
>
>         ffmpeg  -probesize  10M  -rtsp_transport tcp -thread_queue_size
> 1000k \
>                   -i $url \
>                 -vsync 0 -enc_time_base -1 \
>                  -bufsize 1024k -preset "$QUAL" \
>                 -b:v $CBR  -minrate $CBR -maxrate $CBR   -keyint_min 24 -g
> 24 \
>                 -crf 10  -c:v libx264    \
>                 -f flv $twitch_url
>
>
> With camera in CBR mode, I can't reach 25 FPS but only 14. And the
> stream to twitch does not last more than ew seconds. What can I do to
> improve the command ?
>
> Thanks
>
> [rtsp @ 0x8952e0] Missing PPS in sprop-parameter-sets, ignoring
> Input #0, rtsp, from 'rtsp://user:password@192.168.1.32:8554/0/av0':
>   Metadata:
>     title           : Session Streamed by LIBZRTSP
>     comment         : 0
>   Duration: N/A, start: 0.040000, bitrate: N/A
>     Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
> 1920x1080, 25 fps, 25 tbr, 90k tbn, 180k tbc
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
> Press [q] to stop, [?] for help
> [libx264 @ 0x8fd140] MB rate (734400000) > level limit (16711680)
> [libx264 @ 0x8fd140] using cpu capabilities: ARMv6 NEON
> [libx264 @ 0x8fd140] profile Constrained Baseline, level 6.2
> [libx264 @ 0x8fd140] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC
> codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html -
> options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1
> psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1
> 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0
> threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1
> interlaced=0
> bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=24
> keyint_min=13 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf
> mbtree=0 crf=10.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
> vbv_maxrate=3500 vbv_bufsize=1024 crf_max=0.0 nal_hrd=none filler=0
> ip_ratio=1.40 aq=0
> Output #0, flv, to 'rtmp://cdg.contribute.live-video.net/app/MY_twith_key
> ':
>   Metadata:
>     title           : Session Streamed by LIBZRTSP
>     comment         : 0
>     encoder         : Lavf58.20.100
>     Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007),
> yuvj420p(pc), 1920x1080, q=-1--1, 3500 kb/s, 25 fps, 1k tbn, 90k tbc
>     Metadata:
>       encoder         : Lavc58.35.100 libx264
>     Side data:
>       cpb: bitrate max/min/avg: 3500000/0/3500000 buffer size: 1024000
> vbv_delay: -1
> [libx264 @ 0x8fd140] non-strictly-monotonic PTS
> frame=  190 fps= 14 q=23.0 size=    3136kB time=00:00:08.88
> bitrate=2892.7kbits/s speed=0.66x
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

In the camera settings, set the bitrate to the maximum your connection can
handle. Then use the “stream copy” mode in ffmpeg.

Currently, your command is trying to re-encode the video on a Raspberry Pi,
which is kind of underpowered for that task. It can handle stream copy mode
fine though.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: RTSP to Twitch

Sébastien Bonaimé
In reply to this post by Moritz Barsnick
Thanks for your advice. Here is my changes :

- changes my camera settings to VBR with 3532kb/s and  30 FPS
- With VLC, I can see the RTSP stream which is 1920x1080 @29.970030
FPS with H264 - MPEG-4 AVC (part10) (H264)

-compile ffmpeg on my pi4. Now I have ffmpeg version 4.3.2 Copyright
(c) 2000-2021 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --extra-cflags=-I/usr/local/include
--extra-ldflags=-L/usr/local/lib --extra-libs='-lpthread -lm -latomic'
--arch=armel --enable-gmp --enable-gpl --enable-libaom --enable-libass
--enable-libdav1d --enable-libdrm --enable-libfdk-aac
--enable-libfreetype --enable-libkvazaar --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus
--enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libssh
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg
--enable-libx264 --enable-libxml2 --enable-mmal --enable-nonfree
--enable-omx --enable-omx-rpi --enable-version3 --target-os=linux
--enable-pthreads --enable-openssl --enable-hardcoded-tables

- I simplify my ffmpeg command with this one
        ffmpeg     r  -rtsp_transport tcp -thread_queue_size 3000k \
                      -i $url \
                -vsync 0 -enc_time_base -1 \
                -c:a copy \
                -c:v copy   \
                -f flv $twitch_url



Now, I have only 11 FPS ! Why  am I not able to reach 30 FPS ?

[rtsp @ 0x1899220] Missing PPS in sprop-parameter-sets, ignoring
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://view3:my_pass@192.168.1.32:8554/0/av0':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : 0
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
1920x1080, 10 fps, 10 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, flv, to 'rtmp://cdg.contribute.live-video.net/app/my_key':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : 0
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (Main) ([7][0][0][0] / 0x0007),
yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 10 fps, 10 tbr,
1k tbn, 90k tbc
    Stream #0:1: Audio: pcm_mulaw ([8][0][0][0] / 0x0008), 8000 Hz,
mono, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[flv @ 0x18b5ee0] Timestamps are unset in a packet for stream 0. This
is deprecated and will stop working in the future. Fix your code to
set the timestamps properly
frame=  684 fps= 11 q=-1.0 size=    8797kB time=00:01:08.40
bitrate=1053.6kbits/s speed=1.07x

If I turn the rtsp_transport to udp, I still have 11 FPS and I miss
some packets.

Press [q] to stop, [?] for help
[flv @ 0x1ecd190] Timestamps are unset in a packet for stream 0. This
is deprecated and will stop working in the future. Fix your code to
set the timestamps properly
[rtsp @ 0x1e70220] max delay reached. need to consume packet
[rtsp @ 0x1e70220] RTP: missed 31 packets
[rtsp @ 0x1e70220] max delay reached. need to consume
packetbitrate=1008.1kbits/s speed=1.14x
[rtsp @ 0x1e70220] RTP: missed 3 packets
[rtsp @ 0x1e70220] max delay reached. need to consume packetbitrate=
982.2kbits/s speed=1.12x
[rtsp @ 0x1e70220] RTP: missed 4 packets
[rtsp @ 0x1e70220] max delay reached. need to consume packet
[rtsp @ 0x1e70220] RTP: missed 1 packets
[rtsp @ 0x1e70220] max delay reached. need to consume packetbitrate=
993.0kbits/s speed= 1.1x
[rtsp @ 0x1e70220] RTP: missed 1 packets
[rtsp @ 0x1e70220] max delay reached. need to consume
packetbitrate=1004.5kbits/s speed=1.08x
[rtsp @ 0x1e70220] RTP: missed 7 packets
[rtsp @ 0x1e70220] max delay reached. need to consume packet
[rtsp @ 0x1e70220] RTP: missed 1 packets
[rtsp @ 0x1e70220] max delay reached. need to consume
packetbitrate=1008.6kbits/s speed=1.07x
[rtsp @ 0x1e70220] RTP: missed 7 packets
[rtsp @ 0x1e70220] max delay reached. need to consume
packetbitrate=1010.3kbits/s speed=1.04x
[rtsp @ 0x1e70220] RTP: missed 10 packets
frame=  954 fps= 10 q=-1.0 size=   11858kB time=00:01:35.74
bitrate=1014.6kbits/s speed=1.04xPress [q] to stop, [?] for help

Thanks

Le mer. 10 mars 2021 à 14:58, Moritz Barsnick <[hidden email]> a écrit :

>
> Hi Sébastien,
>
> On Wed, Mar 10, 2021 at 12:55:25 +0100, Sébastien Bonaimé wrote:
>
> > included x264 codec are : libx264 libx264rgb h264_omx h264_v4l2m2m h264_vaapi
>
> >         ffmpeg  -probesize  10M  -rtsp_transport tcp -thread_queue_size 1000k \
> >                   -i $url \
> >                 -vsync 0 -enc_time_base -1 \
> >                  -bufsize 1024k -preset "$QUAL" \
> >                 -b:v $CBR  -minrate $CBR -maxrate $CBR   -keyint_min 24 -g 24 \
> >                 -crf 10  -c:v libx264    \
> >                 -f flv $twitch_url
> >
> > With camera in CBR mode, I can't reach 25 FPS but only 14. And the
> > stream to twitch does not last more than ew seconds. What can I do to
> > improve the command ?
>
> - Do you really need to reencode for twitch? Does it need CBR?
>   Otherwise, you could just use the "copy" codec.
>
> - AFAIU, you cannot combine "-b:v" and "-crf". I believe (fro mlooking
>   at your logs) that the latter is being ignored.
>
> - CRF 10 is really really low. What are you trying to achieve? Is the
>   default of CRF 27 not good enough? CRF 10 is bound to take a lot of
>   additional compute power (if not ignored).
>
> - You listed other available encoders. Have you tried any of them? (I
>   have no experience with HW accel on RaspPi, others may pitch in.)
>
> > FFmpeg version is
> > ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg developers
>
> You should try to get hold of a newer version of ffmpeg. You may have
> to compile yourself though. A newer version probably won't help with
> the speed of libx264, but the support for the other HWAccels may have
> improved.
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: RTSP to Twitch

Sébastien Bonaimé
I found my solution :

I set my camera to CBR 30 FPS smart codec OFF ad I have an output
bitrate of 3532Kbps

And here is my script

        cbr="3000k" #
        threads="4" #
        probesize="4M"

        ffmpeg      -probesize ${probesize} -hide_banner
-rtsp_transport tcp -thread_queue_size 3000k \
                      -i $url \
                -c:a copy \
                -c:v copy   \
                     -threads ${threads} -strict normal \
                             -bufsize ${cbr} \
                             -f flv $twitch_url


Now, I have 30 FPS  ! Before, I was making tests at night when the
camera was completely in the dark. Thus, with VBR, the FPS was really
low as nothing was moving. Now with CBR I have all the time 30 FPS

Thanks

Le jeu. 11 mars 2021 à 07:37, Sébastien Bonaimé <[hidden email]> a écrit :

>
> Thanks for your advice. Here is my changes :
>
> - changes my camera settings to VBR with 3532kb/s and  30 FPS
> - With VLC, I can see the RTSP stream which is 1920x1080 @29.970030
> FPS with H264 - MPEG-4 AVC (part10) (H264)
>
> -compile ffmpeg on my pi4. Now I have ffmpeg version 4.3.2 Copyright
> (c) 2000-2021 the FFmpeg developers
>   built with gcc 8 (Raspbian 8.3.0-6+rpi1)
>   configuration: --extra-cflags=-I/usr/local/include
> --extra-ldflags=-L/usr/local/lib --extra-libs='-lpthread -lm -latomic'
> --arch=armel --enable-gmp --enable-gpl --enable-libaom --enable-libass
> --enable-libdav1d --enable-libdrm --enable-libfdk-aac
> --enable-libfreetype --enable-libkvazaar --enable-libmp3lame
> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus
> --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libssh
> --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg
> --enable-libx264 --enable-libxml2 --enable-mmal --enable-nonfree
> --enable-omx --enable-omx-rpi --enable-version3 --target-os=linux
> --enable-pthreads --enable-openssl --enable-hardcoded-tables
>
> - I simplify my ffmpeg command with this one
>         ffmpeg     r  -rtsp_transport tcp -thread_queue_size 3000k \
>                       -i $url \
>                 -vsync 0 -enc_time_base -1 \
>                 -c:a copy \
>                 -c:v copy   \
>                 -f flv $twitch_url
>
>
>
> Now, I have only 11 FPS ! Why  am I not able to reach 30 FPS ?
>
> [rtsp @ 0x1899220] Missing PPS in sprop-parameter-sets, ignoring
> Guessed Channel Layout for Input Stream #0.1 : mono
> Input #0, rtsp, from 'rtsp://view3:my_pass@192.168.1.32:8554/0/av0':
>   Metadata:
>     title           : Session Streamed by LIBZRTSP
>     comment         : 0
>   Duration: N/A, start: 0.000000, bitrate: N/A
>     Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive),
> 1920x1080, 10 fps, 10 tbr, 90k tbn, 180k tbc
>     Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
> Output #0, flv, to 'rtmp://cdg.contribute.live-video.net/app/my_key':
>   Metadata:
>     title           : Session Streamed by LIBZRTSP
>     comment         : 0
>     encoder         : Lavf58.20.100
>     Stream #0:0: Video: h264 (Main) ([7][0][0][0] / 0x0007),
> yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 10 fps, 10 tbr,
> 1k tbn, 90k tbc
>     Stream #0:1: Audio: pcm_mulaw ([8][0][0][0] / 0x0008), 8000 Hz,
> mono, s16, 64 kb/s
> Stream mapping:
>   Stream #0:0 -> #0:0 (copy)
>   Stream #0:1 -> #0:1 (copy)
> Press [q] to stop, [?] for help
> [flv @ 0x18b5ee0] Timestamps are unset in a packet for stream 0. This
> is deprecated and will stop working in the future. Fix your code to
> set the timestamps properly
> frame=  684 fps= 11 q=-1.0 size=    8797kB time=00:01:08.40
> bitrate=1053.6kbits/s speed=1.07x
>
> If I turn the rtsp_transport to udp, I still have 11 FPS and I miss
> some packets.
>
> Press [q] to stop, [?] for help
> [flv @ 0x1ecd190] Timestamps are unset in a packet for stream 0. This
> is deprecated and will stop working in the future. Fix your code to
> set the timestamps properly
> [rtsp @ 0x1e70220] max delay reached. need to consume packet
> [rtsp @ 0x1e70220] RTP: missed 31 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume
> packetbitrate=1008.1kbits/s speed=1.14x
> [rtsp @ 0x1e70220] RTP: missed 3 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume packetbitrate=
> 982.2kbits/s speed=1.12x
> [rtsp @ 0x1e70220] RTP: missed 4 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume packet
> [rtsp @ 0x1e70220] RTP: missed 1 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume packetbitrate=
> 993.0kbits/s speed= 1.1x
> [rtsp @ 0x1e70220] RTP: missed 1 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume
> packetbitrate=1004.5kbits/s speed=1.08x
> [rtsp @ 0x1e70220] RTP: missed 7 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume packet
> [rtsp @ 0x1e70220] RTP: missed 1 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume
> packetbitrate=1008.6kbits/s speed=1.07x
> [rtsp @ 0x1e70220] RTP: missed 7 packets
> [rtsp @ 0x1e70220] max delay reached. need to consume
> packetbitrate=1010.3kbits/s speed=1.04x
> [rtsp @ 0x1e70220] RTP: missed 10 packets
> frame=  954 fps= 10 q=-1.0 size=   11858kB time=00:01:35.74
> bitrate=1014.6kbits/s speed=1.04xPress [q] to stop, [?] for help
>
> Thanks
>
> Le mer. 10 mars 2021 à 14:58, Moritz Barsnick <[hidden email]> a écrit :
> >
> > Hi Sébastien,
> >
> > On Wed, Mar 10, 2021 at 12:55:25 +0100, Sébastien Bonaimé wrote:
> >
> > > included x264 codec are : libx264 libx264rgb h264_omx h264_v4l2m2m h264_vaapi
> >
> > >         ffmpeg  -probesize  10M  -rtsp_transport tcp -thread_queue_size 1000k \
> > >                   -i $url \
> > >                 -vsync 0 -enc_time_base -1 \
> > >                  -bufsize 1024k -preset "$QUAL" \
> > >                 -b:v $CBR  -minrate $CBR -maxrate $CBR   -keyint_min 24 -g 24 \
> > >                 -crf 10  -c:v libx264    \
> > >                 -f flv $twitch_url
> > >
> > > With camera in CBR mode, I can't reach 25 FPS but only 14. And the
> > > stream to twitch does not last more than ew seconds. What can I do to
> > > improve the command ?
> >
> > - Do you really need to reencode for twitch? Does it need CBR?
> >   Otherwise, you could just use the "copy" codec.
> >
> > - AFAIU, you cannot combine "-b:v" and "-crf". I believe (fro mlooking
> >   at your logs) that the latter is being ignored.
> >
> > - CRF 10 is really really low. What are you trying to achieve? Is the
> >   default of CRF 27 not good enough? CRF 10 is bound to take a lot of
> >   additional compute power (if not ignored).
> >
> > - You listed other available encoders. Have you tried any of them? (I
> >   have no experience with HW accel on RaspPi, others may pitch in.)
> >
> > > FFmpeg version is
> > > ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg developers
> >
> > You should try to get hold of a newer version of ffmpeg. You may have
> > to compile yourself though. A newer version probably won't help with
> > the speed of libx264, but the support for the other HWAccels may have
> > improved.
> >
> > Cheers,
> > Moritz
> > _______________________________________________
> > ffmpeg-user mailing list
> > [hidden email]
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".