Keith C. Perry on 4 Nov 2015 01:11:42 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Sound and MKV files


What happened was that handbrake did not reencode the AC3 audio to AAC.  Technically speaking, since MP4 (and MKV) are container formats, AC3 and AAC a both legally acceptable.  However, Chromecasts are not great devices for video support because not only are they picky about codecs, they are picky about container formats and what is in them.  I was hoping Google would put some into fixing this so that there would be better support but atter the software upgrade this year, the poor support remains.

So...  although you can use handbrake (I have occasionally), I prefer to use ffmpeg for video work since I can more easily control exactly what I want.  Here is the conversion line I use to transcode to MP4.

ffmpeg -y -i test.mkv -ar 48000 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset veryfast -f mp4 -crf 17 -threads 0 test.mp4

(note: I'm not specifying AAC here because that is the default audio type for mp4... you'll see it identified as mp4a)

This is not the tightest encoding you can do- you can use a different preset (or profile).  The "veryfast" gives very good quality without taking too long to run.  Slower presets will take longer (i.e. processing at a slower fps) but the file sizes will be relatively smaller.

I use a similar line to transcode the videos that get uploaded, with the addition of

MP4Box -inter 500 test.mp4

which interleaves every 500ms.  This is typically needed for HTTP streaming (e.g. video servers like jwplayer) so that you can skip back and forth and do progressive downloads but it may not be needed by the Chromecast.  Definitely doesn't hurt.


~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Keith C. Perry, MS E.E.
Owner, DAO Technologies LLC
(O) +1.215.525.4165 x2033
(M) +1.215.432.5167
www.daotechnologies.com


From: "Eric H. Johnson" <ejohnson@camalytics.com>
To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
Sent: Tuesday, November 3, 2015 10:20:12 PM
Subject: Re: [PLUG] Sound and MKV files

Soren,

I was not sure it was even a CODEC or driver problem, here the output from
mediainfo:

General
Complete name                            : DAS6E2.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 1 007 MiB
Duration                                 : 47mn 11s
Overall bit rate                         : 2 984 Kbps
Writing application                      : x264.exe
Writing library                          : mkv2rls x264-tv version built on
2015. febr. 22

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 47mn 11s
Bit rate                                 : 2 540 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.110
Stream size                              : 857 MiB (85%)
Writing library                          : x264 core 148 r2597 e86f3a1
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 /
analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 /
mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 /
deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 /
lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 /
bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2
/ b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 /
keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf /
mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 /
ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 47mn 11s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 130 MiB (13%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Regards,
Eric


On Tue, Nov 3, 2015 at 9:47 PM, Eric H. Johnson <ejohnson@camalytics.com>
wrote:
What the heck am I missing?

It's really hard to know without being sure what all the characteristics of
the audio bitstream are; the problem could be anything from the sampling
rate to the channel ordering.  Can you run mediainfo on the file and send
over the output?

--
Soren Harward
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug