Stream­ing video to a Sony Bravia (via DLNA)

I have a Sony Bravia TV with a net­work (eth­er­net) con­nec­tion. Let­ting aside the fact that he is in anoth­er sub­net than my NAS and as such I can not use a DLNA (UPnP-AV) serv­er (it is using mul­ti­cast and the Sim­ple Ser­vice Dis­cov­ery Pro­to­col (SSDP) which is not tra­vers­ing sub­nets in the WLAN-LAN-ADSL-router I use), there is no good expla­na­tion from Sony what I can feed to the TV.

When search­ing the net I can find some obscure sug­ges­tions and descrip­tions, but not all of them work for all peo­ple which try them. So it seems I have to research this myself. Luck­i­ly my router has a build-in UPnP-AV serv­er which I can use to play around (the file size is lim­it­ed to the size of the USB mem­o­ry stick I have con­nect­ed to the router, as he can not stream con­tent which is avail­able in a NAS in the net­work).

Sony tells the TV is able to receive MPEG2 TS and PS con­tain­ers. MPEG2 PS is more or less what you have on DVD. It is able to play SD and HD con­tent from the PS con­tain­er, and the video for­mat needs to be MPEG2. They do not explain what SD or HD means in this con­text (the valid res­o­lu­tions), and they do not tell what kind of audio is allowed.

For the MPEG2 TS con­tain­er they addi­tion­al­ly allow H.264 video, and they spec­i­fy EU, EU‑T and EU-ISO as sup­port­ed in this case. Again, they do not explain what those EU* parts are sup­posed to mean.

For the unspec­i­fied audio I assume this means AC‑3, AAC and MPEG Audio Lay­er 2 (some peo­ple use MP2 to describe this audio for­mat). I suc­cess­ful­ly test­ed AAC and AC‑3, and I have read that MP2 works too. Based upon my expe­ri­ences with the video part (more below) I assume the sam­pling rate and bitwidth mat­ter. So far I tried with 48 kHz and 16 bit per chan­nel.

For the EU* parts I have not found any trust­wor­thy ref­er­ence what this could mean, but it looks this refers to some aspects of DVB/DVB‑T/DVB‑S(2) as it is used in Europe. I guess this is a bit linked with valid res­o­lu­tions the TV is able to han­dle.

For the video part I have found mixed reports. From hat I have read in the Wikipedia page of the H.264 video for­mat, I assumed the fail­ures are relat­ed to a wrong res­o­lu­tion and maybe the fact that some parts of the video do not con­form to spe­cif­ic “lev­els” of the H.264 for­mat. Some tell you are not allowed to use more than X ref­er­ence frames, some tell you can not use advanced fea­ture Y.

The first test I did was to take the Sin­tel video from Blender. I down­loaded the MP4 ver­sion and remuxed it into a MPEG2-TS con­tain­er (I used tsMux­eR to do this). The TV was able to play the AAC audio, but it did not show the video. When I look at the video prop­er­ties, I see that it has a res­o­lu­tion of 1280×544 at 24 FPS. For H.264 videos which use the “High” pro­file and are com­pat­i­ble up to lev­el 4.1, I do not see this res­o­lu­tion list­ed as valid in the Wikipedia page. Valid res­o­lu­tions are 1280×720 at 30, 60 and 68.3 FPS, and 1280×1024 at 42.2 FPS. This could explain why it is not work­ing.

As a sec­ond test I took a video resized it to 624×256 (I did not pay much atten­tion to the scale in the pro­gram I used to test this, I just hoped it takes a good one, now that I try to sum­ma­rize what I inves­ti­gat­ed so far, I see that this size is not one of the valid sizes list­ed in the lev­els for H.264) at 23.976 FPS and reen­cod­ed it with the default options of the x264 encoder. The result­ing video played just fine on the TV.

My third test was to encode a resized (from 640×272 to 640×480) video at 23.976 FPS with weight­ed, upto 4 adap­tive B‑frames, mixed ref­er­ences, 4 ref­er­ence frames, and some oth­er options (this includes B‑pyramid, which seems to be enabled by default). And again, the result­ing video played just fine (despite the fact that I found com­ments in the net which sug­gest that B‑pyramid needs to be dis­abled…).

I still have to test some HD sizes, but it looks like one key aspect for com­pat­i­bil­i­ty is that the video is encod­ed with the right res­o­lu­tion (I have to admit, I do not real­ly know what this means, as one video had a res­o­lu­tion which was dif­fer­ent from what the valid sizes for the H.264 lev­els are) and com­plies to only lev­el 4.1 (or 4) and below (basi­cal­ly this means to obey some bitrate lim­i­ta­tions and the num­ber of max. ref­er­ence frames for the giv­en res­o­lu­tion). The 23.976 FPS I men­tioned above are not list­ed as one of the valid FPS in the lev­els for H.264, so I do not think the FPS have to strict­ly con­form to what is spec­i­fied for the lev­els. It looks more this is just an upper lim­it so that the video could also use some low­er FPS.

So far I took the sin­tel video and added some black bor­ders on top and below to get to the 1080×720 res­o­lu­tion. I used avide­mux 2.5.4 for this. The ver­sion I tried can only pro­duce a MP4 con­tain­er with this video/audio com­bi­na­tion, and my hope was to remux it with tsMux­eR to a MPEG2-TS, but tsMux­eR does not find a valid video or audio stream inside the MP4 con­tain­er. I am still search­ing for a pro­gram which is able to remux the result­ing MP4 into a MPEG2-TS. I found a tool which extracts the streams from the MP4 con­tain­er, but the only free MPEG2-TS mux­er seems to be tsMux­eR, which I was not able to con­vince to mux the two streams into a MPEG2-TS file. It seems I have either to wait until avide­mux knows how to gen­er­ate MPEG2-TS streams with H.264 and AAC, or until it gen­er­ates a MP4 con­tain­er with H.264 and AAC which tsMux­eR is able to han­dle.

What I also want to test is, if I can use the open-gop options (either in “nor­mal” or in “blu­ray” mode), but I did not took the time to test this.

The only think I can tell defin­i­tive­ly ATM is, that despite to all the infor­ma­tion I found in the net about this, noth­ing can be told about the hard require­ments except, that the video encod­ing can not exceed lev­el 4.1 (or 4), because so far no hard­ware decoder chip seems to sup­port a high­er lev­el. It seems I can use more or less all options avail­able for the H.264 encod­ing, and the res­o­lu­tion and FPS does not seem to mat­ter that much. I looks more that you have to find a ver­sion of an H.264 encoder which works for you, and after that you can more or less do what you want.

Send to Kin­dle

Intel­li­gent elec­tric­i­ty meters? More ben­e­fi­cial things exist (but need improve­ment).

In Ger­many you need to install an intel­li­gent elec­tric­i­ty meter if you make larg­er changes to the elec­tric­i­ty instal­la­tion in your house (or if you build a new one). At first this sounds inter­est­ing. If you look clos­er, you need to decide if you want to laugh or to cry.

Such an intel­li­gent elec­tric­i­ty meter is able to dis­play the cur­rent pow­er con­sump­tion in a dig­i­tal dis­play (if the pow­er con­sump­tion stays the same, you can test with this how much pow­er a spe­cif­ic device needs). It is also able to attribute the pow­er con­sump­tion to dif­fer­ent times of the day. An option­al fea­ture (here in Ger­many) is the pos­si­bil­i­ty to trans­fer cap­tured data to the pow­er com­pa­ny. It is not required that the home-owner is able to see all or even any data from an intel­li­gent elec­tric­i­ty meter.

The promis­es are, that with such a device peo­ple could pay less mon­ey by using the wash­ing machine or the dish wash­er or sim­i­lar devices dur­ing times when not much peo­ple want to use ener­gy.

So far so good, but…

  • My wash­ing machine or dish wash­er are about 1 – 3 years old. We did not buy the cheap­est ones, but they do not offer to start the wash­ing upon input from an exter­nal sig­nal or just by acti­vat­ing the pow­er (if they lose pow­er, the cho­sen wash­ing pro­gram is reset to the default pro­gram). Am I sup­posed to buy a new one?
  • The pow­er con­sump­tion of all the nec­es­sary infra­struc­ture (dig­i­tal stuff in the elec­tric­i­ty meter, net­work con­nec­tion to the pow­er com­pa­ny) is not zero, and it is the own­er who has to pay for this.
  • When every­one is wash­ing when not much peo­ple want to use ener­gy, a lot of peo­ple want to use ener­gy in such moments. It may still help a bit the pow­er com­pa­nies because they do not have to gen­er­ate pow­er (and have expens­es because of this) which is not used, but I doubt the con­sumer will get a big reduc­tion then.
  • The dura­tion of such power-surplus times with a reduced price may not last dur­ing the com­plete time a wash­ing machine needs. It may be even the case that a high-price time slot may get acti­vat­ed short­ly after (if this is done by (mali­cious) intent or not is not even rel­e­vant, as the con­sumer can not do some­thing about it as he is prob­a­bly sleep­ing when this hap­pens in the night).
  • The pow­er com­pa­ny may be able to get a detailed trace of what hap­pens in a house (the own­ers are get­ting up at 11am, only take a show­er every two weeks, have prob­a­bly a big plas­ma TV which runs all the day, …).
  • I doubt the device is free of secu­ri­ty holes or pro­tect­ed enough against eaves­drop­ping (with all the pro­fil­ing impli­ca­tions, or pos­si­bil­i­ties to manip­u­late the data (pos­i­tive­ly or neg­a­tive­ly) direct­ly in the device before trans­mis­sion to the pow­er com­pa­ny).
  • I do not think the most intel­li­gent and consumer-friendly devices will come with enough sta­tis­tics or access-possibilities to real­ly sat­is­fy the con­sumers.

More inter­est­ing would oth­er things which could help cut costs. For exam­ple small low-power net­worked sen­sors which detect if a window/door is open, the tem­per­a­ture in a room, the out­side tem­per­a­ture, the sun­light inten­si­ty and so on. Togeth­er with some actu­a­tors like for exam­ple to close the win­dow, close the shut­ter, change the heat­ing, turn off lamps and so on, it would pro­vide much more imme­di­ate ben­e­fit. In a new build­ing, the net­work could be wired, but in an old build­ing the sen­sors need to be wire­less and battery-powered.

A pos­si­ble solu­tion could be done via blue­tooth v3 in a mesh net­work (yes, if it is not open source, I would also be scep­ti­cal if the com­pa­ny which pro­duces this has enough knowl­edge to make it secure), polled by a cen­tral sta­tion which could put the sen­sors in silent stand­by to reduce the amount of radio pol­lu­tion and increase bat­tery life­time. If some of the sen­sors and actu­a­tors are con­nect­ed (e.g. room tem­per­a­ture and heat­ing actu­a­tor plus a clock), you could even let it run in autonomous mode (time based heat­ing to a spe­cif­ic tem­per­a­ture) and only need to con­nect to it if there is a spe­cif­ic need. Such a sit­u­a­tion could be that the win­dow sen­sor detects an open win­dow, so the heat­ing can be turned off. Or maybe the sun­light inten­si­ty sen­sor detects (or the base sta­tion esti­mates) an intensity-rise of the sun­light, so the heat­ing could be reduced in advance.

Some­thing like this would give imme­di­ate ben­e­fit (in com­fort) to those who install it, and in a long-term view it would/could cut the costs down a bit.

I am aware of some wire­less sensors/actuators, but they are rel­a­tive­ly expen­sive, the radio pol­lu­tion (and type) is unknown to me, and the pro­to­col is not open, so I do not know if it is secure and how to improve things I do not like.

Any­one with enough hard­ware knowl­edge and open source/hardware spir­it out there to pro­duce a mod­u­lar base for sensors/actuators (blue­tooth + I/O for sensros/actuators/pc-connection + con­trol­er)?

Send to Kin­dle

IPv6 in my LAN

After enabling IPv6 in my WLAN router, I also enabled IPv6 in my FreeB­SD sys­tems. I have to tell that the IPv6 chap­ter in the FreeB­SD hand­book does not con­tain as much infor­ma­tion as I would like to have about this.

Con­fig­ur­ing the inter­faces of my two 9‑current sys­tems to also car­ry a spe­cif­ic IPv6 address (an easy one from the ULA I use) was easy after read­ing the man-page for rc.conf. After a lit­tle bit of exper­i­ment­ing it came down to:

ifconfig_rl0_ipv6=“inet6 ::2:1 pre­fixlen 64 accept_rtadv”
ipv6_defaultrouter=”<router address>”

Apart from this address (I chose it because the IPv4 address ends in “.2”, this way I can add some easy to remem­ber address­es for this machine if need­ed), I also have two auto­mat­i­cal­ly con­fig­ured address­es. One is with the same ULA and some not so easy to remem­ber end (con­struct­ed from the MAC address), and one is from the offi­cial pre­fix the router con­struct­ed out of the offi­cial IPv4 address from the ISP (+ the same end than the oth­er end).

Addi­tion­al­ly I also have all my jails on this machine with an IPv6 address now (yes, they are like “…:2:100” with the :100 because the IPv4 address ends in “.100”). Still TODO is the con­ver­sion of all the ser­vices in the jails to also lis­ten on the IPv6 address.

I already changed the con­fig of my inter­nal DNS to have the IPv6 address­es for all sys­tems, lis­ten on the IPv6 address (when I add an IPv6 net­work to allow-query/allow-query-cache/allow-recursion bind does not want to start). And as I was there, I also enabled the DNSSEC ver­i­fi­ca­tion (but I get a lot of error mes­sages in the logs: “unable to con­vert errno to isc_result: 42: Pro­to­col not avail­able”, one search result which talks exact­ly about this error tells it is a “cos­met­ic error”…).

I noticed that an IPv6 ping between two phys­i­cal machines takes a lit­tle bit more time than an IPv4 ping (no IPsec enabled). It sur­prised me that this is such a notice­able dif­fer­ence (not with­in the std-dev at all):

— ping sta­tis­tics —
10 pack­ets trans­mit­ted, 10 pack­ets received, 0.0% pack­et loss
round-trip min/avg/max/stddev = 0.168÷0.193÷0.220÷0.017 ms

— ping6 sta­tis­tics —
10 pack­ets trans­mit­ted, 10 pack­ets received, 0.0% pack­et loss
round-trip min/avg/max/std-dev = 0.207÷0.325÷0.370÷0.047 ms

The infor­ma­tion I miss in the FreeB­SD hand­book in the IPv6 chap­ter is what those oth­er IPv6 relat­ed ser­vices are and when/how to con­fig­ure them. I have an idea now what this rad­vd is, but I am not sure what the inter­ac­tion is with the accept_rtadv set­ting for ifcon­fig (and I do not think I need it, as my WLAN router seems to do it already). I know that I get the IPv6-friendly net­work neigh­bor­hood dis­played with ndp(8). I did not have a look at enabling IPv6 mul­ti­cast sup­port in FreeB­SD, and I do not know what those oth­er IPv6 options for rc.conf do.

Send to Kin­dle

IPv6 in my WLAN

The man­u­fac­tur­er of my WLAN router released a new firmware. It con­tains IPv6 and DNSSEC sup­port. I got a lit­tle bit of time and pow­er to install it. Unfor­tu­nate­ly my ISP does not pro­vide IPv6 con­nec­tiv­i­ty.

I have now installed the IPv6 sup­port in Win­dows XP for the Net­book, cre­at­ed (and reg­is­tered) an ULA pre­fix at SixXS, and ver­i­fied that the net­work stack of XP gets it from the WLAN router.

When I do an IPv6 ping from the lap­top to the router, it works, but the IPv6 address does not show up in the Home­net­work overview of the router. Seems they still have some work to do.

Regard­ing DNSSEC I do not see any options in the man­age­ment inter­face, but I assume it just means that the DNS serv­er does the right thing when he is con­front­ed with recur­sive DNSSEC requests. No idea if he will val­i­date him­self and if yes, if he will add some log mes­sages regard­ing it or not.

Send to Kin­dle

The ben­e­fits of a WLAN

The nice thing about WLAN is, that you can fol­low the instruc­tions of your Doc­tor (“go to bed, sweat a lot, that is the only thing you can do to heal”), and at the same time you can do some­thing if you get bored and have the pow­er to do some not so dif­fi­coult read­ing (if you do not accept a TV in the bed­room like me).

Send to Kin­dle