Posted on

How to connect an external microphone to your Smartphone

I always wondered why my 10$ external lapel microphone I bought for my GOPRO won’t work with my smartphone. The answer is that the ground and the Mic connectors are inverted between a microphone 3.5 mm male jack and a smartphone female 3.5 mm jack connector. This video shows step by step a diy (do it yourself) adapter to connect any microphone with a 3.5 mm jack to your smartphone. If you are too lazy you can still buy the MyMyk adapter for about 30 $.

List of tools :

  • Lapel microphone: http://www.ebay.ca/itm/Deluxe-Lavalier-Lapel-Microphone-Clip-on-Omnidirectional-Condenser-Mic-for-Apple-/152202586564?hash=item236ffb29c4:g:ojMAAOSwU-pXrR-X
  • MyMyk adapter: http://www.ebay.ca/itm/MyMyk-Connector-Cable-For-External-Mic-to-be-used-with-Smart-Phone-Tablet-/131836441011?hash=item1eb21071b3:g:gMYAAOSwQupXUUO6
  • 3.5 mm Jack Femal Socket: http://www.digikey.ca/product-detail/en/cui-inc/SJ-43514-SMT-TR/CP-43514SJDKR-ND/1819833
Posted on

Expose you localhost to the web

ngrok.com

Ngrok pronounced “en-grok” is the best way to expose you localhost server to the web true a free secured DNS. If you want to test an application ngrok.com will provide you a domain name pointing to you computer in less than 10 secondes.

1# Download here 

<a href="https://ngrok.com/download">https://ngrok.com/download </a> 

2# Step 2: Unzip it

 $ unzip /path/to/ngrok.zip 

3#Run it !

 $ ./ngrok http 80 

Of course you need to run a local server such as MAMP or WAMP (Apache/Mysql) or Easyphp or IIS for Windows applications.

Posted on

How to download a video from a protected website

You often want to save a video on your hard drive to be able to watch later on a travel when you don’t have access to internet. There is one way to do it on websites that uses HTTP Live Streaming HLS.

Update :

Quick method :

An easier method is to use directly the m3u8 file available by filtering “m3u8” in the developer Filter box.

http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=5300522320001&pubId=618566855001&videoId=5300467502001

Replace the m3u8 url in the following ffmpeg command :

ffmpeg -i "url" -c copy -bsf:a aac_adtstoasc 11.mp4

Source : https://gist.github.com/Pusnow/2ec4612adad7898b4c21e76b7a5d1915

Long method :

Let’s take for example an episode of “LES RECETTES POMPETTES” http://noovo.ca/videos/les-recettes-pompettes/alex-nevsky when using the developper option (F12) on the Network section we can quickly see that small 10 seconds transport stream video files are received from the streaming server http://v10-a.akamaihd.net/hls/618566855001/201701/5300522320001/618566855001_5300522320001_s-4.ts?pubId=618566855001&videoId=5300467502001noovo

 

If we analyse the link we see the extension .ts, that is the 10 seconds transport stream. The file name ends with 4 that’s the 4th 10 second transport stream.

 

http://v10-a.akamaihd.net/hls/618566855001/201701/5300522320001/618566855001_5300522320001_s-4.ts?pubId=618566855001&videoId=5300467502001

 

If we look at the video duration on the website we see that it lasts 21 min we can than calculate the number of files to download 24*60/10 = 144 files.

With a small bash file we can loop trough the list of files and download them :


#!bin/sh

#Download transport stream files from server

server="http://v10-a.akamaihd.net/hls/618566855001/201701/5300522320001/618566855001_5300522320001_s-"

extension=".ts"

max=144

for i in `seq 1 $max` do wget "$server$i$extension" done

 

Last step and not the least is to concatenate all the files to output them into a single transport stream of 21 minutes. For that task we can use ffmpeg concatenate function (you can get ffmepg by using sudo apt-get ffmpeg command ) :

ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.ts

or inline loop the current folder .ts files using :

ffmpeg -f concat -safe 0 -i &lt;(for f in ./*.ts; do echo "file '$PWD/$f'"; done) -c copy output.ts

The -sage 0 above is not required if the paths are relative.

The -i mylist.txt is a file text that contains the list of input files to concatenate it should be with the following format :


# this is a comment

file '/path/to/file1'

file '/path/to/file2'

file '/path/to/file3'

Finally the output.ts will be the name of your final file you should specify the output type .ts or another format .mkv

Source 1: https://fredericbournival.com/blog/comment-telecharger-les-videos-de-noovo-ca-vtele/

Source 2: https://trac.ffmpeg.org/wiki/Concatenate