PDA

View Full Version : VHS - Video Handler Script, using ffmpeg



sea
28th May 2014, 02:02 AM
Hello everyone

I'd like to present my newest script: VHS, given the name, its all about videos.
It is a wrapper/handler for ffmpeg (http://ffmpeg.org) which is also available by the rpmfusion (http://rpmfusion.org) repos.
NOTE: It also requires TUI (https://github.com/sri-arjuna/tui) (Text User Interface), for which installation GIT will be required, please install GIT in advance. (this is not required if you use the repo)

It has reached: final release 2.0
See my BLOG (http://linux-scripter.blogspot.ch/p/vhs-video-handler-script.html) about it.
If no bug reports are made, i assume it works perfectly fine for you too. (exception: vobcopy!! i already told the author)

The main purpose for this script is to convert a video to another container, so i can watch them saved on the NAS on my TV.
Since i'm german speaking, but i like original speaking too, it lets you set 2 languages within the config file, lang_force_both is false by default, so if you wish to have 2 languages in your fresh encoded videos, you have to change it to true.
This said, the 'main' lang is ger, the 2nd is 'eng', so you will need (want) to change this.
The configuration screen will show up upon first call of the script, please take your time to make the proper adjustments.

As the script, grew and i dig into the ffmpeg docs (http://ffmpeg.org/documentation.html), i found examples for other nice usage of ffmpeg.
And at this time i also want to thank the guys in the ffmpeg channel for their help.

This said, the functionality includes:
1) Convert a video to another container
1.1) Get rid of unwanted audio streams
1.2) Include subtitles only when required
1.3) Make the videos smaller, but maintain a good quality
1.4) Easy option to either down- or upcode them (eg: downcode for the mobile phone, or upcode before writing a video dvd)
2) Record Screen / Desktop
3) Record Videologs using the webcam (internal or usb)
4) Record a 'Desktop' guide ; record your Desktop & Webcam as PiP
5) Extract the soundtrack of a music video (or just an intro)
6) Include external audio or subtitle tracks
7) Put a logo to top left corner
8) Put a video as pip overlay
9) Play streams audio/video
10) Streamcast: Audio, Desktop, Guide, Webcam, Video

Upon first call, it will open the setup dialog.
Please take your time to change the values to your prefered defaults.
This is required, so VHS requires much less arguments to be passed upon calling.

Once configured, the 'regular' calls should look like:

vhs [options] [/path/to/]file1 * .. # Encode video files
vhs -i [/path/to/]file # Show stream info of a media file
vhs -S # Record screen
vhs -W # Record from webcam
vhs -G # Record a 'Guide' (both of the above)
vhs -D # Encode a DVD, -DQ dvd recomended!


In an ideal situation, this is how i convert all videos within the current folder:

vhs *
Or if i want to save space because i think that this 10gb 1080p video is too large, this will reduce its size to about 1.3 gb:

vhs -Q fhd *

For a list of all arguments, please refer to the help screen (vhs -h)


NOTE:
The script expects the commands it generates to be working.
However, this cannot be promissed in all cases, so if it fails, use the '-v' (verbose of ffmpeg) option to analyze the cause.
There are options available to the script to 'fix' or 'bypass' most common errors that may occour, at least once you have the info from the verbose output.

Furthermore, it saves the commands within a logfile, which can be viewed by vhs -L, and i suggest to clear it after every 400 encoded videos by vhs -x, as it can grow quite large (1mb+)

Bugs & Errors
For 'bug reports' please post here the output of the 'verbose' (-Vv) call, and either attach the log or put the regarding text in [ code ] tags.
For later updates (few months after post date), please refer to: https://github.com/sri-arjuna/vhs

Known Issues

DvD encoding (actualy copy the vobfiles using vobcopy) does only work for most, ~75% with default mode or 'longest playtime'.


Video Guide / Introduction, done with VHS ;)
(Playlist (https://www.youtube.com/watch?v=9C5f3qRaNr0&list=PLLFcWWccyIef2wUuT-KUMzRdlvNj525mG))
How to install & Configure VHS (http://youtu.be/9C5f3qRaNr0)
Examples: Audio Extraction (http://youtu.be/7qb5sUPOOpk)
Examples: Debug'ing, this case - subtitle codec (http://youtu.be/0QUlVmTM9Ac)
Examples - Downcoding (http://youtu.be/1I2Cjga8e-4)

NOTES:
Now available by repositry.... (Requires rpmfusion (http://rpmfusion.org/Configuration) to be installed too!)

su
wget http://sea.fedorapeople.org/sea-devel.repo -O /etc/yum.repos.d/sea-devel.repo
yum install -y vhs

Hope this helps
Enjoy :dance:

sea
29th May 2014, 12:38 PM
0.5.2:
Files: Scan for audio streams always show streams if more than 1
DVD: Encode non-copy-protected dvd's works now

Roadmap:
* Fully implement container handling (blocker of webm improvments)
* Improve "webm/ogg" encoding - its death slow atm (high prio!)
* Reduce webcam/dvd 'menu' - test all their/its options (low prio)

sea
30th May 2014, 01:45 AM
0.5.3
Included TUI installer
Improved webm encode speed (using max cpu|threads - 1)
Improved container handling
Reduced DVD menu to: encode from disk or create/use local copy
Depricated: Quality option, not yet removed.

Roadmap:
* Add more containers (video/audo codec combinations)
* add 'pass 1|2' option

Got any suggestions/recomendations?
Please let me know!

sea
22nd July 2014, 02:06 PM
0.6.0
* Added option-toggle for 2-Pass video encoding ('-p')
* Added (upon success) removal of tempfiles for 2pass encoding, input file remains untouched of course!

Info:
To play an encoded video on your TV from the NAS, use single pass (no '-p' supplied)

Preview:
http://forums.fedoraforum.org/attachment.php?attachmentid=26167&stc=1&thumb=1&d=1406034357 (http://forums.fedoraforum.org/attachment.php?attachmentid=26167&d=1406034357)

Adunaic
22nd July 2014, 04:28 PM
I think I am missing somethign. What codecs are things encoded to. How do I change this?

sea
22nd July 2014, 04:39 PM
By default, tt uses the 'default' (according to several websites at least) codecs specific to their container (mkv,webm,mp4,ogg).


✔ ~/.config/vhs/containers $ cat webm ogg mkv mp4
# vhs (0.6) - Container definition
container=webm
ext=webm
audio_codec=libvorbis
video_codec=libvpx
codec_extra=true
file_extra=true

# vhs (0.6) - Container definition
container=ogg
ext=ogg
audio_codec=libvorbis
video_codec=libtheora
codec_extra=true
file_extra=true

# vhs (0.6) - Container definition
container=mkv
ext=mkv
audio_codec=ac3
video_codec=libx264
codec_extra=false
file_extra=false

# vhs (0.6) - Container definition
container=mp4
ext=mp4
audio_codec=aac
video_codec=libx264
codec_extra=true

However, you always can overwrite those codecs, with a similar line as in the examples.

vhs -c vlibtheora -c alibvorbis files

Or manualy change the entry in the container files for permament use.
Or keep the existing codecs of the source file by passing '-y'.

Hope this helps

EDIT:
Note the 'a' and the 'v' in front of the actual values for both: -b and -c. (bitrate & codec)

Adunaic
22nd July 2014, 08:16 PM
Cheers and making character limit... Thanks

sea
24th September 2014, 02:41 PM
0.8.0
* Added lazy quality options 'RES': screen clip vhs dvd hdr fhd
-Q RES : Set scale and bitrates to RES' defaults
-q RES : Set scale to RES defaults
-d RES : Set scale-DIMENSON to keep aspect ratio (:-1)
See help (-h) for their default values
-i VIDEO : Prints the streams of the video (much easier to read than "ffmpeg -psnr VIDEO")

* First attempt to shorten video names if they are too long for a single line
* You may now add (keep actualy) multiple audio streams, by supplying "-l LNG", where LNG is a 3 char abrevihation of your langauge (see video info for its value) (BETA).
* First attempt to also include subtitles (BETA)


Roadmap
* Trying to add 'buffers' in the hope to increase quality further, high prio (currently, the use of buffers removes the video!?)
* Improve "webm/ogg" encoding - its death slow atm, med prio
* Still want more containers, low prio as i have no use for more atm (let me know of your suggestions!)

Info:
If you feel the (default) bitrates (for -Q) are too low, please share yours in: Video Bitrates (http://forums.fedoraforum.org/showthread.php?t=300837)
Just encoded a 24min full hd video from 1gb to 230mb - with (almost) none (but within the intro) visual quality loss
And just to be clear on this again, once you've chosen your favorite container AND set your favorite languages (ger & eng for me that is), the following examples will re-encode all videos within that folder to it.

vhs *
The options are ALL optional, obviously ;)

sea
25th September 2014, 03:09 PM
0.8.1
Hotfix: If only 1 audiosream was found - uses now the proper audio id, rather than expecting it to be on stream 1

sea
27th September 2014, 02:31 PM
0.8.2
Hotfix: Screen- and Webcam- recordings work again, usage for Webcam simplyfied.

EDIT:
Just figured, it doesnt record audio along (for neither of the two)... This might take a bit as the options/parameters are passed.
I was just focused to get the video files stored, at the right place, with the proper name, that i had forgotten the audio to check.
Sorry for the inconvieniance. :(

sea
28th September 2014, 09:01 AM
0.8.3
Hotfix: Audio for Webcam- and Screen- recording works now

sea
28th September 2014, 01:56 PM
0.8.4
* Droped idea to use CRF, as that increases the file size WAY too much
* Added 'buffer'
* Subtitle codec "ssa" seems to be the only working, but hey, it does subtitles ;)

Info:
To use subtitiles at all, you must pass: -t
Subrip looked wierd upon testing, but might been the input.. idk
Please report your experience with other subtitle codecs.

sea
28th September 2014, 05:35 PM
0.8.5
* Re-use existing preview-image, mostly used in (but not limited to) matroska videos (-j)
* Added audio extraction: wav, dts, ac3, aac, mp3 (this is part of upcoming multipass -p 2|3 and therefor BETA)

There are days where code is just flowing from mind to a script and is working....
If you encounter any errors with anything added during 0.8.x (sunday) please post the output from:

vhs -Vv [your_options] "videoname"

EDIT'ed for silent hotfix: (had 'bumped' enough for one day, and this feature isnt that important)
* Added the "-j" option to getopts
* Added info on filesize update when using '-j' option

sea
29th September 2014, 02:03 PM
Me had a chat on #ffmpeg@irc, and they suggested me to either use CRF only, or to increase the bitrates to get rid of the pixelish start of videos, i have decided to increase bitrates - keeps the video smaller, also, that way only 'HD' videos use the higher bitrates...
I've added '4k' support only due to the 'hype' and since it was easy to implement those 3 values :p

0.9.0
* Increased Bitrates of hdr (768->1024) and fhd (1024->1280) when invoked by '-Q'
* Added '4k' to the list of available quality presets (4096x2160 ; 384k audio ; 2560k video)
* Added handler for channel downcode (eg: dts to stereo - default)
* Updated the 'help screen'
* Added support for FPS 'overwrite'
* Improved audio extraction procedure, but still BETA
* Improved 'genFilename' for the use with forced output name '-O NAME' (only works for audio!)
* Added encoder info to metadata: vhs & ffmpeg with their versions

NOTE:
It is highly recomended to delete current configuration (vhs -X) and let the script rewrite everything!
If you dont do so, you might get unexpected behaviour.
I do not own any device capable of playing 4k content, if you do, please drop a line of your impression.

Between 0.9.0 and 1.0.0 *drums*, i'll be optimizing for multi pass encoding, but that to work, and test enough will take some time, so i'm uplading this version now.

sea
29th September 2014, 08:43 PM
0.9.1
* Added an option to encode just a specific timeframe. Eg: "-z 1:00[-5:00]" without the optional part, it will encode 1 minute from the start time (very nice for sample files : required for me to test the upcomming multi-pass encoding)
* Removed the 'no menu' message
* Fixed 4k resolution to 3840, dont know why i've chosen a real 4k (IT) value, over the double of the regular FullHD size (2*1920)

Example of the day:

vhs -jtl jpn -z 0:45-1:30 "S01E03 A Dull Light in Despair (Dual Audio) (1920x1080).mkv"
Creates a sample file starting from 45secs to 1m 30s, reusing the mjpeg icon of the input, adding japanes to the list of languages, which applies to audio (japanes available) and subtitles as those are invoked too (this video provided only english subtitles though).
In comparison, the same command in 'plain ffmpeg' would look like this:

ffmpeg -v quiet -i "S01E03 A Dull Light in Despair (Dual Audio) (1920x1080).mkv" -strict -2 -map 0:0 -c:v libx264 -ac 2 -c:a ac3 -c:s ssa -map 0:3 -map 0:1 -map 0:2 -ss 0:45 -to 1:30 -map 0:4 -map 0:5 -map 0:6 "S01E03 A Dull Light in Despair (Dual Audio) (1920x1080).0.mkv"

I'm so excited.. *sing & dance*
:dance: :C :dance:

sea
1st October 2014, 01:27 AM
0.9.2
* Increased HD (hdr, fhd, 4k) bitrates by about the double, might be (slightly) reduced again, once multipass is working well
* Added estimated filesizes for 1 minute of video to help text
* StreamInfo now hides messages with the 'at' symbol
* Fixed subtitle id issue, which caused audiostreams to be added multiple times

sea
3rd October 2014, 12:49 AM
1.0.0
* Improved Config screem a little, added selection for language and toggles of booleans
* Droped multipass, as its not about quality, but exact filesize
* Adding: -G(uide) option, which will record your webcam as PiP over the recording of your desktop
* Added (changed) "-p" option to assign where you want the webcam to be displayed, and at what scale, see help for more info

Since Multipassing was the 'final' goal, but got droped, adding the 'Guide' option was another big goal i havent mention, but got the solution presented on a silver table - therefor its implemention was very fast and smooth.
This said, i specialy want to thank Kepstin(-laptop) of freednodes IRC channel #ffmpeg for the help provided.
Could not have done it without you, at least not this fast - Thank you!

I consider this the final release, hotfixes may follow, but their appearance (interval) will depend upon YOUR feedback.

Hope this helps
Enjoy :) :dance:

EDIT:
At the age of 34, this is my 3443'th post... by accident :cool:

sea
3rd October 2014, 05:01 PM
1.0.1
* Container updates, added: avi (fixed now), flac, mpeg, ogg (also as vorbis), ogm (also as theora), wma, wmv, xvid
* Extracting audio does now save the command to the logfile
* Slightly reduced video bitrates of the 'Q presets' for hdr and fhd, you can still overwrite them using either "-B" or "-b v2222"

EDIT:
Hoftix: Due to more codecs/containers, there was an error with the automated filename generation... fixed now

sea
4th October 2014, 02:24 AM
1.0.3
* Fixed some issues occoured upon first start
* Using the default container, or -e CONTAINER now gets applied to Guide- Screen- and Webcamrecording too
* Added (to the first post) a Video guide how to prepare your system (install rpm fusion & vhs), introducing the 'Guide' recording mode -- now you see me :)
* Added chinese to the list of languages available, Ni name hao :)

sea
24th October 2014, 03:50 AM
1.0.5
* Added: -a FILE, include audio, subtitle, logoimage or another video overlay
* Added: -K, Kill process of selected outputfile
* Fixed: -p [tcb][lcr], Picture in Picture orientation
* Fixed: -Q [clip,vhs,dvd,hdr,fhd,uhd], Video Bitrates, current value's eventualy decided to be final
* Fixed: DvD encoding works again, with non-protected-discs only (still)
* Updated: First configuration screen

NOTES:
Now available by repositry (requires rpmfusion repos as well!)....

su
wget http://sea.fedorapeople.org/sea-devel.repo -O /etc/yum.repos.d/sea-devel.repo
yum install -y vhs

Dutchy
24th October 2014, 07:38 PM
Kudos, this looks pretty nice.
Also seems to support 2 pass encodes, which is totally dreaded to do manually with ffmpeg and all its options and switches.

sea
6th November 2014, 07:58 AM
Thank you.

I droped it since i couldnt play those files on my TV, played well in VLC though, but wasnt sure enough.
So the the 2 pass did work for you Dutchy?

sea
10th November 2014, 06:27 PM
1.0.7
* (re-)Added 2pass encoding, use: vhs -2 video
* Fixed some small typos
* Reducded '-Q dvd' back to v640

Dutchy
15th November 2014, 04:04 PM
1.0.7
* (re-)Added 2pass encoding, use: vhs -2 video
* Fixed some small typos
* Reducded '-Q dvd' back to v640
Nice you've (re)added 2pass.
I'll try it again because that didn't work before like you thought.

It seemed to work just fine, i.e. that it provides a way to quickly convert media with some default settings and a nice textual interface.

In my case I found it a bit too complex to get it to do what I want (although I must admit I didn't try that hard).
Maybe I expected an easier way to access complex ffmpeg functions (e.g. the ones that handbrake provides like reference frames, b-frames and denoise filter).
I know a fair amount of ffmpeg switches but not the complex ones (and manually entering twenty parameters for each job doesn't seem very appealing), but with VHS I couldn't find some of the easier options so this script actually creates another problem for me unfortunately.
What would made it ideally for me is when it doesn't obscures the ffmpeg command line that it builds (i.e. see it or adjust it before the encoding starts).
Addressing that would probably be kind of a hard/big task and probably fall outside of your intentions for the script.

One of the things that could be done fairly easily (I guess) and would be nice/fun to have (and make use of the TUI part) is a progress bar.

sea
15th November 2014, 06:14 PM
You are welcome
and yes, there was an issue with TUI, while (actualy after) i was 'fixing' first time experience, where a bug did made a good nest for itself...

Thanks to lsatenstein how pointed this out to me, i could fix that -- hopefully, did play well on liveimage, but me changed TUI already again.


doesn't obscures the ffmpeg command line that it builds
As i understand this, you mean something like: it doesnt show the command it executes

You can always see the command it generate[ds]

vhs -V [opts] [args]
Would show the command before its loading.
vhs -L
To see what was executed.


Modifiy the line before starting, nice idea...
How about another toggle? :D
Like: vhs -A [opts] [args]
Which would then open an editor so you could edit just the exact generated command.
-A as in Advanced
How does that sound?

I agree about a 'real progress bar', its on the list.
But it is very low prio, as there are more important issues to do first and i'm happy with the currently shown progress with VHS.
As think-starter, how do you display progress (diffrently than it alread does) of unkown size/duration?

Thank you and have a nice weekend

EDIT:
I knew i forgot something:

but with VHS I couldn't find some of the easier options
Which ones?

sea
15th November 2014, 07:50 PM
Since recent changes with TUI caused some troubles, i'm pushing this update...

1.0.9
- Added '-A' toggle to edit command before executing
- Fixed tui-value-* errors
- new old bug: webm fails... idk why...

Repo update may take a little....

sea
15th November 2014, 09:54 PM
@ Dutchy, could you describe (as good as you recall, or can reproduce) your previous issues?
Maybe it could help to improve the usage experience overall.

sea
29th November 2014, 06:37 PM
1.1.0
* Added bash completion

NOTE: Does only apply to the repo installation.
And if you already using the repo, you'll get it anyway :)

sea
8th December 2014, 01:40 PM
1.1.1
- Hotfix: There was a tempdir path issue, not sure if only local or here as well, but since noone said a thing, i guess it was fine. (script & package)
- Updated bash completition (rpm package only), codec listing (audio,subtitle,video), bitrate suggestions, and PiP orientation and (optional!!) size suggestions.

sea
8th January 2015, 07:26 AM
1.2.3

Using now vobcopy too to encode dvds
Partly implemented tui-select


Note:
Keep in mind that just calling:

vhs -D
Will save at ffmpeg default bitrates for DVD.

Instead use:

vhs -DQ dvd
For the DVD i've just done 'King Arthur - Directors cut' (2005, 215mins) it made a diffrence of 1.3 GB.
2.1 GB for ffmpeg defaults, using vhs.
811 MB for "vhs -Q dvd" defaults, straightly encoded to mkv.

Obviously, if its a blueray or better, use either: -Q hdr, -Q fhd or -Q uhd.

Sidenote:
Need to test few more dvd's but chances are high i no longer need ogmrip (4mb).
Besides i also no longer need gtk-recordMyDesktop (100k -> 8.5mb)

EDIT:
Sorry, last night i did this in 2 steps, but havent applied all options to the DVD yet.
Working on this now - stand tight.

EDIT2:
There is currently a bug in TUI 6.6.6-9, please use TUI 0.6.5-X until TUI 0.6.6-15 or higher is out.

sea
12th February 2015, 06:02 AM
Is now considered DONE.

1.3

Updated: Presets are now stored in a file
Updated: bash completion for dynamic readout of the presets file
Updated: Guide-, Screen- and Webcam videos are now stored in $XDG_VIDEOS_DIR (~/Videos otherwise)
Fixed: Failure on ISO streams
Fixed: Audio selection if none could be recognized


See first post of the thread for yum installation.

Anyone able to encode 8K videos?
If so, please PM me.

hth

sea
8th March 2015, 02:24 PM
1.3.1

Updated: Default preset video bitrates increased
This should improve first time experience drasticly
for the visual oriented enduser
Updated: Japan is pushing 8k, vhs is prepared
Fixed: Overwrote existing XDG_VIDEOS_DIR variable
Added: Anime and Youtube presets


1.3.2

Updated: Bash completition reads now the qualtiy from (preset-) file
Updated: Screenrecording and DVD now takes quality argument


1.3.3

Updated: Encoded-by information is no longer in the description
Updated: To copy (only) subtitle codecs, use: '-c tcopy'
previous it was 'scopy'
Fixed: Issue with reading attachmet ids
Updated: The '-j' toggle now includes ALL attachments (Fonts, etc)
Added: Finaly added a manpage.


Hope you like and have a nice weekend :)

robertdaleweir
10th March 2015, 12:24 AM
1.3.1

Updated: Default preset video bitrates increased
This should improve first time experience drasticly
for the visual oriented enduser
Updated: Japan is pushing 8k, vhs is prepared
Fixed: Overwrote existing XDG_VIDEOS_DIR variable
Added: Anime and Youtube presets


1.3.2

Updated: Bash completition reads now the qualtiy from file
Updated: Screenrecording and DVD now takes quality argument


1.3.3

Updated: Encoded-by information is no longer in the description
Updated: To copy (only) subtitle codecs, use: '-c tcopy'
previous it was 'scopy'
Fixed: Issue with reading attachmet ids
Updated: The '-j' toggle now includes ALL attachments (Fonts, etc)
Added: Finaly added a manpage.


Hope you like and have a nice weekend :)

Hi sea
Awesome script. Just downloaded it and ripped a DVD. One question however, is there a way to keep the Chapters as searchable in the output as they are on the DVD? It has the chapters as not accessible when playing back the encoded file. I chose option 1 vobcopy and I am using F21. I always liked <ffmpeg> but your script simplifies its use dramatically. Nice job:)

sea
10th March 2015, 04:27 PM
Hi Robert

Thanks for your feedback.

Interesting thing, i have encoded 3 dvd's, 2 of which do have chapters, one doesnt.
The one that doesnt is also the oldest dvd (pre 2000).
I didnt check until now :p

Is the dvd you've encoded a new (2000 or later,) or a an old (prior 2000) one?
(Note that the year 2000 is only the year it switched for me, not necesarily beeing related, please let me know what year your dvd, so i can (maybe) try at home)

Thank you

EDIT: @ ffmpeg - streamcasters
I've once been asked to include 'streaming' functionality, but i have yet not recevied an (working!!) example line of ffmpeg doing so.
And i do need at least 2 diffrent streaming examples.
There are example lines in wiki of ffmpeg, but since i have no practical use for this myself, i need you (who is using that function) to provide me a working line out of the "real life".

robertdaleweir
10th March 2015, 05:45 PM
Hi Robert

Thanks for your feedback.

Interesting thing, i have encoded 3 dvd's, 2 of which do have chapters, one doesnt.
The one that doesnt is also the oldest dvd (pre 2000).
I didnt check until now :p

Is the dvd you've encoded a new (2000 or later,) or a an old (prior 2000) one?
(Note that the year 2000 is only the year it switched for me, not necesarily beeing related, please let me know what year your dvd, so i can (maybe) try at home)

Thank you

EDIT: @ ffmpeg - streamcasters
I've once been asked to include 'streaming' functionality, but i have yet not recevied an (working!!) example line of ffmpeg doing so.
And i do need at least 2 diffrent streaming examples.
There are example lines in wiki of ffmpeg, but since i have no practical use for this myself, i need you (who is using that function) to provide me a working line out of the "real life".

Hi sea
Definitely after 2000. I wonder what the issue is. Anyway it is a 2002 music video starring Alison Kraus and Union Station, Louisville Kentucky. If I chose Option 1 does that even use ffmpeg or what does vobcopy actually do?
Thanks again for your great script and your assistance...

sea
10th March 2015, 07:33 PM
Vobcopy is required to copy the vob files to disc, so one can work with the data.
However, as soon that is accomplished, its ffmpeg again doing the work.

I'm having a code review atm.

EDIT:
Mainwhile, does that dvd have chapters?
See:

vobcopy --info

sea
10th March 2015, 07:56 PM
Opps, it didnt work.
The file you checked, was it in ~/.cache/MOVIETITLE?

Actualy, you found a bug.
Thanks for reporting :)

Encoding a dvd now to test the fix.

robertdaleweir
10th March 2015, 08:06 PM
Opps, it didnt work.
The file you checked, was it in ~/.cache/MOVIETITLE?

Actualy, you found a bug.
Thanks for reporting :)

Encoding a dvd now to test the fix.

Hi sea
The file was in ~/.cache/MOVIETITLE. Great...

sea
10th March 2015, 09:10 PM
That is just a temporary, the RAW - just copied, vob file around 4.7 to 6.5 gb.

Saying:
Where the script stoped, was a bug not on purpose.
I'm currently testing the update to encode it.

The final video will be in the $XDG_DOWNLOAD_DIR (Usualy ~/Videos).
For DVD (using -q dvd), it'll be around 750mb (~73mins) to 2.5 gb (3.5 hrs or longer).

EDIT:
Currently finishing the first 'try' (sadly i picked a 155min movie), and will be running another one to be sure afterwards.
Expected VHS update in aprox 2-5 hrs.
Unless you'd like to test yourself (and let me know of its output - copy text from console screen), then i could push the update already.
Shall i? ;)

robertdaleweir
10th March 2015, 09:35 PM
That is just a temporary, the RAW - just copied, vob file around 4.7 to 6.5 gb.

Saying:
Where the script stoped, was a bug not on purpose.
I'm currently testing the update to encode it.

The final video will be in the $XDG_DOWNLOAD_DIR (Usualy ~/Videos).
For DVD (using -q dvd), it'll be around 750mb (~73mins) to 2.5 gb (3.5 hrs or longer).

EDIT:
Currently finishing the first 'try' (sadly i picked a 155min movie), and will be running another one to be sure afterwards.
Expected VHS update in aprox 2-5 hrs.
Unless you'd like to test yourself (and let me know of its output - copy text from console screen), then i could push the update already.
Shall i? ;)

Just take your time, I am in no hurry. Just let me know when I can get the fixed version, and thanks:)

sea
11th March 2015, 06:11 PM
1.3.4

Updated: DVD encoding no longer stops after vobcopy, ty Robert.

This is a 'hotfix' for the function to be working.
However, i seem to need to write some sort of a menu to handle diffrent dvd's, as some i wanted to try didnt work out well. (it did choose the wrong chapters).
This might follow within a week or two.

Remember:
As long you dont tell VHS to remove the tempfiles at the end, you can rerun the command (with inserted dvd) and try diffrent settings.

For a very default output, the call is simple:

vhs -D

But one could also re-arange the audio streams (given your dvd would have 3 audio streams you want to preserve), and save output filesize by passing:

vhs -Dq dvd -I "4 2 3"

The last DVD i just tried was from 1983, lasting 166 minutes and i've included 2 audio streams.
End result was 1.6 gb, which i consider to be acceptable small, for those 2 hrs and 40 minutes and 3 streams.
Most movies last about half the time.

However, there were no chapters - as your original request asked.

robertdaleweir
11th March 2015, 07:46 PM
1.3.4

Updated: DVD encoding no longer stops after vobcopy, ty Robert.

This is a 'hotfix' for the function to be working.
However, i seem to need to write some sort of a menu to handle diffrent dvd's, as some i wanted to try didnt work out well. (it did choose the wrong chapters).
This might follow within a week or two.

Remember:
As long you dont tell VHS to remove the tempfiles at the end, you can rerun the command (with inserted dvd) and try diffrent settings.

For a very default output, the call is simple:

vhs -D

But one could also re-arange the audio streams (given your dvd would have 3 audio streams you want to preserve), and save output filesize by passing:

vhs -Dq dvd -I "4 2 3"

The last DVD i just tried was from 1983, lasting 166 minutes and i've included 2 audio streams.
End result was 1.6 gb, which i consider to be acceptable small, for those 2 hrs and 40 minutes and 3 streams.
Most movies last about half the time.

However, there were no chapters - as your original request asked.

Awesome. Excellent compression with an end result as small as 1.6 GB. I decided to install 1.3.4 and rerun. I did and the runtime dialogue follows --->


[me@puter .cache]$ vhs -D
# | vhs (1.3.4) Video Handler Script 2015-03-11 10:55:44 | #
# | Encoding AL | #
# | DvD already mounted to: /run/media/me/AL [ » ] | #
# | Please select a method: | #
# | 1) Copy largest files to local (with vobcopy) 2) Encode directly from DVD (ffmpeg only) | #
# | > 1 | #
# | Copy vob files to "/home/me/.cache/AL", this may take a while... | #
Vobcopy 1.2.0 - GPL Copyright (c) 2001 - 2009 robos@muon.de [ ∞ ] | #
[Hint] All lines starting with "libdvdread:" are not from vobcopy but from the libdvdread-library

[Info] Path to dvd: /dev/sr0
libdvdread: Encrypted DVD support unavailable.
[Info] Name of the dvd: AL
[Info] There are 1 titles on this DVD.
[Info] There are 25 chapters on the dvd.
[Info] Most chapters has title 1 with 25 chapters.

[Info] There are 1 angles on this dvd.
[Info] Using Title: 1
[Info] Title has 25 chapters and 1 angles
[Info] Using Chapter: 1
[Info] Using Angle: 1

[Info] DVD-name: AL

[Info] Outputting to /home/me/.cache/AL/AL1.vob
[| ] 0.0% 126:36[================================================== ================================================== ================================|] 100.0% 00:00 [Info] Successfully copied file /home/me/.cache/AL/AL1.vob

[Info] Copying finished! Let's see if the sizes match (roughly)
[Info] Combined size of title-vobs: 7968079872 (7599 MB)
[Info] Copied size (size on disk): 7968079872 (7599 MB)
[Info] Everything seems to be fine, the sizes match pretty good ;-)
[Hint] Have a lot of fun!
# | Unmounting DVD [ ∞ ] | #
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for me:
me is not in the sudoers file. This incident will be reported.
Password:
# | Unmounted DVD [ √ ] | #
[sudo] password for me:
me is not in the sudoers file. This incident will be reported.
# | Input: AL1.vob | #
# | Guessed Channel Layout for Input Stream #0.4 : stereo | #
# | Stream #0:0[0x1bf]: Data: dvd_nav_packet | #
# | Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR | #
# | 32:27 DAR 16:9], max. 6266 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc | #
# | Stream #0:2[0x8a]: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s | #
# | Stream #0:3[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (clean effects) | #
# | Stream #0:4[0xa1]: Audio: pcm_dvd, 48000 Hz, 2 channels, s16, 1536 kb/s | #
# | Parsing for audio streams... | #
# | Didnt find: ger | #
# | Didnt find: eng | #
# | No audio stream could be recognized | #
# | Please select the ids you want to use, choose done to continue. | #
# | 1) 2[0x8a] 2) 3[0x80] 3) 4[0xa1] | #
# | 4) done | #
# | Now using audio ids: done | #
# | Saved to '/home/me/Videos/dvd-AL.0.mkv' [ ✘ ] | #
[me@puter .cache]$
[me@puter .cache]$ ls -la AL
total 7781340
drwxrwxr-x. 2 me me 4096 Mar 11 11:12 .
drwx------. 27 me me 4096 Mar 11 11:14 ..
-rw-r--r--. 1 me me 7968079872 Mar 11 11:12 AL1.vob
[me@puter .cache]$

<----
I was not sure of which option at the end to choose so I picked 4 Done. The movie is there, as you can see, in a similar AL1.vob file. I must have missed something :confused:

sea
11th March 2015, 09:03 PM
The part that is from vobcopy, is not the information you should refer to.
Again, the ~/.cache folder, and everything deeper (~/.cache/AL/*) is only temporary.

Wish i could make that vobcopy more silent.

Too bad, seems the check for you (just any user) beeing in sudoers doesnt work properly:(
It should eject the dvd when vobcopy is done, did it?
Despite the password issues, sorry :(

Anyway, what you see there

Awesome. Excellent compression with an end result as small as 1.6 GB. I decided to install 1.3.4 and rerun. I did and the runtime dialogue follows --->


[me@puter .cache]$ vhs -D
....
# | Input: AL1.vob | #
# | Guessed Channel Layout for Input Stream #0.4 : stereo | #
# | Stream #0:0[0x1bf]: Data: dvd_nav_packet | #
# | Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR | #
# | 32:27 DAR 16:9], max. 6266 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc | #
# | Stream #0:2[0x8a]: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s | #
# | Stream #0:3[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (clean effects) | #
# | Stream #0:4[0xa1]: Audio: pcm_dvd, 48000 Hz, 2 channels, s16, 1536 kb/s | #
# | Parsing for audio streams... | #
# | Didnt find: ger | #
# | Didnt find: eng | #
# | No audio stream could be recognized | #
# | Please select the ids you want to use, choose done to continue. | #
# | 1) 2[0x8a] 2) 3[0x80] 3) 4[0xa1] | #
# | 4) done | #


<----
I was not sure of which option at the end to choose so I picked 4 Done. The movie is there, as you can see, in a similar AL1.vob file. I must have missed something :confused:

Is a DVD with 3 audiostreams of which NONE was properly named/defined.
I cannot possibly guess, despite know, which of these is the one you want.

So its up to you to check which audio track of the dvd you want to use, sadly your dvd doesnt seem to be userfriendly.

To do so, just try:

vhs -Dq dvd -I 2 -z 5:00
This -z 5:00 will create a 1 minute sample file starting at minute 5, using the stream #2 as only audio.

Since you already copied the vob file, this should be accomplished within less than 30 secs.
See ~/Videos for your output video!

Then you know if stream 2 is the one you want, if its not, do the same for the other audio stream numbers.
Just saying, if it was stream #3 with the audio you want, to get the end video, you would use: (or select the 3rd entry from the menu shown previously)

vhs -Dq dvd -I 3

Using a regular movie DVD, should not cause such behaviour.
As regular movie DVD's have their languages usualy stored in 3 letter strings, which VHS reckognizes.

Hope this helps

EDIT:
Just figured, 0x80 would be the default audio stream selected by dvd players, without identifying which language it actualy is.
So selecting that track, might be what you want, as i used in the example, its track #3, which would be the 2nd selection of the menu.

sea
11th March 2015, 09:23 PM
I'll need to update TUI about the sudo-check.
Otherwise, i tried to reduce the output of vobcopy as much as possible.

1.3.4-1

Fixed: DVD: Audio selection menu, tried to include stream 'done' and failed obviously
Updated: DVD: Vobcopy offers alternative copy ways, only use if default vobcopy fails!


hth

robertdaleweir
12th March 2015, 12:03 AM
I'll need to update TUI about the sudo-check.
Otherwise, i tried to reduce the output of vobcopy as much as possible.

1.3.4-1

Fixed: DVD: Audio selection menu, tried to include stream 'done' and failed obviously
Updated: DVD: Vobcopy offers alternative copy ways, only use if default vobcopy fails!


hth

I have started the process and it seems to be completing this time. Thanks for the help! :)

sea
12th March 2015, 12:21 AM
You are welcome :)
Let me know if there is anything else.

Have a good night.

robertdaleweir
15th March 2015, 07:59 PM
You are welcome :)
Let me know if there is anything else.

Have a good night.

Hi sea
I have a couple of general questions regarding vobcopy and ffmpeg. Does it rip most movies, as I tried one called "Clear and Present Danger" and it took forever. I stopped it at around 2% which took several hours. It was still pounding away but not getting anywhere. I am using the same machine that I used to successfully rip the Music Video previously. Is there some special libs or whatever that are required to ensure successful captures or do some just not work?
I am going to try another one today and see how it goes.

sea
17th March 2015, 01:56 AM
In the end, sadly, yes.

Some movies dont seem to work, others do when selected the right title.
Some hang at 2, 10 or 16%, one did continue after 30 mins, eventualy after 45mins i aborted anyway.

Using the default mode (most chapters) about 50% of the dvd's i own encoded successfully upon first attempt.
Another 25% with the alternate mode 'longest playtime' and about 7%ish were do-able using the manual title selection.
That leaves aprox 18% of my dvd's which i cannot encode, one of them beeing in another region code, and one from a magazine with a movie-dvd.

Note that vhs' its initial purpose was to encode from one file to another, the option to encode from dvd was just added because i mis-interpreted the vob encoding of ffmpeg as dvd encoding - so i've disabled that until just 'recently' i reenabled it again with the use of vobcopy.

Guess this is a point for the 'known issues' section.

EDIT:
I do not know of any special (additional) required libs.

robertdaleweir
17th March 2015, 09:07 PM
In the end, sadly, yes.

Some movies dont seem to work, others do when selected the right title.
Some hang at 2, 10 or 16%, one did continue after 30 mins, eventualy after 45mins i aborted anyway.

Using the default mode (most chapters) about 50% of the dvd's i own encoded successfully upon first attempt.
Another 25% with the alternate mode 'longest playtime' and about 7%ish were do-able using the manual title selection.
That leaves aprox 18% of my dvd's which i cannot encode, one of them beeing in another region code, and one from a magazine with a movie-dvd.

Note that vhs' its initial purpose was to encode from one file to another, the option to encode from dvd was just added because i mis-interpreted the vob encoding of ffmpeg as dvd encoding - so i've disabled that until just 'recently' i reenabled it again with the use of vobcopy.

Guess this is a point for the 'known issues' section.

EDIT:
I do not know of any special (additional) required libs.

Thanks sea. I was thinking about libdvdcss and libdvdread. I just installed libdvdcss, as it was the only way I could view, using VLC, most DVDs using my DVD player in the computer. I thought that I noticed libdvdread ( I think I have it correct) in the VHS when it runs as well. No real problem as I understand that they all deal in some way with DRM (Digital Rights Management) issues. All is well and just trying to understand the process a little better. :)
Cheers...

sea
17th March 2015, 09:29 PM
Yeah, well, as already stated, vobcopy is a package of its own.
And there wasnt much (actual) work on it, if you skip the mass-rebuilts.


rpm -q --changelog vobcopy | head -n 21

* Son Aug 31 2014 Sérgio Basto <sergio@serjux.com> - 1.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Son Mär 03 2013 Nicolas Chauvet <kwizart@gmail.com> - 1.2.0-4
- Mass rebuilt for Fedora 19 Features

* Mit Feb 08 2012 Nicolas Chauvet <kwizart@gmail.com> - 1.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sam Aug 21 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 1.2.0-2
- rebuilt

* Mit Aug 11 2010 Matthias Saou <http://freshrpms.net/> 1.2.0-1
- Update to 1.2.0 (#1051).

* Son Mär 29 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 1.1.2-3
- rebuild for new F11 features

* Son Okt 19 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 1.1.2-1
- Update to 1.1.2
- drop vobcopy-1.1.1-gcc43.patch


I'll add the libdvdread as dependency (for vobcopy != vhs is about ffmpeg), just to be sure its there.
If you have more questions about vobcopy, please make another thread, as any deeper is not related with vhs.

Thank you and hth

sea
25th March 2015, 10:43 PM
Thanks to recent updates in TUI, i finaly could add this requested display function:

1.3.4-6

Updated: Encoding videos show now a progress bar

sea
27th March 2015, 03:33 PM
1.3.5
- Updated: corrected filesize calculation
- Updated: during verbose ffmpeg progress bar is no longer shown
- Updated: Now can change volume
- Updated: Now can merge/join/append video files.
- Updated: Now uses a single file to handle all containers

ffmpeg is :thumb:

Todays crazyness :C :dance: :cool:

vhs.sh -2xJe mp4 -b v768 -b a192 v*o[12].mkv
This is the equivalent of _6_ individual ffmpeg calls!

-2 = 2 Pass encoding ( times = + 2 )
x = Clean logfile
-J = Join passed files ( times = + (files + 1) ) ## 2 files +1 = 3
-e mp4 = encode to mp4 (times = + 1)
-b [av]123 = use bitrate for audio/video
And it looks:
https://raw.githubusercontent.com/sri-arjuna/vhs/master/example-with-2pass-and-join.png
The extension of the final file is just a display error, and is already fixed.

Hope you like it :)

sea
29th March 2015, 03:33 PM
Final Release 2.0

Added: Stream Play
Added: Stream Server: Webcam, Screen, Guide, Video
Added: History re-select for Stream Play/Server individualy
Updated: Now can encode multiple files to audio


Example:
Once you've played some webradios like:

vhs -Pu http://www.engeryswiss.ice.infomaniak.ch/energyswiss-high.mp3
You can easy select among previously played urls later.
https://raw.githubusercontent.com/sri-arjuna/vhs/master/example-stream-play-history.jpg

Just alike, you can stream from your webcam, your desktop, a guide (desktop+webcam), video or audio files...

Hope you like it as much as i do :)
:D :cool:
Have a nice weekend!
:dance:

sea
18th April 2015, 09:31 PM
Just wanted to let you know, i'm aware of some bugs occouring since 2.0.
They're due to the change of using a singe container file, which is easier for you to edit for your preferences as well as the ablity to stream, which still needs some fine tuning (and fixes).

Until next release, please use any VHS version below 2.0, or live with the bugs.

Next release will be 2.5 and beside bugfixes it will include:

bitrate calculator, (what bitrate for my XY videos to match on 1 cd/dvd/br/??) done
ip lister (internal + external), done
build-ffmpeg, x265 and more features - NOT fedora specific (as in: from scratch so it should work on any linux), in progress


~ 2500 lines of code are hard to bugfix :rolleyes:
Sorry for the inconvenience.

robertdaleweir
19th April 2015, 07:14 PM
Just wanted to let you know, i'm aware of some bugs occouring since 2.0.
They're due to the change of using a singe container file, which is easier for you to edit for your preferences as well as the ablity to stream, which still needs some fine tuning (and fixes).

Until next release, please use any VHS version below 2.0, or live with the bugs.

Next release will be 2.5 and beside bugfixes it will include:

bitrate calculator, (what bitrate for my XY videos to match on 1 cd/dvd/br/??) done
ip lister (internal + external), done
build-ffmpeg, x265 and more features - NOT fedora specific (as in: from scratch so it should work on any linux), in progress


~ 2500 lines of code are hard to bugfix :rolleyes:
Sorry for the inconvenience.

Sounds great!

sea
21st April 2015, 08:37 PM
Borked my system and could not update fixes faster :(
The borked repo is fixed too :p

So here we go:
2.1

- Added: Bit Calculator
- Added: Ip lister
- Changed: Rearanged project files
- Changed: README.md
- Added: INSTALL.md & install.sh
- Fixed: Audio extraction using the passed codec again


Ip Lister:
To show your external and all internal ips, simply type:

vhs ip

Bit calculator
By simple typing:

vhs calc
You'll be prompted a wizard to select among CD, DVD, BR or OTHER storage space.
Then pass how many files have to match on that storage
And finaly what is the average playtime throgough all those files.

For 'cd', 'dvd' and 'br' you could also call:

vhs calc dvd 15 30
To calculate the bitrate of the 15 videos with each 30 minutes playtime to best match on the dvd.

NOTE:
Once you've played some webradio urls using something like:

vhs -Pu http://webradio.url/stream.{aac,mp3}
To play a video stream, add a 'v' to the options:

vhs -vPu http://adress.url/stream.{mp4,webm,mpegts}
You can simply play them again by selecting from the playlist (remind the 'v' if video is expected)

vhs -PP
Edit or Rearange the adresses by passing:

vhs -PPP
Same handling when used as streamserver, exchange 'P' by 'U'.

Hth & have fun

sea
1st June 2015, 03:55 AM
2.2.2

Fixed: Some files/streams could not be identfied on systems with non-english locales.
Updated: Playmode now shows progressbar for files
Changed: Several stream checks got messed up because of PlayStatus


It has a good chance to replace my need for totem/vlc :D
Play local audio, all in dir
http://1.bp.blogspot.com/-YYrfGqUkjaE/VWuyYQiHhvI/AAAAAAAAATA/7pb64SIe538/s640/vhs-preview-playstatus.jpg (http://1.bp.blogspot.com/-YYrfGqUkjaE/VWuyYQiHhvI/AAAAAAAAATA/7pb64SIe538/s1600/vhs-preview-playstatus.jpg)

Play multiple local videos
http://2.bp.blogspot.com/-nMVc20oYP5I/VWu4paJzanI/AAAAAAAAATc/bXJhp7AVGKc/s640/vhs-preview-playstatus-video.jpg (http://2.bp.blogspot.com/-nMVc20oYP5I/VWu4paJzanI/AAAAAAAAATc/bXJhp7AVGKc/s1600/vhs-preview-playstatus-video.jpg)

Compare visual output with playing select stream from already added ones

http://3.bp.blogspot.com/-5jS5Qq-JOYc/VWvHjhfXfLI/AAAAAAAAATs/XZg1hwjVyCw/s640/vhs-preview-stream-files.jpg (http://3.bp.blogspot.com/-5jS5Qq-JOYc/VWvHjhfXfLI/AAAAAAAAATs/XZg1hwjVyCw/s1600/vhs-preview-stream-files.jpg)

http://linux-scripter.blogspot.ch/

Last update here, hope it helps and enjoy!
:cool: :dance:

EDIT:
BTW, it plays audio in console only mode too!

sea
1st June 2015, 11:49 AM
One last :p

Added 'zone-screenrecording'
Fixed some small displaying issues (you need to update TUI, use the repo for more ease)

BootLoop
27th January 2016, 03:34 PM
I can't get this thing to install on Fedora 23.

It stops when I run the install script with


mkdir: cannot create directory ‘’: No such file or directory

I cannot understand what is going on...

BootLoop
27th January 2016, 03:44 PM
Bug report filed at https://github.com/sri-arjuna/vhs/issues/1.

Thanks... but I guess until this is fixed... I can't use this.

sea
28th January 2016, 03:16 PM
As I cannot reproduce the error you experience,
please provide the requested information, until then I cannot solve this issue.

Mainwhile, if you install TUI manually (https://github.com/sri-arjuna/tui) or have it installed already, you can use the script directly (https://raw.githubusercontent.com/sri-arjuna/vhs/master/bin/vhs.sh).
You will just miss the 10 deskop(link) files and the tab completion, nothing of importance.

If anyone else is experiencing this issue, please try:

make distclean
V=1 ./configure --prefix=/usr ; make && sudo make install
And report its output either here or https://github.com/sri-arjuna/vhs/issues/1

Thank you and hope this helps

EDIT:
If the above did solve the issue, please let me know what you had passed to the configure script when the issue was raised.

tkalfaoglu
28th November 2017, 06:47 PM
Um, I cannot find VHS.. is it still available?

antikythera
28th November 2017, 07:58 PM
Um, I cannot find VHS.. is it still available?
yes on github. refer to sea's blog (http://linux-scripter.blogspot.co.uk/p/vhs-video-handler-script.html) for more details

https://github.com/sri-arjuna/vhs