[Libav-user] JPEG over RTSP

Mark Kenna mark.kenna at sureviewsystems.com
Mon Oct 29 17:48:58 CET 2012


Hi Guys

Two things:

1. I have been trying to get JPEG over RTSP working through FFMpeg but get
a bunch of errors. I've tried various command parameters but I cannot get
the stream playing properly. I have included a trace of the output just in
case someone can see what the issue could be:

C:\ffmpeg-20120608-git-718607b-win32-shared\bin>ffplay -loglevel debug
>> "rtsp://root:Roseb8d@81.138.238.97:554/profile0=r" -rtsp_transport tcp
>
> ffplay version N-41416-g718607b Copyright (c) 2003-2012 the FFmpeg
>> developers
>
>   built on Jun  8 2012 12:47:57 with gcc 4.6.3
>
>   configuration: --disable-static --enable-shared --enable-gpl
>> --enable-version3 --disable-w32threads --enable-runtime-cpudetect
>> --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass
>> --enable-libcelt --enable-libopencore-amrnb --
>
> enc --enabl  libavutil      51. 56.100 / 51. 56.100
>
>   libavcodec     54. 25.100 / 54. 25.100
>
>   libavformat    54.  6.101 / 54.  6.101
>
>   libavdevice    54.  0.100 / 54.  0.100
>
>   libavfilter     2. 78.101 /  2. 78.101
>
>   libswscale      2.  1.100 /  2.  1.100
>
>   libswresample   0. 15.100 /  0. 15.100
>
>   libpostproc    52.  0.100 / 52.  0.100
>
> [rtsp @ 00692fa0] SDP:
>
> v=0
>
> o=- 0 0 IN IP4 81.138.238.97
>
> s=rtsp://81.138.238.97/profile0
>
> c=IN IP4 0.0.0.0
>
> t=0 0
>
> m=application 0 RTP/AVP 122
>
> a=rtpmap:122 vnd.onvif.metadata/90000
>
> a=control:rtsp://81.138.238.97/profile0/METAEnc
>
> m=audio 0 RTP/AVP 0
>
> a=rtpmap:0 PCMU/8000/1
>
> a=control:rtsp://81.138.238.97/profile0/G711Enc
>
> m=video 0 RTP/AVP 26
>
> a=rtpmap:26 JPEG/90000
>
> a=control:rtsp://81.138.238.97/profile0/JPEGEnc
>
>
>> [rtsp @ 00692fa0] audio codec set to: pcm_mulaw
>
> [rtsp @ 00692fa0] audio samplerate set to: 8000
>
> [rtsp @ 00692fa0] audio channels set to: 1
>
> [rtsp @ 00692fa0] video codec set to: mjpeg
>
> [rtsp @ 00692fa0] hello state=0
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 22 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 4 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 18 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 14 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 4 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 13 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 18 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>     Last message repeated 4 times
>
> [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0
>
> [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring
>
> [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits)
>
> [mjpeg @ 006a8c00] No JPEG data found in image
>
> [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes
>
>

2. I have been trying to implement the manual decoding of RTP encoded JPEG
packets provided from the RTSP demuxer (as FFMpeg itself cannot decode the
frames). My question is whether there is any way to read the *entire* RTP
packet from an av_read_* call as the data that's currently being provided
by av_read_frame is the contents of the RTP packet without the headers
(which is no good for me as I need access to the RTP markers to determine
when a frame is ready for decoding).

I have tried using extra flags like so:

AVFormatContext *context = avformat_alloc_context();
> context->flags = AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN;
> int err = avformat_open_input(&context, cUrl, NULL, &inputOptions);


But it still outputs just the packet contents.

I would really like to avoid having to re-implement an RTSP client is
possible as FFMpeg works so well normally.

NB. I have purposefully left the RTSP uri in the FFMpeg command call in
case somebody wants to connect to the RTSP server and check for yourselves
:)

Thanks guys,
Mark.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121029/0755ac73/attachment.html>


More information about the Libav-user mailing list