Hack 50. Create Family-Friendly Edits of Movies
Use the Edit Decision Lists option in MPlayer to create a special list of video edits to perform on a file to mute or skip entire sections of a video during playback.
When I was younger, some weekends we would have movie night at home where we would rent a movie and watch it together. I was the youngest in the group, and when a movie we rented contained some questionable content, my stepdad would sit, remote control at the ready, and mute offensive language or say "hide your eyes" while he fast-forwarded. I remember one movie in particular that contained a lot of profanity. It seemed that no matter how hard he tried, my stepdad would mute dialogue only to unmute right as a character screamed some profanity, and then he would quickly press mute again to silence the rest of the dialogue only to unmute at yet another profanitya losing battle. If only he had MPlayer and its EDL (Edit Decision Lists) feature, he could have set up the mutes and edits ahead of time.
An EDL is basically a text file with start and stop editing points, and an action to perform (either mute or skip). If the action is set to mute, MPlayer simply mutes that section of the video; if set to skip, MPlayer skips the section entirely.
While the natural application for this might be editing out content in a movie that might not be suitable for children, you could also use it to edit content that is merely annoying. As an example, go back to the time when Star Wars Episode IThe Phantom Menace was released. The hype around Star Wars Episode I was immense (and if you ask some fans so was the disappointment). In particular a number of fans were turned off by the Jar Jar Binks character. One fan went so far as to take a VHS copy of the movie and edit out most of the Jar Jar scenes, as well as many of what were considered "cutesy" scenes with Anakin. The result was called "The Phantom Edit" and was covertly released in CD form and on the Internet.
If this person had had MPlayer, instead of performing the edits by hand and distributing an entire movie, he could have simply marked edit points in an EDLa simple small text fileand had a much easier time distributing it. You can also use an EDL to skip commercials in a TV episode you've recorded.
The easiest way to start using EDLs is to play the video you want to edit with MPlayer, and add the -edlfile option with a filename as an argument:
$ mplayer -edlfile sample-edl.txt sample.avi
MPlayer will start the playback of the movie, and whenever you see a section you would like to edit, hit the i key to write an edit placeholder in the file. MPlayer will maintain all of these timings in the file you specify (in our example sample-edl.txt), and when you are finished with the movie, you can then go into the EDL file and use the timings you set as general markers you can tweak by adjusting the timing a bit, lengthening the time of the edit, or changing which editing action MPlayer performs.
An MPlayer EDL file has the following format:
The begin and end seconds are in floating point format so you can specify fractions of a second, and the action is a number, either a zero or a one. If action is 0, MPlayer will skip the scene between the begin and end points entirely. If the action is 1, MPlayer will mute the scene. Here is a sample EDL file:
10.095428 12.095428 0 20.480814 22.480814 0 35.662663 37.662663 0 49.634968 51.634968 0 …
Notice that MPlayer set each of the scenes to be exactly two seconds long, and defaulted to skip the scene entirely. At this point you can modify the timings in the file and then use the -edl option to try them out:
$ mplayer -edl sample-edl.txt sample.avi
The nice thing about these EDL files is that they have such a simple format, and are text, so they don't take up a lot of space and can easily be emailed or hosted for other people to use and refine.