android dropping connection and audio out of sync

About encoding, codec settings, muxers and filter usage
mirswith
Blank Cone
Blank Cone
Posts: 49
Joined: 15 Dec 2011 01:15

android dropping connection and audio out of sync

Postby mirswith » 04 Feb 2012 00:20

Hi. I am trying to transcode and stream a video to my android devices and both of them encounter the same issue, that is they drop the connection thinking the stream has ended after about a minute of playback every time and that does not count the 12 seconds it takes to buffer before anything is seen which appears to be an android not vlc issue. Here is the command I am issuing, any ideas why the client would drop and audio is out of sync? Anything I can try?

Code: Select all

vlc mystream.webm --sout "#transcode{vcodec=h264,vb=2048,fps=15,scale=1,venc=x264{aud,profile=baseline,level=30,keyint=15,bframes=0,ref=1,nocabac},acodec=mp4a,ab=128,channels=2,samplerate=44100,audio-sync}:rtp{sdp=rtsp://:5544/test}" --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep
On a side note using vlc on another machine sees the stream fine without dropping connection however the audio is also out of sync. The audio is fine in the my source file.

UPDATE: adding preset=ultrafast to the x264 settings seems to fix the audio issue (although encoding doesnt look that great). Maybe my machine is too slow for the encoding I am trying causing the sync issue; however I thought audio-sync was supposed to take care of that if my cpu could not keep up. Would like confirmation either way. Still can't figure out the dropping connection issue though.

UPDATE #2: I have just confirmed that QuickTime running on a Mac will also drop the connection, it looks like this is not specific to the android. I am using a build of VLC pulled from git v2.1.0-git however I have confirmed the issue is the same with v1.3.0-git.

Thanks.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: android dropping connection and audio out of sync

Postby Rémi Denis-Courmont » 05 Feb 2012 10:38

The server is probably timing out the RTP session because the client is not sending keep-alives.

This is necessary to avoid forever dangling RTP sessions.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mirswith
Blank Cone
Blank Cone
Posts: 49
Joined: 15 Dec 2011 01:15

Re: android dropping connection and audio out of sync

Postby mirswith » 05 Feb 2012 22:26

Surely if the bog standard android player and apples quick time both disconnect the same then it seems something is happening within vlc; there is nothing I can do in either of those clients to make them send keep-alives.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: android dropping connection and audio out of sync

Postby Rémi Denis-Courmont » 06 Feb 2012 11:10

If it works with the VLC client, I blame QuickTime and Android. Otherwise, I blame the firewall or the network.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mirswith
Blank Cone
Blank Cone
Posts: 49
Joined: 15 Dec 2011 01:15

Re: android dropping connection and audio out of sync

Postby mirswith » 06 Feb 2012 17:34

If the network is at fault, what are some things to check for? Except i'm guessing it is not the network because the vlc client on the same mac with quicktime does not drop connection. Is there anyway to tell with the vlc as to why a connection was dropped? Thanks.

UPDATE: I've been trying some other rtsp streams in quicktime such as this one [url]rtsp://a2047.v1412b.c1412.g.vq.akamaistream.net/5/2047/1412/1_h264_350/1a1a1ae555c531960166df4dbc3095c327960d7be756b71b49aa1576e344addb3ead1a497aaedf11/8848125_1_350.mov[/url] and it plays fine without dropping connection.

mirswith
Blank Cone
Blank Cone
Posts: 49
Joined: 15 Dec 2011 01:15

Re: android dropping connection and audio out of sync

Postby mirswith » 08 Feb 2012 19:37

Looks like adding the argument --rtsp-timeout=-1 fixes this for me. Are there any side effects to setting in indefinite timeout like this?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 9 guests