FAQ  •  Register  •  Login

Audio stream is missing when transcoding .mp4 file

<<

flavius

Serviio newbie

Posts: 5

Joined: Fri Jan 09, 2015 9:42 pm

Post Fri Jan 06, 2023 6:05 pm

Audio stream is missing when transcoding .mp4 file

Usually .mp4 transcoding works fine for me, but there are some videos that lose their audio stream when being transcoded.
I couldn't figure out why this happens - please help!

ffmpeg info on input file:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'M:\Videos\Quellmaterial\2015\07\14 P und Philipp Sandlers spielen zur Zeugnis├╝bergabe der 6. Klassen\P1010059.MP4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42avc1
creation_time : 2015-07-14T18:08:54.000000Z
Duration: 00:01:32.64, start: 0.000000, bitrate: 95970 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 95821 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
Metadata:
creation_time : 2015-07-14T18:08:54.000000Z
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2015-07-14T18:08:54.000000Z

ffmpeg info on output file:
Input #0, mpegts, from 'C:\Windows\Temp\Serviio\transcoding-temp-d10e2244bca2653f372d0313b5187692.stf':
Duration: 00:01:32.64, start: 1.440000, bitrate: 32360 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc

According to the log file (attached) the aac audio stream should have been transcoded to ac3:
2023-01-06T18:22:07,294 DEBUG [VideoDeliveryEngine] Delivering file 'P1010059.MP4' using transcoding (profile: 7 > quality: ORIGINAL > Transcoding > [MPEG2TS/MPEG2/AC3] > matcher: 2)

But the ffmpeg command doesn't contain any audio transcoding (if I'm interpreting the command correctly). The effective ffmpeg command was
F:/Programme/Streaming/Serviio/lib/ffmpeg_original.exe "-threads" "0" "-i" "M:\Videos\Quellmaterial\2015\07\14 P und Philipp Sandlers spielen zur Zeugnisübergabe der 6. Klassen\P1010059.MP4" "-y" "-threads" "0" "-c:v" "mpeg2video" "-pix_fmt" "yuv420p" "-b:v" "30000k" "-maxrate:v" "30000k" "-bufsize:v" "30000k" "-filter_complex" "[0:v]scale=1920:1080[v]" "-r" "25" "-g" "15" "-map" "[v]" "-sn" "-f" "mpegts" "C:\Windows\TEMP\Serviio\transcoding-temp-d10e2244bca2653f372d0313b5187692.stf"

Please note that I have installed a wrapper exe in front of ffmpeg.exe that has removed the "-an" argument from the ffmpeg command that can be found in the attached serviio.log file.

Find profiles.xml and serviio.log attached.
Attachments
profiles.xml
(189.07 KiB) Downloaded 210 times
serviio.log missing audio transcoding to ac3.log
(387.33 KiB) Downloaded 212 times
<<

atc98092

User avatar

DLNA master

Posts: 5205

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sat Jan 07, 2023 12:13 am

Re: Audio stream is missing when transcoding .mp4 file

I'm not certain why you are transcoding that file. Usually, an MP4 container with H264 video and AAC audio can be played by virtually any device. What profile are you using, and what is your player?
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

flavius

Serviio newbie

Posts: 5

Joined: Fri Jan 09, 2015 9:42 pm

Post Sat Jan 07, 2023 12:18 pm

Re: Audio stream is missing when transcoding .mp4 file

Profile=Samsung TV / player (C/D-series), Name=UE55D8000

This TV isn't able to play aac audio and needs a transcoding, e.g. to ac3.

The log file shows matcher 2:
2023-01-06T18:22:07,294 DEBUG [VideoDeliveryEngine] Delivering file 'P1010059.MP4' using transcoding (profile: 7 > quality: ORIGINAL > Transcoding > [MPEG2TS/MPEG2/AC3] > matcher: 2)

The related transcoding section of profiles.xml is:
<Video targetContainer="mpegts" targetVCodec="mpeg2video" maxVBitrate="30000" maxHeight="1080" DAR="16:9" targetACodec="ac3" >
<Matches container="*" vCodec="h264" profile="high_10" />
<Matches container="*" vCodec="h264" profile="high" />
<Matches container="*" vCodec="h264" profile="main" levelGreaterThan="4.1" />
<Matches container="mpegts" vCodec="h264" profile="high" />
</Video>

I expected that 'targetACodec="ac3"' would take effect, but the ffmpeg command doesn't contain any audio transcoding.
Any idea what I could change in profiles.xml to force transcoding to ac3?
<<

atc98092

User avatar

DLNA master

Posts: 5205

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sun Jan 08, 2023 3:20 am

Re: Audio stream is missing when transcoding .mp4 file

I'm surprised the TV can't play AAC audio. As for a workaround, you might try some different profiles, such as a Roku TV or even the LG TV profile. I'd have to look more closely at the different profiles to see what might capture AAC. I believe the DirecTV profile transcodes almost everything, so that would at least show if you can get an acceptable audio transcoding, and then work from there.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 20 guests

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