Categories
Video

How to use youtube-dl to grab an online video

Are you journalist that needs to snag a copy of a video for reporting, for use “on air” or for use in a digital video piece?

Youtube-dl is a popular tool for downloading videos from most of the common sites that has been around for a long time. Despite its name, it works not only with YouTube, but with Twitter, Facebook, and a host of other services. It is regularly updated to keep up with changes made by social media and video platforms.

Even better, while it has a lot of command-line options, it’s wickedly simple to use.

It’s another tool that can be used effectively even on a Chromebook, a computer not generally noted as a great tool for video work. (See my posts on creating video slideshows and using Google Earth Studio.)

There is a Windows version of the program, too.

The RIAA, the major trade association of the recording industry, recently issued a takedown notice for youtube-dl on the code hosting service GitHub. It argues the youtube-dl should be removed because it allows the copying of copyrighted material. However, downloads are still available and updates are still happening. (There was an update as recently as this week).

The RIAA’s legal action has been attacked as an abuse of copyright law, but youtube-dl is a free, open-source project so it’s a David vs Goliath battle.

It has been noted that it is a popular tool of journalists. I used it to download videos we had permission to use, including user-generated content, or from government video meetings in the age of COVID-19 Zoom meetings that end up archived on YouTube or Facebook.

Here’s how to use youtube-dl on a Chromebook to download a single video.

Install it from the Linux command line. (Instructions at youtube-dl.org download page.)

Here is the most command I used:

youtube-dl -f best 'URL-TO-VIDEO' 
o 'LOCAL-NAME-OF-VIDEO.%(ext)s'

This command attempts to grab the best version of the (-f best) and saves it with the filename of your choosing (-o ‘LOCAL-NAME-OF-VIDEO.%(ext)s’).

That’s it. That’s the most common use case. For YouTube videos, that typically results in a 1280×720 mp4 file.

If you want to check what formats are available:

youtube-dl -F URL-To-VIDEO

You will get a series of available files with a code number in the first column that you could use with the -f option.

Youtube-dl format list.

You may be able to get a “1080 version” (1920×1080) by using:

youtube-dl -f bestvideo+bestaudio 'URL-TO-VIDEO' 
-o 'LOCAL-NAME-OF-VIDEO.%(ext)s'

My tests resulted in a “mkv” file.

Even with the legal action, youtube-dl will currently still update with this command:

youtube-dl -U

To see what version you are using, do:

youtube-dl --version

Full help is available with:

youtube-dl -h

The official documentation has been removed by the takedown notice, but here is a copy of it, which shows all options.

I hope that helps you get started with this powerful and fast tool.

Here’s a take on the RIAA action:

Please respect the rights of content creators and only use youtube-dl for legal purposes.

Categories
ETSPJ

An insider-turned-critic’s view of health insurance, COVID-19, and the fate of the Affordable Care Act

A don’t miss event is coming up on Thursday evening from the East Tennessee Society of Professional Journalists and you can join us via this Zoom link.

Wendell Potter, a former journalist turned health industry spokesperson turned industry whistleblower, will share some of his insights in an East Tennessee Society of Professional Journalists program on Thursday at 7 p.m.

Potter has strong ties to the region. He was born in the mountains of North Carolina, but grew up in upper East Tennessee and is a graduate of the University of Tennessee.

After a very successful career covering news as a reporter, he became a health insurance company spokesman for more than two decades. In a “crisis in conscience,” he left his executive position with Cigna Insurance in 2008 and became a “reformed insurance propagandist.”

Knoxville-based Remote Area Medical and a clinic it held deep in rural Appalachia in the Southwestern Virginia county of Wise played a key role in his transformation.

He has evolved into a leading critic of the health care and insurance system in the United States and an advocate of “Medicare for All,” writing books and opinion pieces, being quoted by journalists, and testifying before Congress.

He recently launched what he calls “a first-of-its-kind project to battle greedy corporations, lobbyists & politicians who fight to preserve our deadly health care system.”

It’s called the Center for Health & Democracy.

His session with the East Tennessee and University of Tennessee student SPJ chapters comes just weeks before the Supreme Court is to hear oral arguments in a challenge to overturn the Affordable Care Act, popularly known as “Obamacare.”

It also comes as the Senate moves to confirm the nomination of Judge Amy Coney Barrett to the Supreme Court, a conservative jurist who has written critically of the court’s previous decision to uphold the Affordable Care Act.

“There could be great harm to many millions of Americans if the law is declared entirely unconstitutional,” Potter was recently quoted as saying in an article by The American Independent.

He made news mid-summer during the pandemic when he tweeted: “Amid America’s #COVID19 disaster, I must come clean about a lie I spread as a health insurance exec: We spent big $$ to push the idea that Canada’s single-payer system was awful & the U.S. system much better. It was a lie & the nations’ COVID responses prove it.”

The pandemic, the nomination to the Supreme Court of Barrett, and the Affordable Care Act challenge before the high court have focused attention even more intensely on the debate over health care in America.

Join us Thursday to get a unique insider’s view of the debate.

Categories
Video

Create video slideshows with ImageMagick and FFmpeg in minutes

I’ve been using a Pixelbook, a Chromebook from Google, for the past two and a half years.

Chromebooks are not known as great for photo and video editing, but I have found it’s an excellent platform for my needs. It does nearly all of the photo and video editing I need to do — and usually quicker.

The trick is to enable Linux on your Chromebook and use some very well-known command-line tools: youtube-dl, FFmpeg, ImageMagick, and MediaInfo.

Here is how I created a video slideshow in just a few minutes using ImageMagick and FFmpeg.

I had a series of photos taken with my Fujifilm X20 point-and-shoot camera of our dogs. Winston and Charley.

They were 4000 x 3000 pixels, a 4:3 aspect ratio. I wanted to create a video of those photos in a 16:9 aspect ratio (the aspect ratio of your HD TV) with as little “black frame” as possible and add background music.

Charley photo in a 4:3 aspect ratio

Here is what I did.

I put all the photos in a folder under Linux on the Pixelbook and then I ran this ImageMagick script on the files in the folder:

for i in *JPG;do convert "$i" 
-gravity center -crop 16:9
+repage 16x9-"$i";done

This converted all the “.JPG” files to 4000×2250, or a 16:9 aspect ratio with the center as the most important part to keep in the crop. Yes, I could have resized them as well to 1920×1080, but in this case, FFmpeg handles that.

Also, it’s Linux, case matters for JPG vs jpg.

Then I deleted the 4:3 aspect ratio versions, leaving only the new 16:9 aspect ratio ones so I could run this FFmpeg command to combine the photos as a video.

ffmpeg -framerate 1/5 -pattern_type glob -i '.JPG' 
-vf "scale=iwmin(1920/iw\,1080/ih):ihmin(1920/iw\,1080/ih),
pad=1920:1080:(1920-iwmin(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2,
fps=8,format=yuv420p" -crf 20 output-video-name.mp4

This command says to create a video showing each photo for 5 seconds (-framerate 1/5). The order of the photos wasn’t important.

Disclosure: I found the above script somewhere on the internet, but I don’t remember where. You might want to change the output framerate to 25 or 30 … change fps=8 to fps=25 or 30 … but fps=8 worked for me and all that happens in the photos are duplicated to get the frames per second.

There also are other ways to combine a series of photos, particularly ones with sequentially numbered filenames.

I downloaded some royalty-free music from YouTube and ran another FFmpeg command. (These two steps probably could be combined.)

ffmpeg -i video-name.mp4 -i background-music.mp3 
-c copy -map 0:v:0 -map 1:a:0 -shortest
video-name-with-music.mp4

Here is the result:

If you have vertical photos, they might come in sideways. I was able to fix that with ImageMagick using this command:

mogrify -auto-orient image-name.JPG

You might not want to change the aspect of vertical photos to 16:9. Run a few test files to see what you like.

There are tons of resources out there, but one of the best for FFmpeg is on Reddit. Some of the users in that subreddit are truly FFmpeg power users (which I am not).

If you wanted to take it further, it would be possible to add a watermark or “bug” to the video and to have narration as well as background audio — and a long list of other command-line options, enhancements, and tweaks.

Also, MediaInfo will also give you detailed information on a video/audio/image file.

The command is really simple:

mediainfo filename

There are versions of these command-line tools for Windows and the MacOS, but it seems the Linux versions are more actively updated. Also, you can run a Linux terminal on a Windows 10 PC now.

If your slideshows are pretty standardized, this is a very fast way to create them.

Suggestions or comments? Hit me up on Twitter at @jacklail

Note: If you copy any of the code snippets above, remove any returns.

Categories
ETSPJ Open Meetings/Open Records

TCOG Director leads session on access in a pandemic

Deborah Fisher, executive director of the Tennessee Coalition for Open Government

Join us on Wednesday for “Access in a pandemic – what journalists need to know!”

From the East Tennessee Society of Professional Journalists newsletter:

When: Wednesday, Sept. 30, 2020, noon-1 p.m.
What: Zoom discussion with Deborah Fisher, executive director of TCOG
Where: https://tennessee.zoom.us/j/94221776308 (Zoom)

Tennessee open meetings/open records expert Deborah Fisher will discuss access during a pandemic, which is changing what “public access” is for courts, government meetings and even press conferences. Fisher, executive director of the Tennessee Coalition for Open Government (TCOG), will bring us up to speed on what is happening across the state and what journalists should watch out for now.

This event is presented by the East Tennessee and University of Tennessee Student chapters of the Society of Professional Journalists.

Categories
ETSPJ Uncategorized

Poynter’s Al Tompkins coming to Knoxville

If you’re a journalist in East Tennessee, this is a “can’t miss” event, a chance to attend a workshop led by Al Tompkins for free! (Make sure to RSVP.)

There is also a community event featuring Tompkins on Friday evening, Nov. 8. This will be another great event.

Al Tompkins in Knoxville on Nov. 8 and 9.
Categories
Uncategorized

Sugar Daddy Google

Google is funding news projects with up to $300,000 per grant.