Monday, March 26, 2018

NDI and ffmpeg streaming commands

Full post coming soon on how to get ffmpeg with NDI going so you can have remote cameras in OBS Studio for streaming. For now, though, here are some useful commands. These are for Linux, they should also work on Windows if you replace v4l2 (and probably alsa) with dshow . 

List the capabilities of a webcam
ffmpeg -f v4l2 -list_formats all -i /dev/video0

Monitor the camera (you may need to change the pixel format to something from the previous command that your camera supports)
ffplay -f v4l2 -framerate 30 -video_size 1280x720 -pixel_format mjpeg -i /dev/video0

List all NDI sources on the network
ffmpeg -f libndi_newtek -find_sources 1 -i dummy

Monitor an NDI stream
ffplay -f libndi_newtek -i "HAYLAPTOP (FrontCamera)"

Stream a webcam to NDI
ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -pixel_format mjpeg -i /dev/video1 -f libndi_newtek -pix_fmt uyvy422 FrontCamera

List audio devices
arecord -L

Stream a webcam to NDI with audio (an HD3000 webcam in this example)
ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -pixel_format mjpeg -i /dev/video0 -f alsa -i plughw:CARD=HD3000,DEV=0 -f libndi_newtek -pixel_format uyvy422 FrontCamera

A quick description of the options:
-framerate is the number of frames per second
-video_size is the resolution of the camera you'd like to capture at
-pixel_format is the format of the video stream. Input and output streams can be different, compressed input streams (e.g. mjpeg) are probably preferred. NDI only accepts uyvy422, bgra, bgr0, rgba, or rgb0 as an output format.
/dev/video0 is the first video device, usually the built-in webcam (others will be /dev/video1 etc.)
alsa is one way that Linux handles audio input and output, we're using it for input here.
libndi_newtek is non-free, so ffmpeg needs to be compiled with that option rather than using downloaded (or apt-get) builds.
FrontCamera is just a human-readable NDI name, you can call your whatever you'd like.

Other helpful resources include:

Hopefully that's enough to get you started with NDI if you're able to compile ffmpeg from source. I'll update this post with a link when I have that part written up.

Let me know if any of this doesn't (or does) work for you.

Tuesday, February 13, 2018

Learning Pandas and Plotly in Jupyter Notebooks

I'm very excited about the Callyso Project, so I've been playing around with Pandas and some data visualization tools (Plotly and Bokeh) in Jupyter notebooks. I'm more familiar with Plotly, so I started with that.

Saturday, February 10, 2018

Reflections from #NCTCA2018

The last two days have been our teachers' convention. It's always a great opportunity for professional learning and networking with colleagues.

This year I was on the planning committee, and committee members volunteer to help out during the convention. So I started out Thursday morning hosting in the Riverview Room and a quick walkthrough of the vendor hall.

Next was my session on Getting Students Coding, followed by Student-Produced Live Video. Looking at the Sched ahead of time, over 200 people had added the former to their schedule, which made me a little nervous. About 120 showed up though. I think both sessions went fairly well.

I was also able to attend Ray Suchow's session on 3D printing prosthetic hands. The best part of all of these sorts of sessions is the discussions with other like-minded educators.

On Friday I attended some of Coding in the Math Classroom by Darryl Marchand (from TI), which was good (but I think there are better ways to teach coding in math), and Matteo Hee's Build a Robot Already. Again, great opportunities for learning and discussion.

My wife attended Karen Filewych's session How Do I Get Them to Write? and thought it was great. She shared some of the ideas with me, and I'm planning to try them out. We even bought her book.

After lunch I presented Sports for Nerds: School Video Game Clubs and Tournaments and Empowering Students to Make Things. Great interactions among participants, and I got a number of new ideas from the discussions.

One of the issues with professional learning activities is that teachers often come away feeling overwhelmed. It seems that there are always better ways than what we are doing, and other things we should be doing. We need to reinforce basic skills, cover curriculum, foster competencies, prepare students for future schooling and standardized tests, and also teach them to be good, competent, productive human beings in a world that doesn't quite exist yet. It's a great job though.

I also had a great conversation with a colleague about why we offer sessions rather than complain about why there aren't the right kind of sessions available. Teachers are often too modest, thinking that what they are doing isn't special or any different from what others are doing. And we tend to be a little reluctant to speak in front of adults. If you are a teacher, though, by all means put in session proposals for conventions and conferences. You have valuable things to share, and it's also great professional learning for you.

Friday, November 24, 2017

Recommendations for Videos of Baby

A friend of mine recently had a baby (perhaps I should clarify that she still has the baby) and asked me about recommendations for a device for capturing videos. I've included my response here in case anyone else is interested.

I would actually recommend using a phone (iPhone or Android), as they say the best camera is the one you have with you. Recent smart phones have very good cameras, you just need to remember to hold if horizontally if you'll want the videos to look good on a TV at some point. The same thing applies if you want to shoot video with a tablet.

You can also get a mini smartphone tripod from a dollar store, or an inexpensive tablet tripod adapter (and tripod) on Amazon.

The biggest issue will be storage space, even if you have a phone with 64 GB or larger of space. You'll need to develop a habit of plugging your phone into your computer and moving the videos (and photos) off of the phone onto the computer. I'd also recommend installing "Google Backup and Sync" (or Amazon Prime Photos) on your computer so that it is pushing all of your pictures and videos to an online backup location. This also makes them easier to share.

If you are looking for a traditional digital video camera, I kind of like the JVC Everio HD cameras, you may be able to get one on Kijiji for about $50 or $100. They do use a strange video file format, but that's not a big issue.

Hopefully that's enough to get you started, but feel free to ask for clarification at any point.

Saturday, October 28, 2017

Convergence Conference 2017 Reflection

The last three days I was at the 2017 Convergence Conference, hosted by ATLE and AAHEIT. This post is some of my reflections, written mostly to clarify my thoughts and for my future self.

As a part of the conference planning committee, responsible for the conference program, it was cool to wear a red vest and help the conference flow smoothly.

Day 1:

Supper, as with all of the meals, was a great way to network and reconnect with other technology and education oriented people from around the province, as well as those from my school division that I don't see as much anymore.

The opening keynote with Dr. Julielynn Wong was great. I'm definitely going to explore 3D design for humanitarian purposes such as Medical Makers. My favorite quote from her was something she said to a student, "The sooner you get your prototype done, the more lives you will save... so no pressure." I'm also more inspired to explore drones (quadcopters and fixed-wing) for humanitarian purposes such as delivering medial supplies to remote communities. So many possibilities.

The vendor hall, as always, was a very cool. I love the conversations with vendors about what they are doing and how these technologies can impact student learning. And I got to try the new Acer VR headset with Windows Mixed Reality.  It is cool, but maybe I'm spoiled by the Oculus Rift and HTC Vive... the lack of hardware IPD adjustment is somewhat of a deal breaker for me.

Speaking of VR headsets, I'm actually very excited for some upcoming stand-alone headsets that don't require a PC or mobile device, specifically Oculus Go and Daydream Standalone. These look like they'll be less expensive and probably nicer than putting a phone in a VR holder. More about that later though.

Day 2:

I presented on Students Programming and Flying Drones. Despite being early in the morning, there were enough participants for good interactions and insightful questions.

Karen Plant's Breakout EDU in EPSB session included some cool ideas for both digital and physical "breakout" games for staff and students.

Hopefully my session Student-Produced Live Video was valuable for participants. Again there were good questions, and it was good to hear about how other schools and divisions are doing similar things.

Speaking of participants, I was reminded again of how excellent the Sched site is. On Wednesday night we were able to identify that a lot of people had added two particular sessions to their schedule, and so we moved those sessions to our larger rooms. Since everyone was referencing the digital schedule, it was mostly seamless (I did need to redirect one or two people).

Joseph Clark's session Implementing CTF on a Division Scale, One Division's Journey was one I intended to attend, but was unfortunately only able to be there for the end of it. However a few attendees said it was one of the highlights of the conference for them.

One of my favorite sessions, apart from the keynotes was David Chan and Barton Satchwill's The data frontier: data science in Alberta and K-12. Last year they had shown us the start of their data science initiative (and Jupyter notebooks, which I have since used with students), but this year they were talking more about how data science can, and is, being used in education. Very cool stuff, and there is a lot to learn here.

Of course the gala reception at the Telus Spark science museum was a great time to socialize, take in a science film, see some awards presentations, and of course eat some great "appetizers".

Since it had been a long day with not so much sleep the night before, some colleagues and I headed out early and were on the train back to the hotels just after 9pm. Good day though.

Day 3:

Tired in the morning, but still up early to ride the train while listening to an audiobook. Much nicer than driving and parking.

My presentation 3D Design and Printing in Math Class seemed to be fairly well received. Of course I had the added advantage with this and my drones session that these were topics discussed by the opening keynote speaker. Again it was cool to hear about this stuff and hear about what is happening in other schools and divisions.

Will Rice's Google Expeditions: A Year in Review was very good. I liked hearing about how they have been implementing VR with mobile devices and to be reminded about Nicole Lakusta's curated database of virtual reality tours and field trips.

I briefly sat in on Janet Bell's Google Classroom and Docs for Secure Exams in Edmonton Public Schools, but one of my colleagues was there and said it was fairly similar to the path we had taken. Hopefully he was able to pick up some good tips and possible tweaks from her.

From there I hopped over to Jeremiah Okal-Frink's Successful Tech Leadership: Planning Sustainable Transformation. Definitely some great ideas, particularly around the different types of pilot projects (exploratory, technical, instructional, implementation).

Dr. Frink was also the closing keynote speaker. It was great how he really spoke to the theme of the conference, and reminded us to think about past trends (and fads) in technology and EdTech, and what life may be like for our students when they are adults (by 2030 at the latest).

All in all this was a great conference. I learned and tried new things, was encouraged and inspired, and made and strengthened connections with other educators and information technology professionals. Check out the hashtag #ConEdTech to see what some others have been saying about it. The one "criticism" I heard was that there were so many good sessions during this limited time, it was difficult to choose what to attend.

I would highly recommend attending this conference next year if you are interested and able. And if you are interested in volunteering at it let me know and I'll get you connected with the organizing committee.

Sunday, March 19, 2017

Producing Live Video Announcements (with students running the show)

If you'd like to increase student engagement in morning announcements, perhaps consider live video announcements.

We've been producing live video announcements two ways, using a Tricaster and a couple of cameras or using free software (Open Broadcaster Software) and webcams. The latter way is much less expensive, but requires a little more tweaking to get similar results.

In either case, we are having elementary students run the show. Currently I'm doing most of the setup and pre-production, but hopefully we'll have students doing that soon as well. During the newscast there are usually two anchor persons (students as young as grade two), sometimes a sportscaster (a staff member in our case), two students controlling slideshows (teleprompter and background), and a student running the video switcher.

The step-by-step technical details of how this is all set up and operated will be subject of future blog posts, but for now here's an overview of things to consider.

While a newscast like this can be done with a single camera, having two or three makes it a little more interesting. You can have one set up as a standard shot of your anchor person(s), perhaps head and shoulders, medium, or cowboy. Another camera can be pointed a different direction for your sports or weather person. And I sometimes like having a "behind the scenes" camera that we broadcast before the start of the show to give students an idea of what the production process looks like.

Mics are an often-overlooked (underheard?) part of a production. We use a couple of condenser microphones on scissor arm stands, and some inexpensive handheld mics if necessary. These are connected to a physical sound mixer with phantom power and USB out, but that may be more than is necessary.

We've set up an old computer monitor just under the main camera, and connected a laptop. There's a student controlling the slideshow on the laptop, the words on the slides are color-coded for each of the anchor persons.

Background Slides
There is also a student controlling a laptop with background slides that appear behind or over the shoulder of the anchors.

Before the announcements actually begin, we've started streaming either a live behind-the-scenes camera or student artwork. We're also streaming creative commons music (currently selections from the YouTube audio library). This allows teachers to have the broadcast up on the screen and make sure the video and audio are working before the broadcast begins.

Video Interstitials
We usually start the actual newscast with a brief "news intro" video, we'll play a national anthem video that we've created or a creative commons one that we've cued up.

Chroma Keying
Usually the anchors and/or sportscasters are standing in front of a green or blue screen that we then digitally replace with a virtual set or some other interesting background. We're still working on getting the lighting right for that, but it currently doesn't look too bad.

Streaming Destination
After investigating a number of options, we've decided to use YouTube Live. It's easy to set up new channels and add managers as required. Of course for any publicly available streaming destination you'll need parents/guardians to sign a media release form.

Getting to the Audience
All of our staff members were provided with a short URL that directed to the live channel. They bring that up on their screens on the mornings when we are broadcasting. We also stream it to the hallway TVs using Chromecast devices and AirParrot.

That's a quick overview of what the production process looks like. I'll update this post with links to how we do this use a TriCaster and with Open Broadcaster Software once I've written those posts. Let me know in the comments if you'd like more details or clarification on any of these points.

Saturday, February 18, 2017

Automatically Display Live Video on Hallway TVs

At my school we do live video announcements (and occasional live events) to YouTube. We also have TVs in the hallways that display photos and announcement slides using Chromecasts that automatically display images from a Google Photos album.

So of course we want to tie these together and display live video on those TVs when we are broadcasting.

The best way I've come up with to accomplish this is to use AirParrot for screen mirroring to multiple receivers and Automator on a Mac, or perhaps AutoHotkey on a Windows machine, to automate it all. (edit: Unfortunately it seems that the new version of AirParrot doesn't have Automator/Applescript support, but it's something they are working on.)

First set up a computer to automatically launch the streaming URL ([channelID]/live) at a certain time each day. There are instructions for Automator, but I'm sure it could be accomplished a number of other ways such as with a Windows scheduled task. Of course if you wanted to get fancy, you could use the YouTube Live API to launch the URL whenever the broadcast is live.

The next step is to have AirParrot send that YouTube broadcast to all of the Chromecasts. I haven't tried automating this part yet, but AirParrot supports Automator (on a Mac) and if you're on a Windows machine then AutoHotkey can click and type for you. I really like how AirParrot connects so smoothly and mirrors displays or programs to multiple receivers, including Chromecasts and Apple TVs.

As an aside note, through Humble Bundle you can pick up two copies of AirParrot 2 for about $1USD until the end of February 2017. This is about 95% off the regular price. While you're there check out some of the other bundles, they have great taste in games and such, and amazing deals. This is not a paid endorsement.

So I'm hoping that soon I'll have this all automated so that people can watch the live video announcements in the hallways as well as in the classrooms.