Ullaakut / RTSPAllTheThings

Deprecated RTSP media server -- Use github.com/aler9/rtsp-simple-server instead.
Apache License 2.0
275 stars 72 forks source link

RTSPATT won't play avi file #46

Closed frallain closed 6 years ago

frallain commented 6 years ago

Hello, first thanks for this very handy docker image. Unfortunately, I can't make it work with an input video:

$ docker --version
Docker version 18.03.0-ce, build 0520e24

$ docker images
ullaakut/rtspatt                           latest              e167c26f0b26        7 months ago        647MB

$ wget http://www.engr.colostate.edu/me/facil/dynamics/files/drop.avi -O /tmp/drop.avi
$ docker run --name test_rtspatt -p 8554:8554 -v /tmp/:/tmp/  -e INPUT=/tmp/drop.avi ullaakut/rtspatt
Server configuration:
Address:    0.0.0.0
Port:       8554
Route:      /live.sdp
Username:   
Password:   

Input:      /tmp/drop.avi
Input type: file

H264 encoding with:
Framerate:  25
Resolution: 1280x720

Launching stream with the following pipeline: ( appsrc name=mysrc ! decodebin ! videoscale ! video/x-raw,width=1280,height=720 ! videorate ! video/x-raw,framerate=25/1 ! capsfilter ! queue ! x264enc speed-preset=superfast ! rtph264pay name=pay0 pt=96  )
Stream ready at rtsp://0.0.0.0:8554/live.sdp

# In another terminal
$ docker inspect test_rtspatt | grep IPAddress
             "SecondaryIPAddresses": null,
            "IPAddress": "172.17.0.2",
                    "IPAddress": "172.17.0.2",

$ vlc rtsp://0.0.0.0:8554/live.sdp
VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1~trusty1)
[000000000081e118] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
"sni-qt/19324" WARN  10:40:59.023 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE 
[00007fccac000e58] live555 demux error: Failed to connect with rtsp://0.0.0.0:8554/live.sdp
[00007fccb00009b8] core input error: open of `rtsp://0.0.0.0:8554/live.sdp' failed

$ vlc rtsp://172.17.0.2:8554/live.sdp
VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1~trusty1)
[00000000008e8118] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
"sni-qt/19348" WARN  10:41:05.814 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE 
[00007ff7d4000e58] live555 demux error: Failed to connect with rtsp://172.17.0.2:8554/live.sdp
[00007ff7e4000958] core input error: open of `rtsp://172.17.0.2:8554/live.sdp' failed

Any ideas?

Ullaakut commented 6 years ago

Hi @frallain,

I'll try replicating this issue with the same commands as you used, thanks for the details in the issue :)

Ullaakut commented 6 years ago

For some reason, it seems that the pipeline doesn't manage to read your avi file. I tried the exact same with an mp4 file instead and it worked fine. To be honest this is quite strange because IIRC we used avi files without any issues in the past, and from what I can see VLC is able to play your video just fine too. If you can, try to re-encode the video as it might be the reason for the issue.

@Gegonz Any other idea?

Ullaakut commented 6 years ago

@frallain Did you try re-encoding the video?

frallain commented 6 years ago

@Ullaakut Sorry for the delay, How can I do that?

Ullaakut commented 6 years ago

Using ffmpeg for example.

The issue here doesn't really come from RTSPATT but from the library we use to parse file inputs, which apparently has a problem decoding the video file it's given.

By running ffmpeg -i drop.avi -c:v libx264 result.mp4 and using the result.mp4 file instead, it should work. I tried it with a few different video files of mine and didn't get any issue, so I'm not sure what the problem was with your file.

If I have more time I'll try looking more closely at it to understand what exactly it is that we don't support.

frallain commented 6 years ago

@Ullaakut Yes it does work after re-encoding the video with ffmpeg as you proposed. Thanks

Ullaakut commented 6 years ago

😄 Just a shame I'm not sure what was wrong in the first place, but I am glad that it is now working :)

Let me know if there is anything else I can help you with.