------------------------------------------------------------------------------- Video Handling, including DVD ripping Video Ratios... NOTE p720 means 720 pixels high! HDTV (16:9) 1.79 720:405 1280:720 1080:608 *** TV (4:3) 1.33 720:540 1280:920 640:480 Theater 1.85 720:389 1280:692 Theater 2.39 720:301 1280:535 ? ? 720:306 1280:544 ------------------------------------------------------------------------------- Video Editing Openshot Python Based, ubuntu 'featured' software **** Lightworks KdenLive Avidemux cinellera very pro? compositing, and key mattes Also screen capture - use uncompressed RGB Kino Old editor? ------------------------------------------------------------------------------- Watching MBone (SAP) Video Enable port mdns 9875 1234 for both udp and tcp In VLC playlist select Network Streams (SAP) Not it can take some time (2 to 5 minutes) for things to appear! https://www.monash.edu/__data/assets/pdf_file/0004/566167/vlc-instructions.pdf ------------------------------------------------------------------------------- Screencasting SimpleScreenRecorder (ssr) Suggestion for low impact high quality recording... High Quality Intermediate VLC Media -> Convert/ Save, "Capture Device" tab, set "Capture Mode" to "Desktop." gtk-recordmydesktop Simple, renders video to ogv firmat video skips frames, and audio de-syncs Record Application windowid=$(xwin_find 'Minecraft.*') recordmydesktop --windowid $perl "print $(xwin_find 'Minecraft.*') Kazam Vokoscreen ------------------------------------------------------------------------------- Video Editing Resized Video for web publishing, using vlc vlc -I dummy out.ogv vlc:quit \ --sout "#transcode{ vcodec = theo, width = 512, height = 384 }:duplicate{ dst = std{ access = file, mux=ogg, dst = \"minecraft.ogv\" }}" using ffmpeg2theora ffmpeg2theora infile.ogv -v 3 -a 4 -o outfile.ogv OGV is not supported by YouTube kdenlive -- video editor and web render! (better than openshot) pitivi -- video editor -- to try openshot -- video editor and web render! newest version... https://dl.dropboxusercontent.com/u/34775202/openshot-2.0.4-1.fc22.noarch.rpm from Richard Shaw ------------------------------------------------------------------------------- YouTube Download Get latest youtube-dl youtube-dl --match-filter 'height=720+bestaudio' --playlist-start 32 UC7wCkzubI6PqyhzBNLEuhpA --playlist-end 35 --playlist-items '1-3,7,10-13' https://github.com/ytdl-org/youtube-dl ------------------------------------------------------------------------------- YouTube Best Upload Format https://support.google.com/youtube/answer/1722171 Video Codec: H264 Audio Codec: AAC-LC Container: MP4 16:9 ratio (pillarboxing added to 4:3) 2160p: 3840x2160 1440p: 2560x1440 1080p: 1920x1080 720p: 1280x720 <-- Recomended ******* 480p: 854x480 360p: 640x360 240p: 426x240 Bit Rate Video 2160p (4k) 35-45 Mbps 1440p (2k) 16 Mbps 1080p 8 Mbps 720p 5 Mbps 480p 2.5 Mbps 360p 1 Mbps Audio Mono 128 kbps Stereo 384 kbps 5.1 512 kbps If you upload at 4:3 you can add these tags WHILE UPLOADING yt:crop=16:9 Zooms/Crops to a 16:9 area (top/botton removed) yt:stretch=16:9 Scales to 16:9 (1:1 ratio not preserved) mencoder -ovc x264 -oac mp3lame \ -ss 0:20 -vf scale=-2:1024 \ -o output.avi input.iso also see... https://www.griffith.edu.au/office-marketing-communications/web-studio/guidelines-and-tools/video-encoding ------------------------------------------------------------------------------- Mencoder for Video to Video format conversions Excelent guide https://wiki.archlinux.org/index.php/MEncoder Basic Copy mencoder -oac copy -ovc copy \ -o newfile oldfile NOTE: -vf only works with xvid output start/length: -ss 0:30 -endpos 25 No Sound -nosound video filter: -vf filter,filter,filter deinterlace: -vf pp=lb # help -pphelp vertical flip: -vf flip crop detect: -vf cropdetect cropping: -vf crop=w:h:x:y scale to width: -vf scale=1280:-2 scale to width: -vf scale -zoom -xy 1280 # works when previous was ugly scale to 720p: -vf scale=-2:720 scale to 920p: -vf scale=-2:920 rotate/flips: -vf rotate=<0-7> ( 0,1 clockwise flip/no-flip 2,3 counter 4-7 only if not landscape, 1 for iphone ) Parts from one or multiple files (-ss is start -endpos is length) mencoder -oac copy -ovc copy -of mpeg -o output_file.mpg \ input.mpg -ss 0:05 -endpos 10:23 \ input.mpg -ss 13:32 -endpos 3:13 \ input2.mpg -ss 0:32 -endpos 2:55 \ input.mpg -ss 18:12 -endpos 1:01 DivX multipass (very small files)... with optional time-cut and video filters... NOTE: output can be /dev/null for the first pass! for i in 1 2; do mencoder \ -oac mp3lame -lameopts mode=3:abr:br=16 \ -ovc lavc -lavcopts vcodec=mpeg4:vhq:vpass=$i \ -vf pp=lb,flip,cropdetect,scale=-2:940 \ -ss 15 -endpos 10 \ INPUT -o OUTPUT.vi done Basic (Recompress Video - small size but low quality) mencoder \ -oac mp3lame -lameopts mode=3:abr:br=16 \ -ovc lavc -lavcopts vcodec=mpeg4:vhq \ IN -o OUT.avi OR (Much better) -oac mp3lame -lameopts fast:preset=standard \ -ovc xvid -xvidencopts fixed_quant=4 -vf pp=lb \ OR (file size adjusting - by bitrate) -oac mp3lame -lameopts mode=3:abr:br=16 \ -ovc xvid -xvidencopts bitrate=800:autoaspect -vf pp=lb \ OR (maximum size) -ovc xvid -xvidencopts pass=1 OR (x264 smaller, good quality) -oac mp3lame -lameopts fast:preset=standard \ -ovc x264 Do not copy Audio -nosound Extract just the audio mencoder -of rawaudio -oac mp3lame -ovc copy \ "${file}" -o "${file/%avi/mp3}" Clip a 5 second section, 1:30 second into video to check -ss 01:30:00 -endpos 00:00:05 \ Note end is time length, you cannot specify a absolute end mark :-( --- h264enc -3p -p nq pass 1 mencoder Input.mp4" -o /dev/null -ss 1:00 -endpos 18:30 \ -passlogfile "output_file.log" -demuxer lavf -nosub \ -vf crop=550:572:730:100,pp=al:y,softskip,harddup \ -nosound \ -ovc x264 -x264encopts pass=1:bitrate=2000:nointerlaced:force_cfr:frameref=3:mixed_refs:bframes=10:b_adapt=1:b_pyramid=normal:weight_b:weightp=1:direct_pred=spatial:aq_mode=2:me=hex:subq=6:nombtree:chroma_me:trellis=1:cabac:deblock:no8x8dct:partitions=p8x8,b8x8,i4x4:nofast_pskip:nodct_decimate:threads=auto:keyint=250:keyint_min=25 Pass 2 Same but pass=2 Pass 3 Same but pass=3 and a -o output_file.avi h264env -1p -p lq mencoder "INPUT.mp4" -o "OUTPUT.AVI" -ss 14:00 -endpos 11:30 \ -demuxer lavf -nosound \ -vf crop=400:400:1100:360,hqdn3d=7:6:9,pp=al:n,softskip,harddup \ -ovc x264 -x264encopts bitrate=600:nointerlaced:force_cfr:frameref=2:nomixed_refs:bframes=6:b_adapt=1:b_pyramid=normal:noweight_b:weightp=0:direct_pred=spatial:aq_mode=2:me=dia:subq=4:nombtree:nochroma_me:trellis=0:cabac:deblock:no8x8dct:partitions=p8x8,b8x8,i4x4:nofast_pskip:dct_decimate:threads=auto:keyint=250:keyint_min=25 Final size can be calculated and the bitrate set. --- IN ffmpeg it is ffmpeg -ss 00:00:30 -t 00:00:05 \ -c copy -i source.mp4 cut_video.mp4 or with a destination time??? -ss 00:04:14.643 -to 00:04:16.527 From FLV conversion guide (flash video to AVI) DivX format -oac mp3lame -lameopts mode=3:abr:br=16 \ -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1200 \ or -oac mp3lame -lameopts mode=3:abr:br=16 \ -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1200 \ -ffourcc DX50 -vf pp=lb \ conversion to x264 ffmpeg -codec:v h264 -crf 23 -pix_fmt yuv420p \ -codec:a aac -movflags faststart -i input.avi -f mp4 output.mp4 Example Output PNG frames of a segment of video mencoder 631.avi -vo png -ss 12 -endpos 8 Example, croping and scaling a raw vob DVD file... that had obviously been previously cropped -vf crop=crop=1216:544:62:88,scale=720:-2 or -vf flip:crop=724:542:278:104 Alturnative using ffmpeg ffmpeg -i input -filter:0:0 vflip,crop=724:542:278:104 output RMVB to AVI Make sure you can play the RVMB with mplayer. That ensures you have the codecs needed. Suggestion (fixed bitrate)... mencoder -oac mp3lame -lameopts fast:br=128 \ -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1200 \ -ofps 25 -of avi -o out.avi in.rmvb Suggestion (for Xvid prefered) mencoder -oac mp3lame -lameopts fast:preset=standard \ -ovc xvid -xvidencopts fixed_quant=4 -vf pp=lb -of avi \ -o movie.avi movie.rmvb Alternative (faster) Adjust lame-audio and video-bitrate according to http://quadpoint.org/projects/simplerip#audio_and_video_bitrates mencoder -oac mp3lame -lameopts br=128 \ -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq -ffourcc XVID \ -of avi -o movie.avi movie.rmvb MKV to AVI Use the latest 'snapshot' of HandBrakeCLI, as above (may fail). OR directly using... for i in *.mkv; do \ echo "============ $i ==============" j=`expr "$i" : ':q \(.*\)\.[^.]*$'` [ -f "$j.avi" ] && continue; mencoder -oac mp3lame -lameopts aq=2:vbr=4 \ -ovc lavc -lavcopts vcodec=mpeg4:vhq -ffourcc XVID \ -vf scale=720:-3 -ofps 24 -of avi -o "$j.avi" "$i" done Older for i in *.mkv; do \ echo "============ $i ==============" j=`expr "$i" : '\(.*\)\.[^.]*$'` [ -f "$j.avi" ] && continue; mencoder -oac mp3lame -lameopts br=128 \ -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:vhq -ffourcc XVID \ -ofps 25 -of avi -o "$j.avi" "$i" done OLD METHOD -- stuffs up badly mencoder -oac mp3lame -lameopts br=128 \ -ovc xvid -xvidencopts bitrate=900:autoaspect -vf pp=lb \ -ofps 25 -of avi -vf scale=720:-2 -o "$i.avi" "$i" Extract the uncompressed audio stream to audio.wav. mplayer input.mkv -ao pcm:fast:file=audio.wav -vc null -vo null Encode AVI using mencoder as usual plus -audiofile audio.wav. mencoder input.mkv \ -ffourcc divx \ -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=400 \ -audiofile audio.wav \ -oac mp3lame -lameopts vbr=3 \ -o output.avi Remove the intermediate file audio.wav. rm -f audio.wav VOB to AVI cat *.vob | mencoder -oac mp3lame -lameopts br=128 \ -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq \ -vf pp=lb,crop=720:432:0:72,scale=704:304 \ -o output.avi - From http://www.brad-x.com/2007/05/19/yet-another-linuxnix-video-h264-howto for high-quality MP4 file with 6 channel surround audio and video stored in anamorphic widescreen. Detailed guide -- to look at http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-dvd-mpeg4.html http://gentoo-wiki.com/HOWTO_Backup_a_DVD http://gentoo-wiki.com/HOWTO_Create_a_DVD:Encode ------------------------------------------------------------------------------- Concatenating AVI's From http://www.arsgeek.com/2006/08/07/how-to-join-multiple-avi-or-mpg-files/ First simply 'cat' the avi's together... cat b1.avi b2.avi b3.avi b4.avi b5.avi b6.avi b7.avi > b_all.avi However this may cause a time sync breakdown. So it needs to be recoded mencoder -forceidx -oac copy -ovc copy b_all.avi -o b_final.avi Or do it all together mencoder -oac copy -ovc copy b?.avi -o b_final.avi For MPEG's you need to include the output format... mencoder -oac copy -ovc copy -of mpeg parts_?.mpg -o all.mpg Parts from one or multiple files (-ss is start -endpos is length) mencoder -oac copy -ovc copy -of mpeg -o output_file.mpg \ input.mpg -ss 0:05 -endpos 10:23 \ input.mpg -ss 13:32 -endpos 3:13 \ input2.mpg -ss 0:32 -endpos 2:55 \ input.mpg -ss 18:12 -endpos 1:01 The "avimerge" program from "transcode" package is specifically designed for this. avimerge -i b? -o b_final.avi Another suggestion is "Jfuse" from http://www.jfuse.com which joins all types of media files. ------------------------------------------------------------------------------- DVD to VOB (decrypted) vobcopy decrypt and copy all the "vob's" into a single decrypted version. Suggestion: vobcopy -f -F 64 -l -t title Title info: vobcopy -I The -m mirror option will generate a decrypted copy of all the files on the DVD. dvdbackup An older cousin of vobcopy wine DVDDecryptor (only works with physical disks) DVD/MKV file Conversion Handbreak Scan DVD for title... HandBrakeCLI -i /media/VIDEO_DVD -t 0 Rip Movies Simply (longest title -L) HandBrakeCLI -i /media/VIDEO_DVD -L \ -2 -S 700 -o "Title.avi" Rip Movies (xvid) HandBrakeCLI -i /media/VIDEO_DVD -L \ -2 -e xvid -E ac3 -m -X 720 -S 700 -o "Title.avi" Rip Movies (divx) HandBrakeCLI -i /media/VIDEO_DVD -L \ -2 -e ffmpeg -E ac3 -m -X 720 -S 700 -o "Title.avi" Rip TV Epsiode (xvid) HandBrakeCLI -i /media/VIDEO_DVD -t ## \ --deinterlace="slower" --denoise="weak" --detelecine \ -e xvid -E ac3 -X 720 -m -S 350 -o "Title.avi" #Higher quality (longer to create - does not play on Dad's DVD) # HandBrakeCLI -i /media/VIDEO_DVD -L \ # -2 -e x264 -T -E ac3 -m -d -9 -7 0:1 -S 700 -o "Title.avi" Do a whole disk of TV epsiodes... s=1; d=4; e=12; S=175; # season, disc, epsiode size f=1; l=5; # first/last tiles on this disk image="Earl DVD Images/MY NAME IS EARL S$s DISC $d"; ls "$image/VIDEO_TS/" for i in `seq $f $l`; do j=$(( $i - $f + $e )); echo "====== Season $s Disk $d Title $i Episode $j ======"; HandBrakeCLI -i "$image/VIDEO_TS/VTS_01_$i.VOB" \ --deinterlace=slower --denoise=weak --detelecine \ -e ffmpeg -E lame -m -X 720 -S $S -o earl_s0${s}e0$j.avi; done Do TV epsiode files... for i in *.mkv; do echo "====== $i ======"; j=`expr "$i" : '\(.*\)\.[^.]*$'` HandBrakeCLI -i "$i" \ --deinterlace=slower --denoise=weak --detelecine \ -e ffmpeg -E lame -m -X 720 -m -o "$j.avi" done Two pass makes only a slight difference, though it takes twice as long. output format -f (avi, mp4, ogm, mkv) Video Codec -e x264 -T for small size quality (DVD players do not play) -e ffmpeg old, and default (as per normal DVD format) Magic Source (-x options) -x keyint=300:keyint-min=30:bframes=6:ref=3:mixed-refs=1:subq=5:me=umh: no-fast-pskip=1:trellis=0:no-dct-decimate=1:vbv-maxrate=4900: vbv-bufsize=3000 Audio codec (-E) ac3 passthru aac+ac3 ?? lame Bitrates (rough guide) 1400-1500: Lots of fast special effects, camera movement etc 1000-1200: Should be fine with most movies 700-800: Bad source DVD movie 650: B/W Movie 400: VCD 300: Bad Source VCD Movie chapter marks -m Recommend for movies 90 minutes long 700 MB, for longer ones (up to 3 hours) 1400 MB The longer films should be split on chapter boundarys into two files. And you can remove the last one or two chapters to junk credits. -c 1-N Suggested that instead of deinterlacing (-d) use --detelecine which compares sections and merges the to re-create original frames (much better than deinterlacing). This only works if needed. You can enable BOTH, and only what needs it uses it. DVD to DVD DVDShrink (for linux?) K9Copy & dvd95 shrink entire dual-layer DVD to single layer DVD ------------------------------------------------------------------------------- Convert OGV to MP4 This was said to fail ffmpeg -i demo.ogv -f mp4 demo.mp4 ffmpeg -i demo.ogv \ -c:v libx264 -preset veryslow -crf 22 \ -c:v libmp3lame -qscale:a 2 -ac 2 -ar 44100 \ demo.mp4 Using VLC -- Crashes vlc media -> convert/save -> add select the ogv file save convert set output filename H264 + AAC From https://docs.videolan.me/vlc-user/desktop/3.0/en/advanced/transcode/transcode_and_save.html vlc sample.mp4 --sout="#transcode{acodec=mpga, vcodec=h265}:std{access=file, mux=mp4, dst=sample_new.mp4}" # To different container vlc sample.mp4 --sout="#transcode{acodec=mpga, vcodec=h265}:std{access=file, mux=mkv, dst=sample_new.mkv}" vlc sample.mp4 --sout="#transcode{acodec=vorb, vcodec=theo}:std{access=file, mux=ogg, dst=sample_new.ogg}" -------------------------------------------------------------------------------