MKV embedded with FLAC 2.0 does not transcode sound properly

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

MKV embedded with FLAC 2.0 does not transcode sound properly

Postby ronin.kenji » Thu Jul 09, 2009 1:22 pm

What steps will reproduce the problem?
1. Playback a MKV file with stereo FLAC audio track

What is the expected output? What do you see instead?
Expecting sound output. Hearing nothing.

What version of the product are you using? On what operating system?
svn - 374
OS: Slackware 12.2 Linux
MPlayer -mt (MEncoder SVN-r29333-4.2.4)

For the files in question the following trancoding seems to be done:
mencoder(video) + Mencoder(audio) => tsmuxer

Code: Select all
# mediainfo /srv/mediafiles/Video/Anime/Spice\ and\ Wolf/spice_and_wolf_01\[1280x720.h264.flac\]\[niizk\].mkv
General
Complete name                    : /srv/mediafiles/Video/Anime/Spice and Wolf/spice_and_wolf_01[1280x720.h264.flac][niizk].mkv
Format                           : Matroska
File size                        : 504 MiB
Duration                         : 23mn 45s
Overall bit rate                 : 2 965 Kbps
Encoded date                     : UTC 2009-04-28 23:52:12
Writing application              : mkvmerge v2.6.0 ('Kelly watch the
Stars') built on Mar 24 2009 15:23:17
Writing library                  : libebml v0.7.7 + libmatroska v0.8.1
Cover                            : Yes / Yes

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : High@L5.0
Format settings, CABAC           : Yes
Format settings, ReFrames        : 16 frames
Muxing mode                      : Container profile=Unknown@5.0
Codec ID                         : V_MPEG4/ISO/AVC
Duration                         : 23mn 43s
Nominal bit rate                 : 2 330 Kbps
Width                            : 1 280 pixels
Height                           : 720 pixels
Display aspect ratio             : 16/9
Frame rate                       : 23.976 fps
Resolution                       : 24 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.105
Title                            : Episode01: The Wolf and One's Best Clothes
Writing library                  : x264 core 67 r1129 c109c8e
Encoding settings                : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=esa / subme=9 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=6,6 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=0 / mbaff=0 / bframes=5 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=2330 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

Audio
ID                               : 2
Format                           : FLAC
Format/Info                      : Free Lossless Audio Codec
Codec ID                         : A_FLAC
Duration                         : 23mn 45s
Bit rate mode                    : Variable
Channel(s)                       : 2 channels
Sampling rate                    : 48.0 KHz
Resolution                       : 16 bits
Title                            : 2.0 FLAC
Writing library                  : libFLAC 1.2.0 (UTC 2007-07-15)
Language                         : Japanese

Text #1
ID                               : 3
Format                           : ASS
Codec ID                         : S_TEXT/ASS
Codec ID/Info                    : Advanced Sub Station Alpha
Title                            : ASS
Language                         : English

Text #2
ID                               : 4
Format                           : UTF-8
Codec ID                         : S_TEXT/UTF8
Codec ID/Info                    : UTF-8 Plain Text
Title                            : SRT
Language                         : English

Menu
00:00:00.000                     : en:Chapter 1
00:01:30.007                     : en:Chapter 2
00:22:09.997                     : en:Chapter 3
00:23:40.003                     : en:Chapter 4


I think there's an issue with the channel mapping. The debug.log.1 indicates the audio mencoder aborting with error 1

running the mencoder command from a terminal indicates (-quiet removed):
Code: Select all
# mencoder -ss 0 "/srv/mediafiles/Video/Anime/Spice and Wolf/spice_and_wolf_01[1280x720.h264.flac][niizk].mkv" -msglevel statusline=-1:mencoder=-1 -channels 6 -ovc copy -of rawaudio -mc 0 -noskip
-oac pcm -af channels=6:6:0:0:1:1:3:2:5:3:4:4:2:5 -srate 48000 -o
/srv/mediafiles/Test.pcm
MEncoder SVN-r29333-4.2.4 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x1f7a6285
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "Episode01: The Wolf and One's
Best Clothes", -vid 0
[mkv] Track ID 2: audio (A_FLAC) "2.0 FLAC", -aid 0, -alang jpn
[mkv] Track ID 3: subtitles (S_TEXT/ASS) "ASS", -sid 0, -slang eng
[mkv] Track ID 4: subtitles (S_TEXT/UTF8) "SRT", -sid 1, -slang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  1280x720  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->192000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
Ignoring video stream!
[channels] Invalid routing in pair nr. 2.
[libaf] Reinitialization did not work, audio filter 'channels' returned
error code -2
Error at audio filter chain pre-init!


Anybody know how we can make the resulting AC3 audio stream just use DD 2.0 versus DD 5.1 if there are only 2 channels in the video file?
Attachments
debug.zip
(193.64 KiB) Downloaded 43 times
ronin.kenji
 
Posts: 20
Joined: Thu Jul 09, 2009 12:57 am

Re: MKV embedded with FLAC 2.0 does not transcode sound properly

Postby shagrath » Thu Jul 09, 2009 6:06 pm

yep, there's a wrong detection in channels number, thanks for the bug report :p
shagrath
Project Lead
 
Posts: 2667
Joined: Wed Jan 14, 2009 1:39 pm

Re: MKV embedded with FLAC 2.0 does not transcode sound properly

Postby ronin.kenji » Sun Jul 12, 2009 10:14 am

Hey, I think the problem is fixed in r348. At least the audio is detected and parsed properly. Although it seems that advanced rules have no effect on the audio in this particular form of transcoding. ie setting:
Code: Select all
container == matroska && acodec == flac :: -channels 6
is never used by the audio trascoding thread.

Also a new problem is noted in r348. AC3 audio seems to be limited to 256kbps (default and when 640 is set as the bitrate). I'll double check these settings later on though.

Edit: I double checked the code. it seems stereo & mono AC3 is rate limited to 384, but it if is over, it caps to 256 (192 for mono). <- shouldn't this be 384? (cf net/pms/util/CodecUtil.java:44) I suppose higher bitrates are a waste for stereo and mono but shouldn't we mention this somewhere? like in the GUI?
PMS: r372
MEncoder: SVN-r30392-4.2.4
FFmpeg: git-73608e1
OS: Slackware 12.2
Shuttle K45: E7400@2.8, 4Gb (3.3 visible), 1Tb WD Green Caviar (shifting to 1.5TB soon)
ronin.kenji
 
Posts: 20
Joined: Thu Jul 09, 2009 12:57 am


Return to Linux/Unix Support

Who is online

Users browsing this forum: No registered users and 5 guests