VIDEO PRODUCTION PROCEDURE obs-studio open source app IS awesome. Supports Linux. http://en.wikipedia.org/wiki/Display_resolution#Current_standards Some good details and tips about encodings and delivery options: https://deovr.com/pages/doc NTSC is 4/3 aspect ration "per picture height" of 640x480 though actual display is 648x486. -sn: Don't produce subtitles. But doesn't improve speed or size if input contains no subtitle data. HD Resolutions 480p = 720x480 Actually 854 or less hor, per Wikipedia. Ffmpeg param hd480 means 852x480. 720p = 1280x720 1080p = 1920x1080 UHD 4K = 3840x2160 (UHDTV, 4K) Files are over 3 x as large as 1080p Really need a separate doc file for ffmpeg. It's such a powerful program but requires a lot of specific op knowledge. Never use both '-qscale 0' and copy codecs. Copy codecs imply '-qscale 0' (but not the inverse). Widen terminal window to at least 94 chars to prevent scrolling of extremely verbose messages which should update in-place. DEFINITELY READ http://commons.wikimedia.org/wiki/Help:Converting_video MPG4s may not be concatenated. AVIs may be. MPGs may be. AVIs are much smaller than MPGs. Best conversion to MP4 that I've found: ffmpeg -qscale 0 -i catted.wmv -vcodec libx264 -acodec libmp3lame out.mp4 I see that from some sources MP4s are much smaller than MPGs, but when I convert from one to the other the sizes are about the same. .mp4 has strict requirements for the input audio. If ffmpeg refuses to encode to mp4 due to input audio, use "-an" instead of the mp3 codec and write a vid-only mp4, or settle for .mpg. :( Several ffmpeg commands http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs IMPORTANT: When specifying times to ffmpeg, you must specify all of hours, min, secs. You need not use 2 digits for each. Ex, 1 s = 0:0:1. Generally, sometimes '-qscale 0' is implied, but other times when you are not changing formats or encoding it is not implied. Safer to always give it. Position doesn't seem to matter. There are tons of commercial Windows Flash screen capture programs. http://www.swftools.com/tools-category.php?cat=929 Composite with Cinelerra. Export from Cinelerra to .ogv format. [I have notes which say audio synchronization gets screwed when converting .ogv to .flv, but with the versions of the tools I am running with today, the synchronization is 100% on.] Convert from *.ogv to *.flv with metadata. ffmpeg -qscale 0 -i seg1.ogv -b 430k -pass 1 -ar 22050 -r 10 tst-nomd.flv ffmpeg -qscale 0 -i seg1.ogv -b 430k -pass 2 -ar 22050 -r 10 tst-nomd.flv yamdi -i tst-nomd.flv -o tst-sameq.flv It takes 3:15 to execute all three steps on a 14 minute video (on beyla). My script "ogvtoflv" makes some optimizations and cuts this time to 1:30. ATTEMPTING TO PROCESS A & V SEPARATELY TO NORMALIZE AUDIO TRACK: (ffmpeg seems to choke on Theora (video) only Ogg files. Must be either Audio = Vorbis OR Audio+Video = Vorbis + Theora.) ffmpeg -y -qscale 0 -i seg3b.ogv -b 430k -r 10 -pass 1 -an seg3s.flv ffmpeg -y -qscale 0 -i seg3b.ogv -i seg3.ogg -map 0:0 -map 0:1 -b 430k -r 10 -pass 2 -ar 22050 seg3s.flv LOOKS LIKE I MISUNDERSTOOD -map -i file -map streamnum:syncstream streamnum2:syncstream2 -i file... TRY exporting from Cinelerra to .avi, then using avi2swf (does this do .flv?) PROGRAM MISSING FROM swftools PACKAGE! To capture frames from a video: I don't know how to get high quality Jpegs. Tiny JPG: ffmpeg -y -i x.avi -vframes 1 -ss 00:00:10 -an -s 120x90 -qmin 20 x%d.jpg Exc.-qual PNG: ffmpeg -y -i x.avi -vframes 1 -ss 00:00:10 -an -vcodec png -f rawvideo -s 320x240 x.png (Don't know why % does not work for jpegs). Creating VCDs and DVDs k3b? ManDVD mandvd DVDStyler. Front end for dvdauthor et. al. KDVDCreator kdvdcreator bombono devede gAny2DVD kdvdauth kmediafactory "lsdvd" looks useful ?ogmrip qdvdauthor videomaker. Java Favorite DVD/VCD authoring tool: devede N.b., when generating an image, it will always write the output to dir/file x/x.iso., and will write temporary files of names x/x*. I.e the file names begin with the directory name. When it asks you to choose the destination directory/image name, you are actually giving both the directory name and the base file names therein. It won't write outside of the directory name that you specify. See http://blog.archive.org/2008/11/25/fast-and-reliable-way-to-encode-theora-ogg-videos-using-ffmpeg-libtheora-and-liboggz/ for a to-ogv procedure, including safe way to get good audio sync. "ffmpeg2theora" is awfully convenient, but even with video settings at highest quality + lowest speed, at least with .wmv input, it creates output with lots of artifacts. Way below acceptable level. .wmv -> .ogv reduces size by about 49%. CLIPPING -ss Start switch -t Stop switch, by duration -to Stop switch, by absolute time Some high-quality *.wmv's just can not be clipped with simple -ss arg to ffmpeg. When this happens, do a clipping convert with ffmpeg: FFMPEG_ARGS='-ss 1:23 -to 14:20' mp4ify input.wmv MAKING CLIPS ffmpeg -i *Schl*.wmv -ss 0:9:48 -t 0:1:5 -vcodec copy -acodec copy out.wmv -t time is DURATION of created clip Runs EXTEMELY FAST. Apparently does no decoding or encoding. IF GOING TO CONCATENATE SEGMENTS AFTERWARDS, I don't know if it is generally best, but definitely if using a format like .wmv that can not be concatenated, you must convert codec/format to a concatenatable format before the concat step. CONCATENATING CLIPS (AVI or MPG) Best with AVI: cat 1.avi 2.avi > catted.avi; ffmpeg -i catted.avi -vcodec copy -acodec copy out.avi This is very non-deterministic due to details invisible to the editor (person). With the same input starting formats, sometimes you can use them straight, sometimes you must convert them with no codecs, sometimes with copy codecs, sometimes with mpeg4/libmp3lame codecs. Seems that, at least some times, if no format change smallest output size via '-qscale 0' without specifying copy codecs. (Output indistinguishable). ? Why converting to MPG. Can concatenate using only .avi's. ffmpeg -i input1.avi -qscale 0 intermediate1.mpg ffmpeg -i input2.avi -qscale 0 intermediate2.mpg cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg (ffmpeg -i intermediate_all.mpg -qscale 0 output.avi) ffmpeg -i catted.mp4 -vcodec copy -acodec copy out.mpg # better TO CONCATENATE .mp4 FILES, must (at least sometimes) convert segs to .avis ffmpeg... file-1.avi cat ... > all.avi ffmpeg .. -i all.avi [-vcodec libx264]... out.mp4 POSTNOTE: As of 2018-05-104 the -vcodec switch here is useless. Best conversion to AVI that I've found: ffmpeg -qscale 0 -i catted.wmv -vcodec mpeg4 -acodec libmp3lame out.avi # '-qscale 0' is sometimes CRUCIAL to prevent quality downgrade! At least from one site, .mp4 downloads are 1/4 the size and higher quality than .mpgs. VLC - slow down + speed up SHIFT+->: FF [correspondingly for REV] CTRL+->: FF faster [correspondingly for REV] CTRL-Q: to Quit SPACEBAR: Toggle pause Use cvlc to not have any controls To have Quit after input video(s), specify input vlc://quit (as if a video). CTRL+I to see specs like frame rate in cases that ffmpeg doesn't report what you need. Useful vlc switches: -f # fullscreen --zoom .5 --rate 3 --no-audio Photo display duration: Menu -> Tools -> Preferences -> All -> Input Codecs -> Demuxer -> Image -> Duration in seconds .xspf play files To specify relative files, use location like "./file.name" or "file.name". ("file:anything" will not work). Videos: Track time in ms. Seems to be ignored. Works fine without. Photos: No effect. Always displays for 20 seconds. See "Duration in seconds" setting above. indexing starts at 0. Looping button/indicator: DEFAULT/REGULAR LOOK: disabled shows "1": loop 1 video shaded regular 2 arrows: loop-all Old fashioned normal aspect TVs are 480x360. LG BLUERAY PLAYER Can not do .wmv or *.flv. Some avi and mp4 files just work, but most need conversion: ffmpeg -i in.file -target ntsc-svcd -aspect 4:3 out.mpg # NO '-qscale 0' '-qscale 0' makes the encoding run MUCH SLOWER: Slower than 1:1; takes more disk space and difference in quality is indistinguishable! *VERIFYING TODAY HOPEFULLY* -aspect... switch often results in output resolution being square. Don't worry about that. It all works out right. IF NEED TO CONVERT VIDEO FORMAT ANYWAYS, go with libx264 codec for .mp4. Much more efficient than avi. Do not give -aspect or -target to resize, let the LG player letter-box it. SVCD "-target ntsc-svcd" by itself does not change to the required res. or asp. ratio DO NEED -aspect switch. For my test this switches to square resoution but with SAR 4:3 DAR 4:3. "-qscale 0" seems to have no effect if changing video in any (?) way. Webm format For HTML5 embedding. Encoding takes longer than traditional encoding. = VP8 video codec + Ogg Vorbis audio coded + webm 'container'. Since the format is new, I very much doubt that our new LG BlueRay player can handle it. ffmpeg -r 10 -b 1800 -i img%04d.jpg -f webm test1800.webm Rotation requires Video Filter -vf transpose=1 # See manpage for the transpose integer values # 1 for 90 degrees clockwise, e.g. Cropping. Like ffmpeg -i file.in -vf crop=in_w-100:in_h-100:50:50 out.same ffmpeg -i file.in -vf crop=in_w-100:in_h-100:50:50 -target ntsc-svcd -aspect 4:3 out.mpg Generally: ... crop=::: provided vars: in_w,in_h,x,y, operators: */ Are x and y 0-based or 1-based?? Crop 10 pix from L, R borders, and 20 pixels from top, bottom borders: 'crop=in_w-2*10:in_h-2*20' SLOW-DOWN mencoder -ovc copy -nosound -speed 0.25 input.* -o tmp.mpg ffmpeg -i tmp.mpg -target ntsc-svcd -aspect 4:3 slowFirst.mpg JING To get the .swf file, you must enable downloading in settings, the actually open the page for the video and use the download link. Enforcing aspect ratios. NICELY SNAPS to the popular sizes!! CTRL + drag: 4:3 (standard) (says populars are 320x240, 640x480, 800x600, 1024x768) SHIFT+drag: 16:9 (HD) (populars are 640x360, 800x450, 960x540, 1024x576, 1280x720, 1920x1080) kamoso seems to be a webcam app for KDE. (cheese is probably better but is only for Gnome). ffmpeg's "tbr" is "guessed from the video stream and is the value users want to see when they look for the video frame rate". EXTRACT AUDIO to mp3: ffmpeg -i *.mp4 -vn straighttrack.mp3 Details that to me usually are unnecessary: #ffmpeg -i infile.x -vn -ac 2 -ar 44100 -ab 320k -f mp3 output.mp3 I suspect that may need to specify the "-acodec libmp3lame" if converting format? Program kamoso will not save videos. Reports a nepomuk error instead. Cheese is for Gnome, but after installing a ton of Gnome shit, it still works like shit. Audio EXTREMELY skippy. No audio. Writes videos to ~/Videos/Webcam in .ogv format. Format and location seem to not be configurable. Resize/Changing/reducing video resolution: -s 320x240 Also: -s hd|hd480|hd720|hd1080 For lib264 acodec with OLD ffmpeg, you must use switch "-vpre X" where X is one of the strings like "default" in /usr/share/ffmpeg/libx264-*.ffpreset. Transcoding generally just doesn't work. Cropping is extremely inaccurate and often hoses much of the output. Per http://superuser.com/questions/250448/how-to-trim-cut-clips-with-vlc : Here's how I stream a portion of a file, while keeping the original audio and video streams intact (no transcoding done). Times are given in seconds: vlc in.avi --play-and-exit --start-time 65 --stop-time 95 :sout=#file{dst=out.avi} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep With transcoding: vlc in.avi --play-and-exit --start-time 65 --stop-time 158 :sout='#transcode{vcodec=mp2v,vb=4096,acodec=mp2a,ab=192,scale=1,channels=2,deinterlace,audio-sync}:std{access=file, mux=ps,dst=out.mpg}' Times are in absolute seconds. From http://www.videolan.org/doc/videolan-howto/en/ch09.html: (Writes to IP with a SAP announgement, so scrach that stuff) vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}: duplicate{dst=display,dst=standard{access=udp,mux=ts,url=239.255.12.42,sap,name="TestStream"}}' Lists available codecs, defaults, available values and formats for all options: http://www.videolan.org/doc/vlc-user-guide/en/ch04.html Downloading Flashes: ClipGrab. In OpenSuse repos. VLC when playing directories sorts videos as follows: Digits Letters (case-insensitive) ffmpeg tips from man page 'q' displayed when encoder quantizing. q=1 verygood. q==31 worse Bad q then: increase bitrate, decrease frame rate, decrease frame size to flop hor or vert, use -c:a copy -vf hflip # or vflip Great Courses (aka teach12, teachco) videos Provide *.wmv and *.m4v formats. These seem to have equivalent quality, but the *.m4v uses h264 encoding (at the cost of 14% larger file size). These both play fine on TV but neither will play on LG Blueray player. Converting to *.mp4 decreases size by 67% retaining screen res and frame rate, but increases video distortion :(. Therefore, my policy for GC videos is to work with the *.m4v files. If ever need to drastically reduce file size (at cost of distortion), then make working copies in *.mp4 format. HD *[ip] formats are 1.78 aspect ratio. Widescreen film is 1.85 Chromebook Pixel is 1.5 (or 3:2) Concatenating mp4s see "Using named pipes to avoid intermediate files" at http://trac.ffmpeg.org/wiki/Concatenate VLC To change slide show durations, it's under prefs a/All: Input/Codecs > Demuxes > Image. (Duration setting in playlist .xspf files don't work). VLC Hot Keys +: speed up -: slow down ALT+4: double size f: toggle Fullscreen CTRL+T: enter offset time It appears that MP4Box (from package gpac) is much better at concatenation and clipping/splitting, though it can't resize. Gotcha: BE CAREFUL BECAUSE IMPERFECT COMMAND-LINES CAN WIPE THE INPUT FILE! https://gpac.wp.imt.fr/mp4box/mp4box-documentation/ https://www.mankier.com/1/mp4box Split into files of about the same length (time): MP4Box -split 600 inputFile.mp4 # Into 10 minute segments Clip out MP4Box -splitx 60:120 inputFile.mp5 # from ~60 s to 120 s MP4Box -splitx 0:176 dandb_raw-20170211.mp4 # first 2:56 exactly "end" keyword means end time. N.b. MP4Box works with second integers, and automatically writes new filenames with these integers. Use constants "begin" and "end" in place of integers for those special values. -gp3 could possibly remove video track, resulting in conversion to mp3, but I don't know. Concatenation is DESTRUCTIVE. Appends the starting file in-place. MP4Box fileToAppendTO.mp4 -cat appendageFile.mp4 SLOWDOWN/SPEEDUP via ffmpeg http://www.bogotobogo.com/FFMpeg/ffmpeg_video_speed_up_slow_down.php The audio+video at same time from here fails for me: https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video Just do it in 2 pieces (video + audio) like this: ffmpeg -i dandb-20170211-bj_141.mp4 -vf 'setpts=2.0*PTS' tmp.mp4 ffmpeg -i tmp.mp4 -filter:a 'atempo=0.5' dandb-20170211-bj_322slo.mp4 For mp3 files can use mp3wrap and mp3splt but beware *WRAP*mp3 file contains extra non-portable stuff. Overlay with a colored rectangle: This is very low and makes HUGE output files. ffmpeg.exe -i in -vf "color=black:20x10 [over]; [in][over] overlay=5:5 [out]" out black may be a color code like #AABBCC Matroska (MKV) vs. MP4 MP4 generally better supported now, but MKV better supported for open source. MKV better longevity in future. MP4 is more efficient usually, more or less. MP4s need to be finalized before can be used. MKV winner! USB ports/connectors A is standard PC side; B is standard squarish printer type; mini B (squarish); micro (I think asymmetric), C (reversible) 2.0 vs 3.0 type A ports are indistinguishable. Must check MB/case manual.