User:AvitalB/prototyping12: Difference between revisions

From XPUB & Lens-Based wiki
Line 350: Line 350:
Pipsever- outputs a webpage using websocket
Pipsever- outputs a webpage using websocket


==Adding the metadata==
We realised that "title" and "artist" are the 2 parameters that liquidsoap recognise for sure. We made corresponding .meta files for each track that contains this info:
artist=
track=
In the artist we put links for videos and images so we can use them during the broadcast (with the liveplayer.js in the git)


=09/06=
=09/06=

Revision as of 11:09, 9 June 2020

Prototyping

Free Culture

Free culture, Cultural diffusion, Cultural appropriation


Open source, free- used words


Free Culture/Lawrence Lessig


Putting forward the idea that free circulation of knowledge is important for democracy, culture… Free circulation of knowledge that people can build on. His references: academic- building on top on existing culture, remix culture- combination of existing works, piracy- in the positive not criminal way. Starts Creation Commons- needs a change in copyright law that says that whatever you create is your own intellectual property. You can license your work but even if you want to give up ownership the law doesn’t allows you. Everything you will produce will belong to you whether you like it or not. Activists tried to resist this like radical software. Resist the idea of copyright by putting the K (the sign instead of the copyright C. The SI’s Publication- put a statement in the beginning of the publication that anybody can use this. Copyleft- the idea of exchanging work cancelling intellectual property. Artist that did artwork/writing resisting copyright, now are under copyright of museums, cities, so on. Lessig tried to change the law. Creative commons license- usually there is a doc that you would create when you are an artist and you want your work to be used in some industries. The Creative Commons license make use of the law to override it and its a proper publishing license. Richard Stallman- founder of Free Software, coined the term, wrote the first free software license. Starts with Unix history- when computer were developed, were you wanted to solve a question you will have to configure different machines and you will get an answer using lightbulbs. Back then you didn’t have an operating systems, it was all hardware (each module did a different function). Then a computer was a job, most of them were women (they were educated but didn’t get the jobs man got). Software became literature, a cultural expression therefor can be copy rated. IBM- software maker. Now you have separation between hardware and software, computer is not a job anymore. Unix started as a research project. The project was good and they wanted to share it with each other. At that time it was niche and everybody shared despite copyright laws. C was developed wit unix- C translate English into machine code. The compiler transforms the c code to machine code. Stallman hated Unix. He said- software was circulating freely and at some point it stopped being free. He is a part of academic hackers that benefited from it being free. They built on top of existing software. He developed his version of Emacs (an editor used by developers). His idea of hacker community of sharing software was in danger. He created a license.


When you distribute your work you need to attach a license to allow other people to use or change it.


Different names for this licenses- Free culture, Creative Commons, copyfree, copyleft, open content.


Copyleft

was used many years ago (Malard). Artists put copyleft on their work to say “fuck copyright”. When Stallman was setting his license a hacker friend send him the copyleft symbol and he thought it is very cool. Nowadays copyleft means- if you modify something with copyleft you need to publish the modification as well underneath the same copyleft license. In the legal term is very technical, it’s not even a license. It a property of a free open source license. This makes the people to contribute more free software.


Free culture1.png


Copyfree

you don’t need to make public the modifications you made.


In the 90’s when copyleft started to be used a lot in artists communities but it was miss-understood- it was meant to say “fuck you copyright” but actually it enforce the redistribution of one source software. 

4RS Framework

was used to share course curriculum, was used by university professors. They tried to form a body of work that will exist outside the university and all the rules about this being shared. They said: why shouldn’t we share and all contribute to the same software together. It was an engineering approach.


Us vs. Them

in mid 90’s explosion of definition for copyleft- a lot of groups established groups and tons of licences were being made. People made a strong connection between the sharing of work towards making deep changes in society. This allowed cultural appropriation- every group seen a different thing in copyleft. It was a mess, but a good mess that gave a lot of people a voice for individuals and communities.


In the mid 2000’s Lawrence Lessig, an American constitutional lawyer, that was worried about authoritarian fractures in Eastern Europe (like communism). He was worried that this will happen in the web. He wrote a book making connection between rules and coding. He was influenced by ideas that said that like environmental activism, the web should have some kind of activism. That is how Creative Commons was created- were inspired by the boom in the 90’s but they were arrogant and said that people shouldn’t write their own licences, because you are not a lawyer, we are lawyers. They don’t acknowledge most software licenses and ignored any license that can stand agains them. All of the major activist groups in the US back then started supporting them. They were very good at PR, embraced unix culture as an example of why they are needed and used the concert about the future of the internet. They took over pretty much everything and benefited from the underground net culture. It was not easy to understand what was their ideology. The mid 90’s licenses were pretty clear about what was free open source licensing meant for them. Creative Commons tried to make everyone happy with the McDonalds approach- they offered different menus that were tailored for different need- non-commercial.


Sharelike their kind of copyleft when you have to share your contribution and so on… you can create Frankenstein licenses for free. But the underlined politics was not clear, so they were criticised a lot. They were promoting ideas of freedom but were not completely free.


There was no definition for free culture so people tried to make a definition that will correlate with free software definition. They did it on wiki. This defined what considered as a free culture license (activists, artist, chain invitation system, very US based). Creative Commons was forced to use this. They wanted to be this license for everyone. These is two dominant voices in this landscape each want their voice heard (maybe 3 including Stallman). Most US technology platforms is now licensing only through Creative Commons because they are lobbing to be everywhere.


While everything was happening Ted something came up with Trust Copyright- instead of leaving to the human the responsibility of licensing, it can be solved through software, in the browser level. He is pretty anti copyleft because it’s a lot of tiering paperwork and this can be solved by software.

12/05

Software

In this special issues we will experiment in using readymade, opensource software.

When trying to put a script together you should write one line at a time for debuging.

ls -hl

This command shows file that are executable (like .sh, .py, liq...) marked in green.

19/05 Caretaker week

Shared Sessions

Session's pad


Tmux- shared terminal sessions


create new tmux group:

tmux -S directory/group name new -s group name 
ex: tmux -S /tmp/radio new -s radio

This creates a new tmux group session in the folder /tmp.


Makes group public:

chgrp publicweb /directory/group name
ex: chgrp publicweb /tmp/radio


tmux -S /directory/group name attach -t group name


Convert audio files

ffmpeg- audio converter

Installing the software:

brew install ffmpeg


ffmpeg -i INPUT.filetype OUTPUT.filetype

We have to use the -i to mark that this file exist, so ffmpeg won't try to create one.

ex: ffmpeg -i myfile.mpe myfile.ogg

Converts the file from mp3 to ogg.

21/05 Caretakers process

Making the playlist

1] Open a new directory on sandbox in the radio directory for this week's broadcast

cd /var/www/html/radio
mkdir 12.number of broadcast
ex: mkdir 12.2


2] All the files should be uploaded to the new directory and converted to ogg. format

scp file.mp3 hub.sandbox:/var/www/html/radio/current broadcast directory
ffmpeg -i filename.typeoffile filename.ogg


3] Metadata should be added to the files : title, file name, authors, episode. The title will be used later in the websites javascript.

vorbiscomment -t "title=track_broadcast number_track number" -t "file=file name.ogg" -t "authors=name" -t "episode=12.broadcast 
number" -w file name.ogg
ex: vorbiscomment -t "title=track_2_1" -t "file=Signals_and_messages_1.0.ogg" -t "authors=mark, damla" -t "episode=12.2" -w 
Signals_and_messages_1.0.ogg


4] Make the playlist

ls *.ogg>>name of playlist.m3u

The playlist is saved as a m3u format.

The name should be unified with name of directory (12.number of broadcast)

ex: ls *.ogg>>12.2.m3u


4] Edit the playlist- you can arrange the order of the playlist

nano name of playlist.m3u

In the editor use ctrl+k to cut a line and ctrl+u to paste.


Playlist is ready for broadcast

Broadcasting

1] Copy the broadcasting liquidsoap script from last broadcast to current broadcast directory.

scp /var/www/html/radio/last broadcast directory/last broadcast script.liq .

The dot in the end means it will be copied to your current location (should be this weeks broadcast directory)

ex: scp /var/www/html/radio/12.1/12.1.liq .


2] Rename the script to have the name of this week's broadcast

ex: mv 12.1.liq 12.2.liq


3] In the script, update the playlist name to the current playlist

ex: nano 12.2.liq


4] Set fallback track - the fallback script should run in a tmux group for the case that the broadcast is not running.

The script live_interrupt.liq is in this directory

cd /var/www/html/radio


We are currently running the script in a tmux group called radio


Attach to group:

tmux -S /tmp/radio attach -t radio

Run the script in the group

liquidsoap -v live_interrupt.liq


Right now the we are using brownnoise.mp3 for the fallback, you can see it in the script

#!/usr/bin/liquidsoap -v
set("log.file",false)
# set("log.file.path","/tmp/<script>.log")
set("log.stdout",true)
%include "/srv/radio/passwords.liq"
# Add the ability to relay live shows
radio =
 fallback(track_sensitive=false,
          [input.http("http://echo.lurk.org:999/radioimplicancies_live.ogg"),
           single("brownnoise.mp3")])
radio = mksafe(radio)
output.icecast(%vorbis,
    host = ICECAST_SERVER_HOST, port = ICECAST_SERVER_PORT,
    password = ICECAST_SERVER_PASSWORD, mount = "radioimplicancies.ogg",
    radio)
# out(liveorstatic)


5] Create a tmux group that you will run the script where we will run the script.

 tmux -S /tmp/group name new -s group name

Running the script in the tmux group allows it to run in the back, not directly from a personal terminal.


Make group public

chgrp publicweb /tmp/group name


6] Run the script in the current broadcast directory (if you are not there, cd to it)

liquidsoap -v 12.2.liq


The broadcast is now running and can be heard in the website


Tips

  • You can become the radio user
su radio

You will need to enter the password


  • To view all the processes that are currently running on sandbox use:
ps aux


To view only liquidsoap processes:

ps aux | grep liquidsoap


  • Stop a process by using:
kill number of process


  • Detach from tmux session using ctrl+B, let go and then D.


Archiving

This process will make a file of the broadcast and use the metadata to track indicate while playing the file on the website.

1] Copy archiving script from last week broadcast to current directory

ex: scp /var/www/html/radio/12.2/archive_12.2.liq


2] Copy ogginfo to srt script to current directory

ex: scp /var/www/html/radio/12.2/ogginfo-to-srt.py


3] Rename archive script

ex: mv archive_12.2.liq archive_12.3.liq


4] Edit script to current week playlist

ex: nano archive_12.3.liq

Adjust the output .ogg file to the name of the script to keep consistency

ex: archive_12.3.ogg


5] Run archive script (this process will play the broadcast again so it will take the length of the broadcast to finish)

liquidsoap -v archive_12.3.liq

When it's done you will see the .ogg file of the archived playlist in your directory (in our example archive_12.3.ogg).

You can use ogginfo to see if all the tracks have the metadata. This metadata is important.

ex: ogginfo archive_12.3.ogg


6] This chain of commands will make a .vtt file from our .ogg file. This file will contain our metadata that can later be used.

ogginfo archive_12.3.ogg | python3 ogginfo-to-srt.py --json
ogginfo archive_12.3.ogg | python3 ogginfo-to-srt.py
ogginfo archive_12.3.ogg | python3 ogginfo-to-srt.py  --vtt
ogginfo archive_12.3.ogg | python3 ogginfo-to-srt.py  --vtt > archive_12.3.vtt


Now the .vtt file is generated.


7] Convert playlist .ogg file to .mp3 (it will be used in the website and will be more stable)

 ex: ffmpeg -i archive_12.2.ogg archive_12.2.mp3


8] Copy .mp3 and .vtt files from sandbox to the /12 website directory on the git (you can use scp if you have the repository cloned or your machine or use the online interface of gitea).


9] In index.html, alter the <audio> tag to contain the archived .mp3 file and the .vtt file

   <audio controls>
   <source src="archive_12.2.mp3" type="audio/mp3">
         <track default kind="captions"
          srclang="en"
          src="archive_12.2.vtt"/>
   </audio>


10] Give the "li" (list) components an id that correlates with the "title" in the metadata (you can use ogginfo on the .ogg archived playlist file to check again). You can see how it was done in the previous broadcasts.


The Javascript is already there and should work. You can checkout player2.js to see what the script is doing.


Right you can see that the current track that is playing is marked in the broadcast content table. It uses the class "now_playing" but a new script can be written that uses a different one if you like. If you want to make a different script, that will use a different class, you should copy the current one and them alter.


Result: in the website you can play the archives broadcast (this is not a live stream anymore) and the current track that is playing is marked in the table of contant.


26/05 RADIO PROTOCOLS / METADATA / STREAMING TEXT

Sessions pad

Protocols- languages between severs- liquidsoap is talking to icecast

In liquidsoap- We removed the normalize line function

vorbitcomment -l gives the metadata list

Pip server

Tail- command that looks at the end of the file

Head- shows beginning

Tail -f show the end with the the lines that are added

Ex: tail -f 12.3.log | pipeserver.py --host 0.0.0.0


02/06 New metadata, live player

Sessions pad

HTTPS - companies gives certificates, as a website owner you need to keep it up to date. Its a policing major to make sites more secure. Certificates can be revoked

Pipsever- outputs a webpage using websocket

Adding the metadata

We realised that "title" and "artist" are the 2 parameters that liquidsoap recognise for sure. We made corresponding .meta files for each track that contains this info:

artist=
track=

In the artist we put links for videos and images so we can use them during the broadcast (with the liveplayer.js in the git)

09/06

What "went wrong" last broadcast?

  • Videos/images didn't load next to the corresponding track

What happend? Combination of HTTPS and HTTP request. The images and the videos were not "secure" (was on pzwart1 which doesn't have the right licensing) Solution: move the docs to a secure directory like our git.


Mixedcontent.png


Using relative link- you can also make the link "site relative", for example just use the name of the folder and the name of the file like: 12.4/image.jpg

  • Last track didn't play