srt: stransmit does not work with UDP input (it works with pipes)

Hi, thanks a lot to open source this work, it is very interestig option for people who work in the live streaming maket. But I compiled this code in a Docker (Ubuntu 16 first, and Ubuntu 14 after) and I could NOT make it work (corrupted output). Thinking that the problem could have been the docker I compiled again in a VM Cent OS 6 (VMWare), and the following test resulted in the same corrupted output that I saw in my docker experiment.

CentOS test:

SOURCE (terminal1):

ffmpeg -f lavfi -re -i smptebars=duration=60:size=1280x720:rate=30 -f lavfi -re -i sine=frequency=1000:duration=60:sample_rate=44100 -pix_fmt yuv420p -c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -c:a libfdk_aac -b:a 96k -f mpegts udp://127.0.0.1:5000

SRT TX (terminal2):

./stransmit -r:10 -s:5 udp://:5000 srt://:9000

SRT RX & play (terminal3):

./stransmit srt://127.0.0.1:9000 file://con | ffplay -

This is a sample of what ffplay claims:

[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] channel element 1.6 is not allocated f=0/0   
[aac @ 0x7f3d5c006f20] channel element 2.5 is not allocated
[aac @ 0x7f3d5c006f20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] Prediction is not allowed in AAC-LC.
[aac @ 0x7f3d5c006f20] channel element 1.6 is not allocated
[aac @ 0x7f3d5c006f20] channel element 2.5 is not allocated
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] channel element 3.12 is not allocated
[aac @ 0x7f3d5c006f20] SBR was found before the first channel element.
[aac @ 0x7f3d5c006f20] channel element 2.10 is not allocated
[aac @ 0x7f3d5c006f20] channel element 1.6 is not allocated
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] channel element 2.13 is not allocated
[h264 @ 0x7f3d5c16c5e0] left block unavailable for requested intra mode at 0 27
[h264 @ 0x7f3d5c16c5e0] error while decoding MB 0 27
[h264 @ 0x7f3d5c16c5e0] concealing 1489 DC, 1489 AC, 1489 MV errors in I frame
[aac @ 0x7f3d5c006f20] channel element 2.4 is not allocated
[aac @ 0x7f3d5c006f20] channel element 3.4 is not allocated
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] skip_data_stream_element: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] If you heard an audible artifact, there may be a bug in the decoder. Clipped noise gain (-172 -> -100) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f3d5c006f20] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[aac @ 0x7f3d5c006f20] If you heard an audible artifact, there may be a bug in the decoder. Clipped noise gain (-175 -> -100) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f3d5c006f20] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[aac @ 0x7f3d5c006f20] If you heard an audible artifact, there may be a bug in the decoder. Clipped noise gain (-175 -> -100) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f3d5c006f20] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[aac @ 0x7f3d5c006f20] If you heard an audible artifact, there may be a bug in the decoder. Clipped noise gain (-177 -> -100) is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f3d5c006f20] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[aac @ 0x7f3d5c006f20] SSR is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f3d5c006f20] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[aac @ 0x7f3d5c006f20] channel element 2.5 is not allocated
[aac @ 0x7f3d5c006f20] skip_data_stream_element: Input buffer exhausted before END element found
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] channel element 3.4 is not allocated
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] Reserved bit set.
[aac @ 0x7f3d5c006f20] channel element 3.4 is not allocated
    Last message repeated 2 times
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] Prediction is not allowed in AAC-LC.
[aac @ 0x7f3d5c006f20] channel element 1.6 is not allocated
[aac @ 0x7f3d5c006f20] skip_data_stream_element: Input buffer exhausted before END element found
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] skip_data_stream_element: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] channel element 2.4 is not allocated
[h264 @ 0x7f3d5c16c5e0] left block unavailable for requested intra mode at 0 27
[h264 @ 0x7f3d5c16c5e0] error while decoding MB 0 27
[h264 @ 0x7f3d5c16c5e0] concealing 1489 DC, 1489 AC, 1489 MV errors in I frame
[aac @ 0x7f3d5c006f20] channel element 2.13 is not allocatedf=0/0   
    Last message repeated 1 times
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] skip_data_stream_element: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] Inconsistent channel configuration.
[aac @ 0x7f3d5c006f20] get_buffer() failed
[aac @ 0x7f3d5c006f20] channel element 3.4 is not allocated
[aac @ 0x7f3d5c006f20] Prediction is not allowed in AAC-LC.
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] channel element 3.6 is not allocated
[aac @ 0x7f3d5c006f20] channel element 2.13 is not allocatedf=0/0   
    Last message repeated 1 times
[aac @ 0x7f3d5c006f20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatch
[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] channel element 2.4 is not allocated f=0/0   
[aac @ 0x7f3d5c006f20] channel element 3.4 is not allocated
[h264 @ 0x7f3d5c1652c0] left block unavailable for requested intra mode at 0 27
[h264 @ 0x7f3d5c1652c0] error while decoding MB 0 27
[h264 @ 0x7f3d5c1652c0] concealing 1489 DC, 1489 AC, 1489 MV errors in I frame
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found
[mpegts @ 0x7f3d5c0008c0] PES packet size mismatchsq=    0B f=0/0   
[aac @ 0x7f3d5c006f20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] TYPE_FIL: Input buffer exhausted before END element found
[aac @ 0x7f3d5c006f20] channel element 2.13 is not allocated
[aac @ 0x7f3d5c006f20] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f3d5c006f20] decode_pce: Input buffer exhausted before END element found

PS : I also tried to save the file and play it later, and I also tried to send it to UDP receiving it in ffmpeg. All experiments same result: Corrupted output

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

When using ffmpeg to with pkt_size=1316 we also use:

flush_packets=0

This should reduce the latency at a cost of more io.

@ethouris Thanks a lot! This addition fixes everything pkt_size=1316, so the final command that make it work with UDP and ffmpeg is:

ffmpeg -f lavfi -re -i smptebars=duration=60:size=1280x720:rate=30 -f lavfi -re -i sine=frequency=1000:duration=60:sample_rate=44100 -pix_fmt yuv420p -c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -c:a libfdk_aac -b:a 96k -f mpegts "udp://127.0.0.1:5000?pkt_size=1316"

I still think that there is a bug here, in my opinion stransmit should be resilient to any UDP packet size. Or at least mention in the readme that it only allows 1316 bytes of payload in UDP packets.

Thanks again @ethouris