The best place to ask programming/development questions, imo. UPDATE: stackoverflow is the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but a great reference for finding answers.

My Music (Nickleus)


how to download/save videos from NRK in ubuntu 13.04

title in norwegian: hvordan laste ned og lagre videoer fra NRK Nett TV

here's a video of my friend Yassin on NRK:

here's what i had to do to save a copy of that video:
go here:

choose "Link til avspilling med HLS", then click "Lagre"

go to the video link again:

click the Play icon

the page will redirect to this URL:,141,316,563,1266,2250,.mp4.csmil/master.m3u8

save that page/file (ctrl+s), then open the downloaded file  (master.m3u8) in a text editor (e.g. geany)

the file contents will look like this:

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=212000,RESOLUTION=320x180,CODECS="avc1.66.30, mp4a.40.2",141,316,563,1266,2250,.mp4.csmil/index_0_av.m3u8?null=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=387000,RESOLUTION=480x270,CODECS="avc1.66.30, mp4a.40.2",141,316,563,1266,2250,.mp4.csmil/index_1_av.m3u8?null=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=712000,RESOLUTION=640x360,CODECS="avc1.77.30, mp4a.40.2",141,316,563,1266,2250,.mp4.csmil/index_2_av.m3u8?null=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1410000,RESOLUTION=960x540,CODECS="avc1.77.30, mp4a.40.2",141,316,563,1266,2250,.mp4.csmil/index_3_av.m3u8?null=

the URL for the highest quality version of the video is the one that ends in "index_4_av.m3u8" (you can also see that in the comment above it, it says 1280x720).

now make sure you have avconv installed from ubuntu's repos:
sudo apt-get install avconv

the portion of the news about Yassin begins at 04 minutes and 11 seconds and lasts for 5 minutes. I don't want the whole news report which is like 15 minutes long, so run the following command in a terminal window:

cd Downloads

avconv -i ",141,316,563,1266,2250,.mp4.csmil/index_4_av.m3u8" -ss 00:04:11 -t 00:05:00 -codec copy yassin.mp4

when the downloading and converting is done, the resulting video file will now be in your Downloads folder:

if you want to download the whole video just cut out the time parameter parts, e.g.:
avconv -i ",141,316,563,1266,2250,.mp4.csmil/index_4_av.m3u8" -codec copy yassin.mp4

special thanks to this thread:

note: avconv is the "new" replacement for the old program ffmpeg

UPDATE 20131031

i was getting some errors when trying to download a specific video encoded with h264:
[NULL @ 0x123d480] non-existing PPS referenced
[h264 @ 0x1241300] non-existing PPS 0 referenced
[h264 @ 0x1241300] decode_slice_header error
[h264 @ 0x1241300] no frame!

so i installed some extra packages:
sudo apt-get install libx264-dev libfaac-dev librtmp-dev libass-dev

then specified the video and audio codecs to use, like this:
avconv -i,141,316,563,1266,2250,.mp4.csmil/index_4_av.m3u8 -c:v libx264 -c:a libvo_aacenc knaus2.mp4

then it worked :)


  1. Do you if I can get anvconv on linux mint? I tried to run the command 'sudo apt-get install avconv' bit it didnt work

    1. sudo apt-get update
      sudo apt-get install libav-tools


  2. I highly recommend Allavsoft to downlod  M3U8 files to MP4, AVI, MKV, FLV, MOV and more other popular video formats.step by step at