[Android Apps and Games] therealsteelskin:
Playback of transcoded .ogg files to Roberts Stream 93i always stops prematurely

Hi Bubbleguuum,

My Setup: Kubuntu 16.04.3 LTS, running BubbleUPnPServer0.9-update25, with bubbleupnp on Android and minidlna running on the same server. Renderers 4xchromecast, 2 x Samsung TVs, Roberts Radio Stream 93i.

Roberts Radio 93i supports AAC, FLAC,LPCM,M4A,MP3,WAV,WMA.

I've had the Roberts Stream 93i Radio some 2-3 years and in that time have always had issues playing .ogg encoded music to the device. (MP3 has always worked correctly as it doesn't need transcoding). The 93i does not support .ogg files so I select the .ogg tracks from the proxy server 'minidlna' So I have 'minidlna [proxy]' in my Library (servers) list. Using this proxy I then select the .ogg tracks and the 93i then plays a transcoded stream, transcoded by bubbleupnpserver/ffmpeg proxy. Looking at the information as shown in the track metadata. Stream #1Vorbis, 128kbps, stereo,44100 Hz, 4MB, Stream #2 LPCM, 16 bits, Stereo, 44100 Hz, Stream #3 WAV 16 bits, Stereo, 44100 Hz. In this same metadata it shows the track duration as 4:53. (Important ) However on the radio it shows the track length as 20 seconds shorter and sure enough the track will always end prematurely. This happens with all transcoded .ogg tracks. However i don't think it's a problem with the radio because if i click on the stream #3 (WAV) URL and open in mxplayer, mxplayer also reports a short track length the same as the radio does and sure enough mxplayer stops short too.. This would seem to point to a problem with either the ffmpeg transcode or bubbleupnpserver.

For test purposes I took a Kate Bush track 'King of the Mountain' The original .ogg file played on VLC/smplayer/MXPlayer and as recorded as "Duration" in bubbleupnps meta data is 4:53 (4 minutes, 53 seconds). On the radio and using the transcoded WAV stream the duration is 4:30 (23 seconds shorter) and if you play that stream it ends 23 seconds before it should do.

To test the encode without any arguments I manually converted the .ogg file to wav using both the bubbleupnp inbuilt ffmpeg and the distro ffmpeg. ie /usr/bin/ffmpeg -i KOTM.ogg KOTM.wav and /usr/share/bubbleupnpserver/ffmpeg -i KOTM.ogg KOTM.wav, both versions generated a WAV file that matched the original .ogg in duration ie 4:53.

Next I checked the logs.. for some reason the audio conversions appear in /var/log/syslog rather than /root/.bubbleupnpserver/BubbleUPnPServer.log.0 , where the video conversions are logged to /root/.bubbleupnpserver/BubbleUPnPServer.log.0 ?

In /var/log/syslog bubbleupnp uses the system ffmpeg to transcode as follows

ffmpeg -i http ://192.168.0.26:8200/MediaItems/17134.dat -ar 44100 -ac 2 -af aresample=resampler=soxr:precision=28 -vn -f s16be -

to produce an LPCM, 16 bit, stereo stream. If I modify that command

ffmpeg -i http ://192.168.0.26:8200/MediaItems/17134.dat -ar 44100 -ac 2 -af aresample=resampler=soxr:precision=28 -vn -f wav KOTM.wav

to produce a wav file. the result is a duration of 4:53.

I have also used

ffmpeg -i http ://192.168.0.26:8200/MediaItems/17134.dat -ar 44100 -ac 2 -af aresample=resampler=soxr:precision=28 -vn -f s16be udp://192.168.0.26:58800

to stream via udp to ffplay and measured the time which was also 4:53

So I guess those tests prove it's not ffmpeg ? Where is the duration time retrieved from when it's a stream ?

Calculating the duration from the sample rate and WAV file size. WAV=51814990 bytes, sample rate 44.1KHz = 176400 bytes/sec

therefore (51814990-44)/176400 = 293.73552154195011337868 = 294 seconds = 4:53.

If you could advise on the next steps to debug this that would be appreciated. Thanks

Regards

Nick

Further Info.. FFMPEG versions

bubbleupnp version

/usr/share/bubbleupnpserver/ffmpeg

ffmpeg version N-86343-g3385989 Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)

configuration: --prefix=/home/bobbie/ffmpeg-static/target --pkg-config-flags=--static --extra-cflags=-I/home/bobbie/ffmpeg-static/target/include --extra-ldexeflags='-Wl,-Bstatic' --extra-ldflags=-L/home/bobbie/ffmpeg-static/target/lib --extra-libs='-Wl,-Bdynamic -lm -ldl' --bindir=/home/bobbie/ffmpeg-static/bin --enable-pic --disable-doc --disable-debug --disable-ffplay --disable-ffserver --disable-fontconfig --enable-gpl --enable-version3 --disable-frei0r --disable-libass --disable-libfribidi --disable-libfreetype --disable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --disable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --disable-libvidstab --disable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --disable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-libzimg --enable-gnutls --enable-libmfx

libavutil 55. 63.100 / 55. 63.100

libavcodec 57. 96.101 / 57. 96.101

libavformat 57. 72.101 / 57. 72.101

libavdevice 57. 7.100 / 57. 7.100

libavfilter 6. 91.100 / 6. 91.100

libswscale 4. 7.101 / 4. 7.101

libswresample 2. 8.100 / 2. 8.100

libpostproc 54. 6.100 / 54. 6.100

Distro Version

/usr/bin/ffmpeg

ffmpeg version 3.2.6-1~backport1.1~xenial Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609

configuration: --prefix=/usr --extra-version='1~backport1.1~xenial' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --disable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared

libavutil 55. 34.101 / 55. 34.101

libavcodec 57. 64.101 / 57. 64.101

libavformat 57. 56.101 / 57. 56.101

libavdevice 57. 1.100 / 57. 1.100

libavfilter 6. 65.100 / 6. 65.100

libavresample 3. 1. 0 / 3. 1. 0

libswscale 4. 2.100 / 4. 2.100

libswresample 2. 3.100 / 2. 3.100

libpostproc 54. 1.100 / 54. 1.100