[FFmpeg-user] Playing an uncompressed raw interlaced RTP video stream

villastar at yahoo.com.au villastar at yahoo.com.au
Thu Sep 27 17:36:20 EEST 2018


 On Wednesday, 26 September 2018, 11:31:00 pm AWST, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote: 
> 2018-09-26 14:15 GMT+02:00, villastar at yahoo.com.au
> <villastar-at-yahoo.com.au at ffmpeg.org>:
>> Hi,
>>
>> I am unable to get ffplay to play back a raw uncompressed interlaced
>> video from an RTP stream, coming from a camera feed. The camera
>> broadcasts the SDP using SAP, which I have been able to extract into
>> a local file. The contents of the SDP:
>>
>>  v=0
>>  o=- 340496 340496 IN IP4 192.168.204.40
>>  s=Camera 2
>>  c=IN IP4 239.192.1.40/15
>>  t=0 0
>>  m=video 5004 RTP/AVP 97
>>  a=rtpmap:97 raw/90000
>>  a=fmtp:97 sampling=YCbCr-4:2:2; width=720; height=576; depth=8;
>> colorimetry=BT601-5; interlace
>>  a=framerate:25
>>
>> I am using the following command to play it back with ffplay:
>>
>>  ffplay -protocol_whitelist file,rtp,udp -strict -2  -f sdp \
>>    camera2.sdp

> Complete, uncut console output missing.

This is the console ouptut when I set it to play for 3 seconds:

$ ffplay -protocol_whitelist file,rtp,udp -strict -2 -t 3 -f sdp camera.sdp
ffplay version 4.0.2 Copyright (c) 2003-2018 the FFmpeg developers
  built with gcc 7.3.1 (GCC) 20180722
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[udp @ 000001ef28178800] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 000001ef28188ac0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[sdp @ 000001ef28167840] jitter buffer full   0KB sq=    0B f=0/0
[sdp @ 000001ef28167840] RTP: missed 6 packets
[sdp @ 000001ef28167840] Missed previous RTP Marker
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
Input #0, sdp, from 'camera.sdp':
  Metadata:
    title           : Camera 1
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: bitpacked (UYVY / 0x59565955), uyvy422, 720x576, 50 fps, 50 tbr, 90k tbn, 90k tbc
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=1/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] jitter buffer full   0KB sq=    0B f=0/0
[sdp @ 000001ef28167840] RTP: missed 152 packets
[sdp @ 000001ef28167840] Missed previous RTP Marker
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] jitter buffer full   0KB sq=    0B f=0/0
[sdp @ 000001ef28167840] RTP: missed 153 packets
[sdp @ 000001ef28167840] Missed previous RTP Marker
    Last message repeated 1 times
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0

[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
[sdp @ 000001ef28167840] Missed previous RTP Markerq=    0B f=0/0
   4.75 M-V:  1.271 fd=   3 aq=    0KB vq=    0KB sq=    0B f=0/0

The only thing I noticed in the log was that it was picking up the
frames at 50fps, but the frame rate is listed as 25fps in the SDP. I
did another run with the log level set to trace, but didn't see
anything about it detecting it as being interlaced. The trace log is
at https://www.dropbox.com/s/6hr6pdflslnvn82/ffplay-trace.log

>> This resulting image showed two almost identical images laid out
>> vertically.

> This sounds like an issue that can be fixed with "-vf il=i" (or very
> similar)...

I'll try playing around with with "il" when I get a chance.

> Is the only issue the missing interleaving?

Yes, I believe this is the only problem I am having. According to the
camera's documentation, it is a PAL video encoded using ITU-R BT.601
and ITU-R BT.656 with interleaving. The RTP packets should be using
RFC 4175. I captured the RTP network traffic with Wireshark, which I
have uploaded to 
https://www.dropbox.com/s/l65o879qf2er3qi/camera_5.pcapng?dl=0.

>From reading the RFC 4175, I was starting to think that FFmpeg may be
reading the frames / fields incorrectly. Under 3. Payload Design, it
says for interlaced or BT. 656 field, it uses one range of lines for
field 1 and another range of lines for field 2. For example, BT.656
uses lines 24 to 310 for field 1 and lines 337 to 623 for field 2.
>From what I have been observing, I was guessing that FFmpeg may be
interpreting these fields as separate frames instead, with the images
displayed in corresponding ranges (giving me the two almost identical
images laid out vertically I mentioned earlier).


More information about the ffmpeg-user mailing list