Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

RTSP: audio/video only, not both

Discussions about problems encountered using ffserver.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

RTSP: audio/video only, not both

Postby fitz1234 » Thu Jun 30, 2016 7:51 pm

Hello folks!

Spend over a 3 days digging documentation and examples, but it seems impossible to make RTSP stream work via ffserver.
So far I'm able to get ether Audio or Video only, not both :cry:

Please, any advises and help highly appreciated! :!:

Here's my config, super basic:
Code: Select all
HTTPPort 8090
RTSPPort 8091

RTSPBindAddress 0.0.0.0
HTTPBindAddress 0.0.0.0

MaxBandwidth 1000000

<Feed feed1.ffm>
   File /dev/shm/feed1.ffm
   FileMaxSize 5M
   Launch ffmpeg -re -i video2.mp4 -c copy
   ACL allow 127.0.0.1
</Feed>

################################

<Stream file.rtsp>
   Format rtp
   Feed feed1.ffm

   VideoCodec libx265
   VideoFrameRate 24
   VideoBitRate 2048
   VideoSize 1280x720
   AVOptionVideo flags +global_header

        AudioCodec libmp3lame
        AVOptionAudio flags +global_header
</Stream>

<Stream stat.html>
   Format status
</Stream>


ffserver itself and ffmpeg inside both starts fine with following output:
Code: Select all
ffserver version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
  configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
ffserver.conf:34: Setting default value for audio bit rate = 64000. Use NoDefaults to disable it.
ffserver.conf:34: Setting default value for audio sample rate = 22050. Use NoDefaults to disable it.
ffserver.conf:34: Setting default value for audio channel count = 1. Use NoDefaults to disable it.
ffserver.conf:34: Setting default value for video bit rate tolerance = 512000. Use NoDefaults to disable it.
ffserver.conf:34: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
ffserver.conf:34: Setting default value for video max rate = 4096000. Use NoDefaults to disable it.
ffserver.conf:34: Setting default value for video buffer size = 4096000. Use NoDefaults to disable it.
Fri Jul  1 02:35:46 2016 FFserver started.
Fri Jul  1 02:35:46 2016 Launch command line: ffmpeg -re -i video2.mp4 -c copy http://127.0.0.1:8090/feed1.ffm
ffmpeg version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
  configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x130d340] stream 0, timescale not set
[mjpeg @ 0x1313600] Changeing bps to 8
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video2.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2014-02-13 22:15:01
    title           : Adventure Time - 02.12 - Her Parents
    encoder         : HandBrake 0.9.9 2013052900
  Duration: 00:10:47.53, start: 0.000000, bitrate: 1218 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 1050 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2014-02-13 22:15:01
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
    Metadata:
      creation_time   : 2014-02-13 22:15:01
    Stream #0:2: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 640x610 [SAR 72:72 DAR 64:61], 90k tbr, 90k tbn, 90k tbc
Fri Jul  1 02:35:46 2016 127.0.0.1 - - New connection: GET /feed1.ffm
Fri Jul  1 02:35:46 2016 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175
Fri Jul  1 02:35:46 2016 127.0.0.1 - - New connection: POST /feed1.ffm
x265 [info]: HEVC encoder version 1.9
x265 [info]: build info [Linux][GCC 5.3.1][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: frame threads / pool features       : 2 / wpp(12 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 24 / 250 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / 1 / 1
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : ABR-2048 kbps / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 signhide tmvp strong-intra-smoothing
x265 [info]: tools: lslices=4 deblock sao
Output #0, ffm, to 'http://127.0.0.1:8090/feed1.ffm':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2016-07-01 02:35:46
    title           : Adventure Time - 02.12 - Her Parents
    encoder         : Lavf56.40.101
    Stream #0:0(eng): Audio: mp3 (libmp3lame), 22050 Hz, mono, s32p, 64 kb/s (default)
    Metadata:
      creation_time   : 2014-02-13 22:15:01
      encoder         : Lavc56.60.100 libmp3lame
    Stream #0:1(und): Video: hevc (libx265), yuv420p, 1280x720, q=2-31, 2048 kb/s, 23.98 fps, 1000k tbn, 24 tbc (default)
    Metadata:
      creation_time   : 2014-02-13 22:15:01
      encoder         : Lavc56.60.100 libx265
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame))
  Stream #0:0 -> #0:1 (h264 (native) -> hevc (libx265))


But I'm unable to play audio and video at the same time

with setting posted above I get audio only (notice: no fps detected for the video stream):
Code: Select all
ffplay rtsp://x.x.x.x:8091/file.rtsp
...
Input #0, rtsp, from 'rtsp://IPaddress:8091/file.rtsp': f=0/0   
  Metadata:
    title           : No Title
  Duration: N/A, start: 11262.990356, bitrate: 64 kb/s
    Stream #0:0: Audio: mp3, 22050 Hz, mono, s16p, 64 kb/s
    Stream #0:1: Video: hevc (Main), yuv420p(tv), 1280x720, 24 tbr, 90k tbn, 24 tbc
 aq=   58KB vq=    0KB sq=    0B f=0/0 


Meanwhile server side:
Code: Select all
Fri Jul  1 02:48:42 2016 IPaddress:29978 - - "PLAY file.rtsp/streamid=0 RTP/UDP"
Fri Jul  1 02:48:42 2016 IPaddress:29980 - - "PLAY file.rtsp/streamid=1 RTP/UDP"
frame=  322 fps= 24 q=-0.0 size=    2656kB time=00:00:13.50 bitrate=1611.4kbits/s


If I add NoAudio into configuration - video only works greatly! (notice vq= 151KB and 24 fps)
Code: Select all
Input #0, rtsp, from 'rtsp://IPaddress:8091/file.rtsp': f=0/0   
  Metadata:
    title           : No Title
  Duration: N/A, start: 11212.024533, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 1280x720, 24 fps, 24 tbr, 90k tbn, 24 tbc
11223.37 M-V:  0.015 fd=   9 aq=    0KB vq=  151KB sq=    0B f=1/0


The same with NoVideo - audio only works great
Code: Select all
Input #0, rtsp, from 'rtsp://IPaddress:8091/file.rtsp': f=0/0   
  Metadata:
    title           : No Title
  Duration: N/A, start: 58967.315056, bitrate: 64 kb/s
    Stream #0:0: Audio: mp3, 22050 Hz, mono, s16p, 64 kb/s
58973.89 M-A:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   


p.s. I tried also last snapshot and 3.1 versions - both crashed with anything related to RTSP. 3.0 don't crash, but Video/Audio only stream dies in 5-10 seconds after start. So Ubuntu default, 2.8 release seems to be most stable at least for RSTP
fitz1234
 
Posts: 2
Joined: Thu Jun 30, 2016 5:40 pm

Re: RTSP: audio/video only, not both

Postby ragees » Wed Nov 30, 2016 1:34 pm

Same here, audio or video but not both.

I did it using asf but not compatible to mobile devices.

Did you find anything interesting?

Regards.
ragees
 
Posts: 1
Joined: Wed Nov 30, 2016 1:26 pm


Return to ffserver

Who is online

Users browsing this forum: Google [Bot] and 5 guests