FAQ  •  Register  •  Login

[Solved] "-an" ffmpeg parameter strips audio from online

<<

bkeith4web

Streaming enthusiast

Posts: 32

Joined: Sat Feb 02, 2013 11:48 pm

Post Fri Nov 11, 2022 9:17 pm

[Solved] "-an" ffmpeg parameter strips audio from online

I hope this is just something weird with my configuration but if so I can't find it.
[Spoiler alert - it was something with my configuration, not a bug, possibly failed to check 'include all available audio streams' on transcoding page, in any case reinstall fixed the problem]
I'm serving a video/audio stream from streamlink to Serviio and it's a valid Live Stream per the Serviio online source check.
When I check the stream from VLC (http://gamer:8081) it plays fine and VLC says it has stream 0 (h264/mpeg-4 part 10) and stream 1 audio with codec "ADTS"
ffmpeg -i reports it as mpegts, h264 (main) and aac

MediaBrowser using the stock html5 profile plays video with no audio (so does my Roku and sony blu-ray but let's stick with MB). When I look in the serviio log I this line:
OnlineTranscoding > [APPLE_HTTP/H264/AAC] > matcher: 1
which makes sense as the html5 profile says this:
<Video targetContainer="applehttp" targetVCodec="h264" targetACodec="aac" forceStereo="true">
<Matches container="*" />

Further testing with multiple profiles seems to show that the profile actually matches against container "flv" for this stream, NOT against mpegts despite what ffmpeg -i says.

So the thing that seems to be a bug is the ffmpeg invocation that gets created:
C:\Program Files\Serviio\bin\\..\lib\ffmpeg.exe -fflags +genpts -threads 0 -analyzeduration 10000000 -i http://gamer:8081 -y -c:v copy -bsf:v h264_mp4toannexb -an -map 0:0 -sn -f hls -hls_time 10 -hls_allow_cache 0 -hls_segment_filename E:\temp\Serviio\transcoding-temp-e0df80b28b6e48f1eb6bc26ab45e3a0d.stf\segment%05d.ts -hls_list_size 10 -hls_flags delete_segments E:\temp\Serviio\transcoding-temp-e0df80b28b6e48f1eb6bc26ab45e3a0d.stf\playlist.m3u8

The "-an" parameter strips out the audio stream and that's exactly what happens when I inspect the transcode files created by the MB transcode. All the .ts files have a video stream:
Video: MPEG4 Video (H264) 1280x720 29.971fps [V: h264 main L3.1, yuv420p, 1280x720]

But they have no audio stream. I've tried transcoding just the container, container and video, I've tried audio ac3, aac and mp3 and I've tried with the RokuMPApp and bdp2013 profiles (stock and modified ones I have in user-profiles) and the "-an" flag is still there.

Is there something I'm missing here? Some compatibility check of container/audio codec that's tripping me up? Does it matter what order the video/audio streams are in? I'm not an ffmpeg expert but this is what jumped out at me. Again I'm doing this with the standard html5 profile from application-profiles for MediaBrowser and if I use VLC to play the stream from streamlink at port 8081, the audio is definitely in place.

The "is it flv or is it mpegts" seems a bit confusing but regardless, the online transcoding section of the profile is definitely matching and kicking off ffmpeg like you would expect.

Before filing a bug ticket I wanted to post this to see if anybody sees something that I'm missing.

Edit: Also I see this post that had to do with ADTS although this was specific to Roku. Roku is one of my problems but this is happening with mediaBrowser too. viewtopic.php?f=5&t=29904&p=133531&hilit=adts#p133531

Also by the way if I tell Streamlink to save the file locally then it plays with audio and video just fine through MB so it's only as an online source that there is a problem. Putting the same target lines into the html5 "Online" section that worked in the "regular" section didn't solve the problem, the ffmpeg invocation was still with the "-an" flag.
Last edited by bkeith4web on Sun Nov 13, 2022 1:40 pm, edited 1 time in total.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Nov 12, 2022 12:37 pm

Re: Bug?: "-an" ffmpeg parameter strips audio from online

can you post ffmpeg -i of the stream?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Nov 12, 2022 12:38 pm

Re: Bug?: "-an" ffmpeg parameter strips audio from online

and also detailed log of trying to play the stream
<<

bkeith4web

Streaming enthusiast

Posts: 32

Joined: Sat Feb 02, 2013 11:48 pm

Post Sat Nov 12, 2022 12:58 pm

Re: Bug?: "-an" ffmpeg parameter strips audio from online

Thanks for the followup, here's the ffmpeg -i (and I also tried the latest ffmpeg version, same results but this is the one bundled with serviio):
C:\Program Files\Serviio\lib>ffmpeg -i "http://gamer:8081"
ffmpeg version 3.4.4 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180830
configuration: --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame --enable-libass --enable-librtmp --enable-fontconfig --enable-libfreetype --enable-zlib --enable-libx264 --enable-libspeex --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm -lexpat -lfreetype -lfribidi -lz' --arch=x86_64 --enable-runtime-cpudetect --target-os=mingw64 --cross-prefix=x86_64-w64-mingw32- --enable-gpl --pkg-config=pkg-config --bindir='/jenkins/workspace/FFmpeg - Win64/target'
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[h264 @ 0000000002bc4080] non-existing SPS 0 referenced in buffering period
[h264 @ 0000000002bc4080] SPS unavailable in decode_picture_timing
[h264 @ 0000000002bc4080] non-existing SPS 0 referenced in buffering period
[h264 @ 0000000002bc4080] SPS unavailable in decode_picture_timing
Input #0, mpegts, from 'http://gamer:8081':
Duration: N/A, start: 0.000000, bitrate: N/A
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x101](und): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 240 kb/s
At least one output file must be specified
<<

bkeith4web

Streaming enthusiast

Posts: 32

Joined: Sat Feb 02, 2013 11:48 pm

Post Sat Nov 12, 2022 1:13 pm

Re: Bug?: "-an" ffmpeg parameter strips audio from online

First ocurrence of the online source in the log following restart with detailed logging:

2022-11-12T06:00:20,068 DEBUG [FFmpegMetadataRetriever] Retrieving H264 profile/level for file 'http://gamer:8081'
2022-11-12T06:00:20,068 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve H264 header for file: http://gamer:8081
2022-11-12T06:00:20,068 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\\..\lib\ffmpeg.exe -analyzeduration 10000000 -i http://gamer:8081 -frames:v 1 -c:v copy -f h264 -an pipe:
2022-11-12T06:00:27,935 DEBUG [FFmpegMetadataRetriever] File 'http://gamer:8081' has H264 profile MAIN, levels [{H=3.1, RF=3.1}] and 3 ref frames
2022-11-12T06:00:28,773 DEBUG [MediaItemDAOImpl] Getting counts of media items by type
2022-11-12T06:00:31,507 DEBUG [RepositoryServerResource] Updating repository with values: OnlineRepository [repositoryUrl=http://gamer:8081, fileType=VIDEO, repoType=LIVE_STREAM, userEnteredThumbnailUrl=null, repositoryName=NHL 8081, enabled=true, userIds=[1], order=1, id=3]
2022-11-12T06:00:31,507 DEBUG [RepositoryServerResource] Updating repository with values: OnlineRepository [repositoryUrl=http://gamer:8082, fileType=VIDEO, repoType=LIVE_STREAM, userEnteredThumbnailUrl=null, repositoryName=NHL 8082, enabled=true, userIds=[1], order=2, id=4]
2022-11-12T06:00:31,507 DEBUG [RepositoryServerResource] Updating repository with values: OnlineRepository [repositoryUrl=http://gram7:8081, fileType=VIDEO, repoType=LIVE_STREAM, userEnteredThumbnailUrl=null, repositoryName=Gram7 NHL 8081, enabled=true, userIds=[1], order=3, id=103]
2022-11-12T06:00:33,741 DEBUG [OnlineContentCacheDecorator] Removed online content 'http://gamer:8081' from cache (online_feeds)
2022-11-12T06:00:33,741 DEBUG [WebResourceParser] Removing all items from parsed items' cache for resource: http://gamer:8081
2022-11-12T06:00:37,641 DEBUG [OnlineContentCacheDecorator] Stored online content 'http://gamer:8081' in the cache (online_feeds), returning it

NB: the lines above are before I tried playing it i.e. this is when I checked that it was valid, selected 'OK' and 'save' and 'force refresh'.
The lines below are from when I played it (if there are other relevant lines that I did not include please let me know and I'll grab them too)
The last line reflects when it was still playing video with no audio and creating transcode files. It got matcher:1 appplehttp/h264/aac in the html5 profile which all looks normal.

2022-11-12T06:05:45,885 DEBUG [DiscoverySSDPMessageListener] Received a valid M-SEARCH message for search target urn:dial-multiscreen-org:service:dial:1 from address /10.3.2.36:55165s
2022-11-12T06:05:45,885 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 10.3.2.36
2022-11-12T06:05:45,886 DEBUG [UserDAOImpl] Reading a User (id = 1)
2022-11-12T06:06:06,753 DEBUG [LicensingManager] Updating license
2022-11-12T06:06:06,753 DEBUG [LicenseValidator] Validating license file (365 bytes)
2022-11-12T06:06:06,791 DEBUG [UserDAOImpl] Looking for a User (name = Brad)
2022-11-12T06:06:06,792 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [FEED, WEB_RESOURCE] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:06,792 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [LIVE_STREAM] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:06,793 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 1000000030001860 and profile HTML5
2022-11-12T06:06:06,794 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:06,794 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:06,794 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:06,794 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 1000000040001122 and profile HTML5
2022-11-12T06:06:06,795 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8082": HLS
2022-11-12T06:06:06,795 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8082": HLS
2022-11-12T06:06:06,795 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8082": HLS
2022-11-12T06:06:06,795 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [FEED, WEB_RESOURCE] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:06,795 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [LIVE_STREAM] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:06,807 DEBUG [UserDAOImpl] Looking for a User (name = Brad)
2022-11-12T06:06:06,808 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [FEED, WEB_RESOURCE] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:06,808 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [LIVE_STREAM] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:06,809 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [FEED, WEB_RESOURCE] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:06,809 DEBUG [OnlineRepositoryDAOImpl] Retrieving list of [LIVE_STREAM] OnlineRepositories for VIDEO [Brad]
2022-11-12T06:06:08,250 DEBUG [FlowPlayerV7KeyGeneratorServerResource] Generating v7 security key for domain 'gamer'
2022-11-12T06:06:08,251 DEBUG [FlowPlayerV7KeyGeneratorServerResource] RefererRef of the incoming request is 'gamer'
2022-11-12T06:06:08,259 DEBUG [UserDAOImpl] Looking for a User (name = Brad)
2022-11-12T06:06:08,260 DEBUG [OnlineRepositoryDAOImpl] Reading an OnlineRepository (id = 3)
2022-11-12T06:06:08,260 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 1000000030001860 and profile HTML5
2022-11-12T06:06:08,261 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:08,261 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:08,261 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,864 DEBUG [CDSRetrieveMediaServerResource] GET http://gamer:23424/cds/resource/1000000 ... diaBrowser HTTP/1.1, headers = [host: gamer:23424,connection: keep-alive,user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36,accept: */*,referer: http://gamer:23424/mediabrowser/,accept-encoding: gzip, deflate,accept-language: en,sv;q=0.9,en-US;q=0.8,nl;q=0.7,de;q=0.6,ca;q=0.5,es-ES;q=0.4,es;q=0.3,pl;q=0.2]
2022-11-12T06:06:09,869 DEBUG [UserDAOImpl] Looking for a User (name = Brad)
2022-11-12T06:06:09,869 DEBUG [CDSRetrieveMediaServerResource] Creating client with id '10.3.2.36' and name 'MediaBrowser'
2022-11-12T06:06:09,870 DEBUG [ResourceDeliveryProcessor] Resource request accepted. Using client 'Identifier=10.3.2.36, Profile=HTML5, Name=MediaBrowser'
2022-11-12T06:06:09,870 DEBUG [ResourceDeliveryProcessor] Request for resource 1000000030001860 and type 'MANIFEST' received
2022-11-12T06:06:09,871 DEBUG [ManifestRetrievalStrategy] Retrieving info of Manifest for media item with id 1000000030001860
2022-11-12T06:06:09,871 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 1000000030001860 (online)
2022-11-12T06:06:09,871 DEBUG [OnlineRepositoryDAOImpl] Reading an OnlineRepository (id = 3)
2022-11-12T06:06:09,872 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 1000000030001860 and profile HTML5
2022-11-12T06:06:09,872 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,872 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,872 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,874 DEBUG [ManifestRetrievalStrategy] Retrieving Manifest for media item with id 1000000030001860
2022-11-12T06:06:09,874 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 1000000030001860 (online)
2022-11-12T06:06:09,874 DEBUG [OnlineRepositoryDAOImpl] Reading an OnlineRepository (id = 3)
2022-11-12T06:06:09,874 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 1000000030001860 and profile HTML5
2022-11-12T06:06:09,875 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,875 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,875 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,875 DEBUG [GETMethodProcessor] Stream entity has length: 200
2022-11-12T06:06:09,886 DEBUG [CDSRetrieveMediaServerResource] GET http://gamer:23424/cds/resource/1000000 ... 0c732a284d HTTP/1.1, headers = [host: gamer:23424,connection: keep-alive,user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36,accept: */*,referer: http://gamer:23424/mediabrowser/,accept-encoding: gzip, deflate,accept-language: en,sv;q=0.9,en-US;q=0.8,nl;q=0.7,de;q=0.6,ca;q=0.5,es-ES;q=0.4,es;q=0.3,pl;q=0.2]
2022-11-12T06:06:09,886 DEBUG [CDSRetrieveMediaServerResource] Creating client with id '10.3.2.36' and name 'MediaBrowser'
2022-11-12T06:06:09,886 DEBUG [ResourceDeliveryProcessor] Resource request accepted. Using client 'Identifier=10.3.2.36, Profile=HTML5, Name=MediaBrowser'
2022-11-12T06:06:09,886 DEBUG [ResourceDeliveryProcessor] Request for resource 1000000030001860 and type 'MEDIA_ITEM' received
2022-11-12T06:06:09,886 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 1000000030001860 (online)
2022-11-12T06:06:09,886 DEBUG [OnlineRepositoryDAOImpl] Reading an OnlineRepository (id = 3)
2022-11-12T06:06:09,888 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 1000000030001860, format HLS and profile HTML5
2022-11-12T06:06:09,889 DEBUG [AbstractAVTranscodingDeliveryEngine] Getting media info for transcoded version of file http://gamer:8081
2022-11-12T06:06:09,889 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,889 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,889 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:09,890 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 1000000030001860 (online)
2022-11-12T06:06:09,890 DEBUG [OnlineRepositoryDAOImpl] Reading an OnlineRepository (id = 3)
2022-11-12T06:06:09,890 DEBUG [VideoDeliveryEngine] Delivering item '1000000030001860' for client 'Identifier=10.3.2.36, Profile=HTML5, Name=MediaBrowser'
2022-11-12T06:06:09,894 DEBUG [AbstractAVTranscodingDeliveryEngine] No suitable transcoding job exists yet, start one for client 'Identifier=10.3.2.36, Profile=HTML5, Name=MediaBrowser'
2022-11-12T06:06:09,896 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: http://gamer:8081
2022-11-12T06:06:09,897 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\\..\lib\ffmpeg.exe -fflags +genpts -threads 0 -analyzeduration 10000000 -i http://gamer:8081 -y -c:v copy -bsf:v h264_mp4toannexb -an -map 0:0 -sn -f hls -hls_time 10 -hls_allow_cache 0 -hls_segment_filename E:\temp\Serviio\transcoding-temp-eb2253f081e068f1f7776a077c12bc7e.stf\segment%05d.ts -hls_list_size 10 -hls_flags delete_segments E:\temp\Serviio\transcoding-temp-eb2253f081e068f1f7776a077c12bc7e.stf\playlist.m3u8
2022-11-12T06:06:10,511 DEBUG [SearchManager] Committing search index
2022-11-12T06:06:13,287 DEBUG [MediaItemDAOImpl] Getting counts of media items by type
2022-11-12T06:06:17,666 DEBUG [RendererSearchSender] Searching for Renderer devices
2022-11-12T06:06:17,666 DEBUG [RendererSearchSender$RendererSearchWorker] Multicasting SSDP M-SEARCH using interface eth2 (Intel(R) Ethernet Connection (12) I219-V) and address 10.3.2.36, timeout = 0
2022-11-12T06:06:17,666 DEBUG [RendererSearchSender$RendererSearchWorker] Sending 1 'm-search' messages
2022-11-12T06:06:17,667 DEBUG [DiscoverySSDPMessageListener] Received a valid M-SEARCH message for search target urn:schemas-upnp-org:device:MediaRenderer:1 from address /10.3.2.36:50676s
2022-11-12T06:06:17,667 DEBUG [DiscoverySSDPMessageListener] Received a valid M-SEARCH message for search target urn:schemas-upnp-org:device:MediaRenderer:1 from address /10.3.2.36:50676s
2022-11-12T06:06:17,667 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 10.3.2.36
2022-11-12T06:06:17,667 DEBUG [DiscoverySSDPMessageListener] Received a valid M-SEARCH message for search target urn:schemas-upnp-org:device:MediaRenderer:1 from address /10.3.2.36:50676s
2022-11-12T06:06:17,667 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 10.3.2.36
2022-11-12T06:06:17,667 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 10.3.2.36
2022-11-12T06:06:17,667 DEBUG [UserDAOImpl] Reading a User (id = 1)
2022-11-12T06:06:17,667 DEBUG [UserDAOImpl] Reading a User (id = 1)
2022-11-12T06:06:17,667 DEBUG [UserDAOImpl] Reading a User (id = 1)
2022-11-12T06:06:20,906 DEBUG [FileBasedTranscodingDeliveryStrategy] Sending transcoding stream
2022-11-12T06:06:20,911 DEBUG [LiveManifestTranscodeInputStream] Creating new TimeoutStreamDelegator for file E:\temp\Serviio\transcoding-temp-eb2253f081e068f1f7776a077c12bc7e.stf\playlist.m3u8
2022-11-12T06:06:20,913 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:20,913 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:20,913 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file "http://gamer:8081": HLS
2022-11-12T06:06:20,913 DEBUG [VideoDeliveryEngine] Delivering file 'http://gamer:8081' using transcoding (profile: html5 > quality: ORIGINAL > OnlineTranscoding > [APPLE_HTTP/H264/AAC] > matcher: 1)
2022-11-12T06:06:20,915 DEBUG [GETMethodProcessor] Entity will be consumed till the end
2022-11-12T06:06:20,916 DEBUG [GETMethodProcessor] Stream entity has length: -1
2022-11-12T06:06:20,918 DEBUG [TimeoutStreamDelegator] Scheduling stream stop to happen in 20 seconds if there is no traffic
2022-11-12T06:06:20,920 INFO [PlaybackEventsManager] Playback of media item 1000000030001860 (http://gamer:8081 [http://gamer:8081]) has started at 0% on Identifier=10.3.2.36, Profile=HTML5, Name=MediaBrowser
2022-11-12T06:06:20,927 DEBUG [CDSRetrieveMediaServerResource] GET http://gamer:23424/cds/resource/1000000 ... 0c732a284d HTTP/1.1, headers = [host: gamer:23424,connection: keep-alive,user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36,accept: */*,referer: http://gamer:23424/mediabrowser/,accept-encoding: gzip, deflate,accept-language: en,sv;q=0.9,en-US;q=0.8,nl;q=0.7,de;q=0.6,ca;q=0.5,es-ES;q=0.4,es;q=0.3,pl;q=0.2]
2022-11-12T06:06:20,927 DEBUG [CDSRetrieveMediaServerResource] Creating client with id '10.3.2.36' and name 'MediaBrowser'
2022-11-12T06:06:20,927 DEBUG [ResourceDeliveryProcessor] Resource request accepted. Using client 'Identifier=10.3.2.36, Profile=HTML5, Name=MediaBrowser'
2022-11-12T06:06:20,927 DEBUG [ResourceDeliveryProcessor] Request for resource 1000000030001860 and type 'SEGMENT' received
2022-11-12T06:06:20,928 DEBUG [SegmentRetrievalStrategy] Retrieving info of Segment for media item with id 1000000030001860: 1000000030001860/SEGMENT/transcoding-temp-eb2253f081e068f1f7776a077c12bc7e.stf/segment00000.ts
2022-11-12T06:06:20,928 DEBUG [SegmentRetrievalStrategy] Retrieving Segment for media item with id 1000000030001860: 1000000030001860/SEGMENT/transcoding-temp-eb2253f081e068f1f7776a077c12bc7e.stf/segment00000.ts
2022-11-12T06:06:20,928 DEBUG [GETMethodProcessor] Stream entity has length: 4079788
2022-11-12T06:06:21,028 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 1000000030001860 (online)
2022-11-12T06:06:21,028 DEBUG [OnlineRepositoryDAOImpl] Reading an OnlineRepository (id = 3)
2022-11-12T06:06:21,028 DEBUG [CDSPlaybackProgressServerResource] Updating progress of objectId V_OF^FOL*$OI1000000030001860 to 0.0 seconds with state PLAYING
2022-11-12T06:06:21,028 DEBUG [UserDAOImpl] Looking for a User (name = Brad)
2022-11-12T06:06:21,028 DEBUG [CDSPlaybackProgressServerResource] Creating client with id '10.3.2.36' and name 'MediaBrowser'
2022-11-12T06:06:23,668 DEBUG [RendererSearchSender] Finished searching for Renderer devices
<<

bkeith4web

Streaming enthusiast

Posts: 32

Joined: Sat Feb 02, 2013 11:48 pm

Post Sat Nov 12, 2022 2:56 pm

Re: Bug?: "-an" ffmpeg parameter strips audio from online

I took an ffmpeg line that worked to transcode the local version of the file (Streamlink with a local file output instead of an http stream) and I just replaced the source file with http://gamer:8081 so here was the ffmpeg string:

ffmpeg.exe -fflags +genpts -threads 0 -i http://gamer:8081 -y -c:v copy -c:a:0 copy -map 0:0 -map 0:1 -sn -f hls -hls_time 10 -hls_allow_cache 0 -hls_segment_filename E:\temp\Serviio\transcoding-temp-bc071a561533ad90df2fd3f19c1a13b2.stf\segment%05d.ts -hls_list_size 0 E:\temp\Serviio\transcoding-temp-bc071a561533ad90df2fd3f19c1a13b2.stf\playlist.m3u8

This seems to work. It creates a playlist, it creates transcoded files that DO contain audio with these stream:
Video: MPEG4 Video (H264) 1280x720 29.971fps [V: h264 main L3.1, yuv420p, 1280x720]
Audio: AAC 44100Hz stereo 261kbps [A: aac lc, 44100 Hz, stereo, 261 kb/s]

So clearly ffmpeg CAN create files with audio from the stream given the correct parameters. I can't actually play this ffmpeg in mediabrowser because when I click on 'play' it submits it's own ffmpeg job and now I've got two of them chugging away trying to use the same transcode directory, playlist etc. But the .ts files in that directory from my manual ffmpeg invocation all have audio streams.

i noticed in the detailed log that I posted, the first ffmpeg invocation with "-analyzeduration" also had the -an parameter. For what it's worth, the -sn parameter to strip subtitles is in there too which I don't currently need but just FYI.

If you want to test this locally with the latest version of streamlink, this command line will create the same stream I'm using (a recent hockey game):
streamlink --player-external-http --player-external-http-port 8081 https://ok.ru/video/4605031811758 --default-stream best

Streamlink is here https://github.com/streamlink/streamlin ... /tag/5.0.1 and all the plugins are self-contained including the one for ok.ru so there is no need for any post-install configuration.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Nov 12, 2022 8:54 pm

Re: Bug?: "-an" ffmpeg parameter strips audio from online

hmm, tried with this setup and works for me

  Code:
ffmpeg.exe -fflags +genpts -threads 0 -analyzeduration 10000000 -i http://192.168.0.4:8081/ -y -c:v copy -c:a:0 copy -map 0:0 -map 0:1 -sn -f hls -hls_time 10 -hls_allow_cache 0 -hls_segment_filename c:\temp\Serviio\transcoding-temp-21e9418f49a0d6f092d83a890b619872.stf\segment%05d.ts -hls_list_size 10 -hls_flags delete_segments c:\temp\Serviio\transcoding-temp-21e9418f49a0d6f092d83a890b619872.stf\playlist.m3u8


Basically the -an is added when there are no audio tracks found. Have you made any changes to your profiles?
<<

bkeith4web

Streaming enthusiast

Posts: 32

Joined: Sat Feb 02, 2013 11:48 pm

Post Sun Nov 13, 2022 1:01 pm

Re: Bug?: "-an" ffmpeg parameter strips audio from online

Thanks for testing it out.

I do have a customized user-profiles.xml but profiles.xml and application-profiles.xml are standard.
I upgraded to the latest Serviio yesterday just in case that had anything to do with it but got the same results.
Were you able to test with the same URL that I posted?

I see where you get the second "map" parameter to handle the audio stream.

I know a lot of times when the PC lacks an audio or video codec that's a problem but in this case I can play the stream from the original web page and the http stream through vlc with audio so it shouldn't be that. I did an ffmpeg codec check and it showed a couple flavors of aac and ac3.

I'll try completely uninstalling & reinstalling Serviio and testing it without even touching user-profiles.xml. I'm on windows 11 home build 22621 although I woudn't think that would have anything to do with this particular problem. Seems like it's a problem specific to my system though.

It worked after reinstalling although I have a feeling that the problem was a lot simpler than that. After the reinstall I noticed the "include all available audio tracks" checkbox on the Transcoding page and I now have no idea whether I had that checked previously. I'll bet I did not have it checked. When I uncheck it now, I still get audio in mediabrowser although it may have just picked up the prior transcoding job so I haven't really done extensive testing. At any rate the audio works for me now and I learned some more while tinkering.

Thanks again for your help Petr!
Brad

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 24 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.