{"id":16653615,"url":"https://github.com/norm/p5-media","last_synced_at":"2025-04-09T18:10:54.702Z","repository":{"id":805700,"uuid":"510200","full_name":"norm/p5-Media","owner":"norm","description":"Perl modules and scripts for handling the conversion and storage of media","archived":false,"fork":false,"pushed_at":"2012-11-17T23:17:09.000Z","size":2271,"stargazers_count":6,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T20:11:23.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/norm.png","metadata":{"files":{"readme":"README.markdown","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-02-09T21:22:16.000Z","updated_at":"2021-09-17T12:50:59.000Z","dependencies_parsed_at":"2022-07-18T13:17:07.427Z","dependency_job_id":null,"html_url":"https://github.com/norm/p5-Media","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norm%2Fp5-Media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norm%2Fp5-Media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norm%2Fp5-Media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norm%2Fp5-Media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/norm","download_url":"https://codeload.github.com/norm/p5-Media/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085184,"owners_count":21045137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T09:46:03.218Z","updated_at":"2025-04-09T18:10:54.665Z","avatar_url":"https://github.com/norm.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"p5-Media\n========\nPerl modules and scripts for handling the conversion and storage of bulky\nmedia files, such as Movies, TV series and more.\n\n\nWork in progress\n----------------\nThis is still a work in progress and a little rough around the edges.\nDocumentation is definitely lacking. An (incomplete) todo list can be found \nin the file p5-Media.taskpaper.\n\n\nRationale\n---------\nYou would use Media if most of the following is true:\n\n*   you have a lot of TV/Movies on DVD, or in AVI, MKV, WMV, etc. formats\n    that you want converted to a single format (typically MP4, compatible\n    with iTunes, Apple TV, iPad and iPhone)\n*   you want to be able to manage the conversions with a queue, using\n    different priorities for different content\n*   you want encoded files to be automatically added to iTunes for you\n*   you want metadata such as genre, director and writer pulled from\n    IMDb automatically and added to the converted file\n*   you want your converted video to be stored in an organised directory\n    structure, such as:\n    -   /files/tv/House/Season 1/01 - Pilot.m4v\n    -   /files/movies/Barbarella - X (1968)/Barbarella - X (1968).m4v\n\n\nTypical use\n-----------\nAfter ripping a DVD using an application such as [RipIt][ripit] or\n[DVD2One][dvd2one], I run `queue \u003cdvdimage\u003e` to produce a config file, then\nedit that to name the Movie/TV show and tweak video, audio and subtitle\nsettings. I then run `queue \u003cdvdimage\u003e` again to add it to the queue.\n\nAlternatively, if I have an existing video file (such as something previously\nripped into another format, or obtained from the internet), I name a directory\nsomething suitable (eg. 'House - 1x01 - Pilot') and put the video file inside,\nthen run `queue \u003cdirname\u003e` to add it to the queue.\n\nOnce queueing some jobs, I run `encoder`. This will poll the queue for jobs\nand re-encode them. It is a long-running process, so I typically run it under\n[screen][screen]. More jobs can be added whilst `encoder` is running.\n\nIf I want to see what is currently being encoded, and what will be done next,\nI just run `queue` without any other arguments. If I change my mind about a\njob, I run `queue remove \u003cname\u003e` (where name can be a regexp pattern).\n\nIf I still have jobs in the queue, but want to stop encoding for some reason,\nI will run either `encoder stop` to let the current encode finish first, or\n`encoder abort`.\n\n[ripit]:http://thelittleappfactory.com/ripit/\n[dvd2one]:http://dvd2one.com/\n[screen]:http://www.gnu.org/software/screen/\n\n\nInstalling\n----------\nMedia requires [HandBrakeCLI][handbrake] 0.9.5,\n[AtomicParsley][atomicparsley] 0.9.4, aspell\nand a _lot_ of other perl modules to be installed.\n\nAtomicParsley and aspell are most commonly installed using a ports system,\nsuch as [homebrew][homebrew] on the Mac.\n\nIf you are not comfortable installing perl modules from CPAN, I would \nunequivocally recommend you do it using [cpanminus][cpanm], which makes\nit trivial to install CPAN modules. First, install cpanminus:\n\n    curl -L http://cpanmin.us | sudo perl - --self-upgrade\n\nthen use it to attempt to install Media and all of its dependencies:\n\n    sudo cpanm https://github.com/norm/p5-Media/tarball/master\n\nThe first time, Media will fail to install as some tests do not pass.\n\nOther things that can go wrong include `WebService::MusicBrainz` failing to \ninstall. This can be worked around with:\n\n    sudo cpanm -n WebService::MusicBrainz\n\n(`-n` skips tests; ordinarily this is inadvisable, but in this case the\nMusicBrainz module fails its tests quite often because of timeouts on \nthe MusicBrainz site)\n\n[handbrake]:http://handbrake.fr/\n[atomicparsley]:https://bitbucket.org/wez/atomicparsley/overview/\n[cpanm]:https://github.com/miyagawa/cpanminus/\n[homebrew]:http://mxcl.github.com/homebrew/\n\n### Patching `IMDB::Film`\n\nThere is a long-standing bug in the CPAN module `IMDB::Film` used by Media\nwhich means it cannot find ratings/certifications information. If this \nmatters to you, replace the existing `certifications` method in the Film.pm\n(found at /Library/Perl/5.10.0/IMDB/Film.pm on a Mac) with:\n\n    sub certifications {\n    \tmy CLASS_NAME $self = shift;\n    \tmy $forced = shift || 0;\n    \t\n    \tmy (%cert_list, $tag);\n    \tmy $url = \"http://\". $self-\u003e{host} . \"/\" . $self-\u003e{query} .  $self-\u003ecode . \"/parentalguide#certification\";\n    \tmy $data = LWP::Simple::get($url);\n    \tmy $parser = new HTML::TokeParser(\\$data) or croak \"[CRITICAL] Cannot create HTML parser: $!!\";\n    \n    \twhile ($tag = $parser-\u003eget_tag('h5')) {\n    \t\tmy $txt = $parser-\u003eget_text;\n    \t\tmy($country, $range, $has_advisory);\n    \t\tif ($txt =~ /certification/i) {\n    \t\t\t$parser-\u003eget_tag('div');\n    \t\t\twhile ($tag = $parser-\u003eget_tag()) {\n    \t\t\t\tlast if ($tag-\u003e[0] eq 'h3');\n    \t\t\t\tif ($tag-\u003e[0] eq 'a') {\n    \t\t\t\t\t$txt = $parser-\u003eget_text;\n    \t\t\t\t\t($country, $range) = split /\\:/, $txt;\n    \t\t\t\t\t$has_advisory = 0;\n    \t\t\t\t}\n    \t\t\t\telsif ($tag-\u003e[0] eq 'i') {\n    \t\t\t\t\t$has_advisory = $parser-\u003eget_text;\n    \t\t\t\t\tif ( $has_advisory =~ m{original rating}i ) {\n    \t\t\t\t\t\tundef $country; undef $range;\n    \t\t\t\t\t}\n    \t\t\t\t}\n    \t\t\t\telsif ($tag-\u003e[0] ne 'div') {\n    \t\t\t\t\t$txt = $parser-\u003eget_text;\n    \t\t\t\t\tif ( $txt !~ m{^\\s*$} ) {\n    \t\t\t\t\t\t$cert_list{$country} = $range\n    \t\t\t\t\t\t\tif defined $country;\n    \t\t\t\t\t\tundef $country; undef $range;\n    \t\t\t\t\t}\n    \t\t\t\t}\n    \t\t\t}\n    \t\t\t$cert_list{$country} = $range\n    \t\t\t\tif defined $country;\n    \t\t\t$self-\u003e{_certifications} = \\%cert_list;\n    \t\t}\n    \t}\n    \treturn $self-\u003e{_certifications};\n    }\n\nSlightly altered from code found at\n\u003chttps://rt.cpan.org/Public/Bug/Display.html?id=65201\u003e.\n\n### Continuing the `Media` installation\n\nOnce you have patched `IMDB::Film`, the Media tests will pass and it should\ninstall fine.\n\n    sudo cpanm https://github.com/norm/p5-Media/tarball/master\n\nIf they still fail, please can you send me the log file from `cpanm` at\n`norm@cackhanded.net`. You can install anyway, even if the tests fail with:\n\n    sudo cpanm -n https://github.com/norm/p5-Media/tarball/master\n\n\nRead more\n---------\nOnce installed, more documentation is available:\n\n* `perldoc encoder`\n* `perldoc queue`\n* `perldoc Media::Tutorial`\n* `perldoc Media::Config`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorm%2Fp5-media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorm%2Fp5-media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorm%2Fp5-media/lists"}