text:
Is there a way to pause and resume FFmpeg encoding?
I record a few hours of video footage every day, which I set in queue for encoding with ffmpeg. I use the veryslow preset with x265, so a single hour of video may take up to 20 hours or more to encode.
Since my computer is working day and night, I'm wondering if ffmpeg has a way to pause and resume encoding? I'm using Terminal for OS X.
If so, can I also continue encoding even after shutting down Terminal and rebooting the computer? I think the Terminal session is restored when you log in again in OS X, at least the Terminal history is.

Suspend
A simple method is to suspend it with ctrl+z. Or you could get the PID with pgrep ffmpeg then use kill -s SIGSTOP <PID> to suspend.
Then resume with fg command or kill -s SIGCONT <PID>.
Unfortunately this will not survive a reboot.
VM
If you use a virtual machine, with something like VirtualBox, you could perform your encoding in a guest VM. It will allow you to "save the machine state" at any time which can survive a reboot. It can also allow you to assign max CPU resources for the guest so your host will always have available resources.
Possibly overkill, but if you're familiar with VMs or using one already it is a possible solution.

I love that VM solution, however, unless you're already using one it's a pretty big hassle.

The VirtualBox way didn't work for me. Tried just to save the state in mid-encoding, and tried to suspend by [Ctrl]+[z] and then save the state. After restoring the state and trying to resume, ffmpeg stops with an error (decode_band_types: Input buffer exhausted before END element found or Invalid NAL unit size and Error writing trailer / Protocol error). Maybe it's related to the jump in time, I don't know.

@JānisElmeris I can't seem to duplicate that issue. I tried it on Ubuntu 18.04 VM and it worked.

OK, I'm probably not lucky enough. :) Tried with a fresh Linux Mint 19.1 (based on Ubuntu 18.04) VirtualBox VM.

my ffmpeg has many threds and as many PID. Do I have to SIGSTOP and SIGCONT each of them? is there a timely constraint?

On Windows, pressing the "Pause/Break" key (the top-right most key) will pause it.  Enter will resume.
If it doesn't work, click on the command prompt window to give it focus.

This is the easiest and best answer for Windows (verified on Windows 10).

This frees up the cpu completely but the ram is still bottlenecked. In my case I have 8gb ram and it's using almost all of it still while the operation is paused. Any fix for that? Can I transfer this to the hdd or something? I don't mind a bit of a windup for things to get going when i unpause.

@kite Applications that run in Windows terminals are called TSRs, Terminate and Stay Resident. They allocate pieces of available system memory to reside in. Removing them from that memory allocation effectively stops the application. The only way to "save" a running app is to wrap it in some sort of memory manager that proxies the actual memory allocation. So, short answer, yes you can but it's not easy or simple in any form of the word(s).

@kite The native way to of transfering application memory to hard drive is to increase your virtual memory size. Windows will move allocated memory of inactive applications to swap file, effectively freeing up physical memory for other applications. If it's a common scenario for you, you can increase virtual memory size far beyond physical memory, but take in mind that in order to actually work without slowing down 10x, applications do need physical memory.

Do note that "selecting/marking text on the command prompt window to pause ffmpeg" won't work on the new Windows Terminal, and works only on the old conhost.

It didn't seem possible as of Sep 30 2015. I would suggest segmenting the source file, encoding the segments and then stitching the resultant files.
This isn't a true pause/resume facility but the piecemeal division will allow you to have a break from encoding.
A rough overview of the commands to issue:
Break the fullfile into parts
ffmpeg -i recording.mp4 -c copy -flags +global_header -segment_time n -f segment file%03d.mp4

This should create file000.mp4, file001.mp4 and so on. Because of how the segmenter works - it only cuts at I-frames - these files won't be exactly n seconds long and the video part may not play properly, but the data's all there and you can convert each of the parts e.g.
ffmpeg -i file001.mp4 -{filter/encoding parameters} -fflags +genpts file001-new.mp4

Rejoin the encoded parts
Create a text file and put in the name of each rendered file like this
file 'file000-new.mp4'
file 'file001-new.mp4'
....
file 'filelast-new.mp4'

And run
ffmpeg -f concat -i textfile -c copy -fflags +genpts recording-encoded.mp4

Having only 6GB memory, and an estimated time of 12h to enconde from x264 to x265 and having no no-break (desktop), I cant use the VM trick, but this sounds great! I just expect the rejoining step is fast, but as there  will have no encoding on it, I think it will be. Have to try it, thx vm!

it creates a warning when joining: "Codec for stream 0 does not use global headers but container format requires global headers" but the final result is a usable video, I saw no problems at all

I sugest instead of pausing, you give the encoding process the very least system priority (aka "renice"), so you can work daily comfortably and the encoding will take place in background with the unused system ressources. So your encoding will take place seamlessy 24/7 without interruptions, without conflicting with day work
as AFAIK OSX lacks the pidof command, you need to know the ffmpeg process number (PID)
then you can renice the process to idle background with
sudo renice 20 yourPID

if needed you can also renice the process to more agressive foreground priority
sudo renice -10 yourPID

Hi! Good suggestion. Will have to try it.

Much easier to just start the process with nice -19 ffmpeg ... to begin with, rather than renicing it later. I find this allows you to browse and perform other tasks nicely. And when your machine isn't doing anything else, encoding proceeds with no visible impact on performance/speed.

Suspending the Thread works on Windows too, not with ctrl + Z, but in the resource manager, you can also resume it there.

Places windows in hibernate will pause the job if you need to shut down your machine for awhile.

(This for Linux)
As you all probably know, pressing 'q' ends the recording file.
ffplay has the 'p'-possibility. Why doesn't ffmpeg have the same thing?
Maybe because it can lead to desync between video and audio?...
I just ffmpeg-encode to x264-aac-mkv with crf (23) and always with the same video conditions,
'quit' (q) the recordings and join all the segments in a specific dir, where this script resides,
 to 1 file in streamcopy mode with this bash-script:
#!/bin/bash

# FFMPEG MERGE

# File path must be absolutely absolute...

ffmpeg -f concat -safe 0 -i <(printf "file '%s'\n" /home/me/Videos/FFmpeg/FFmpeg_Merge/*.mkv) -c copy merged.mkv

exit

After that I check the resulting merged video and paste it to another dir.
The segments are removed from the merge dir.
But, a hasslefree 'Pause & Resume' button would be welcome indeed;)

In Windows...
Just click and drag to select some text from the CMD terminal, then you can see that the process has been "paused", so no CPU usage is registered until you hit "enter" on the terminal (that unpause the process)

This is just an idea, but if you have some budget, it'd be a good idea to upgrade either the processor (to 8th gen Intel) or even better, the video card (to NVIDIA GTX 1050 or above) so you can encode h.265/HEVC with hardware acceleration instead of CPU-intensive x265. Your video encoding will be finished in much less than 20 hours, saving you electricity costs too.

ffmpeg page on hwaccel says the quality of output from gpu may not be the same. just a warning


text:
What is a good workflow when using speedgrade and transitions and effects in Premiere Pro?
I want to try using speedgrade to get an overall cinematic look and I've heard that it is preferable to do speedgrade work before aadding any transitions or effects in PP. When I import from speedgrade to PP ( using an image sequence which I heard was the most typical/professional way to do it ) it has the sequence as a single clip in PP. What would I do at that point? Would I spit the single clip back into mutliple clips so I can add the transitions?

It might not be possible to do it that way.
The best way I'm familiar with is actually the other way around.

You start a project in Adobe Premiere Pro

Use the "Direct-Link" function to import your Premiere project into Speedgrade.

Now, all editorial changes from premiere will update into Speedgrade.
A lot of Speedgrade functions will disappear (raw debayering for instance)
That is because Premiere is now "the boss" over Speedgrade and you should change those in Premiere.

Sorry for the bad news, but this is the only way I know, how what you ask is possibe.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
What does an external video recorder like a Ninja offer?
According to the Ninja Website

Take your consumer camera to a truly Pro recording device. Avoid the internal MPEG compression & go from sub 30Mbps MPEG to 220Mbps ready to edit 10-bit 422 Apple ProRes HQ.

This External Recording article from Nikon states

Another useful optional accessory that is often used on more professional video productions is the external recorder. With an external recorder such as an Atomos Ninja attached to a Nikon HD-SLR, you can record a higher quality, uncompressed video signal from the camera directly to the external recorder via HDMI.

I'd like to understand what this means in layman terms? Will the image be sharper frame by frame? Is it like watching a higher FPS? Just more data to pull from when Grading? Is it useful on all video cameras or only high end ones?
If the final video is ultimately going to be uploaded to YouTube would it make a difference?

How much benefit it is also depends on what the camera is giving it. If it's getting raw 10 or 12 bit video out of the camera then that's a great benefit, but with a lot of DSLRs it just gets the 8-bit video, albeit uncompressed. This is better than h264 compressed video recorded to the card in the camera, but it might be cheaper to buy something like a Blackmagic camera that records raw natively.

If you record (typical AVCHD) sub-30 Mbps 4:2:0 video to a card and 220Mbps 4:2:2 video to an external recording device, you will be hard pressed to tell the difference when you view it back on YouTube.  Very, very hard pressed to tell the difference.
However, if you plan to edit the video--changing contrast curves, color, saturation, etc., and especially if you are trying to key any region (whether for green screen replacement or because you want to muck with certain color ranges in certain ways), or if you want to digitally zoom in a bit, then you are going to immediately notice a large difference in how the video behaves in your editing program.
What makes the low bit-rate recording work so well is that the compression algorithms are very smart about fooling our vision system, which is very easy to do.  But such smarts break down almost immediately as soon as you start treating the video as a series of images to be manipulated (which is how video editing programs ultimately "see" the video).  That's when you are going to wish you had recorded in a format that is more true to the digital workflow and less clever about how easy it is to fool our vision system.
If all you ever want to do are the simplest of cuts and fades, you can do that with low bit-rate video.  But if you want to push the image around more robustly, you will quickly realize the need for a higher bitrate solution, which is what the external recorders give you.

Succinct answer. But how much of the difference in keying would be reduced if the local recording was, say, 35 Mbps 4:2:2. I remember NTSC DV being worse for keying compared to PAL DV although both are 25 Mbps. Difference is former is 4:1:0 and the latter 4:2:0

I never played with DV, but I have spent a fair bit of time with AVCHD 4:2:0 vs. ProRes 4:2:2 vs. RED RAW (which is wavelet compressed).  Panasonic's VLog-L really shows just how limited is 8-bit 4:2:0 in terms of gradability, whereas 10-bit 4:2:2 is passable.  And neither is in the same league as a well-exposed RED DRAGON sensor recording RED RAW at 8:1 or better compression.

Keying is very dependant on the chroma subsampling, grading is more dependant on the bit depth. If you're recoding 4:2:0 your green channel is effectively ¼ the resolution of your picture so your keys are always going to be crappy.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
What gives a local TV news show that "look"?
I know little about filmmaking. I am trying to replicate the image of a generic local news show, which it seems my Canon DSLR is unable to do, since it blurs every area that is not in focus.
Local TV news has a different "look" than a standard Hollywood film, for example. I am not able to articulate the difference clearly, but with news shows, every part of the image is crisp; there is seemingly no out-of-focus areas.  I do not know the technical term for this. What is this difference that my eyes are picking up on?
What kind of video camera should I look for to achieve this "effect"? Like a general "type" of camera that shoots in this style, or specific standard camera models that news crews use (though I am guessing they are out of my budget, which is around $1000).
I assume that the camera and the camera alone creates this picture, but are there certain filmmaking techniques that I can use to do this with my current DSLR (so I don't have to buy another camera)?

Much of the difference stems from different lighting and the extensive post-grading that is done for movies. Also see my answer here. Then you'll want to use a narrow aperture to achieve maximum depth of field. Also, most modern news studios are virtual except for the anchor, so everything will be in focus anyway. If you want a more detailed answer, please post a screenshot so we can see what look you're trying to achieve

@MoritzLost -- "Most modern news studios are virtual except for the anchor, so everything will be in focus anyway." I don't think this is true. The only virtual section of a standard local news TV show is the weather, and I am not talking about the weather broadcast. How can you say local TV news studios are virtual when there are desks, set decorations, colorful background panels, and usually a flat-screen TV behind the anchors?

Yeah, most was probably a little disproportionate ... I guess it also depends highly on where you live. But there are studios that are mostly virtual, even the screen in the background and whatever else

The answer is both "light: lots and lots of light" and the imaging system.  But it is not f22 (which on most cameras would produce a surprisingly soft result due to diffraction limits).
The "light: lots and lots of light" is really about having not only good key and fill lights, but also lights above and behind the talent, creating a subtle rim of light around their figure.  In the literature this is known as three-point lighting, but it can be implemented with many more points of light, depending on taste.  It is true that studios are not shy about the absolute amount of light they use, but it is not only the absolute amount that does the magic--balancing key, fill, and rim lighting is just as important.
To get the deep depths of field, they don't stop lenses down to f22.  Rather, they have a 2/3rd inch sensor (approximately 1/2 the size of a m43 sensor, which in turn is 1/2 the size of FF35).  By using a sensor that's 1/4 the size of FF35, they get a depth of field that's effectively 4 f-stops deeper.  So, using an 12mm f4 lens on a 2/3" sensor has the effect of stopping down a 50mm lens down to f16 on a FF35 sensor, but without the problems caused by diffraction.
Additionally, studio-grade 2/3" cameras typically use a beam-splitter and three discrete sensors (R, G, and B).  Cameras that use a single monolithic CMOS sensor and Bayer patterns need a strong OLPF to deal with increased Moiré artifacts.  The OLPF cuts a certain amount of the high-frequency optical response we perceive as sharpness.
Finally, typical broadcast cameras have built-in sharpening that can be tuned to really make a properly illuminated subject really pop.  By combining studio lighting with a studio camera, you get a highly recognizable studio result.

"but without the problems caused by diffraction" – I'm not sure that that's not true. A 12 MP camera with a 2/3 sensor is diffraction-limited at f/4.3, but with a full-frame sensor it's at f/15.9. The angular resolution of the image that is projected by the lens onto the sensor is linearly proportional to the diameter of the aperture.

Mostly it's in the light: lots and lots of light. This allows the camera's iris to be as closed as possible, giving maximum depth of field. An image taken at f2 is going to have a tight focal plane, one taken at f22 will have a broad one. More sensitive cameras can get by with less light, and you can still have good, dramatic lighting effects, but the key is to get that iris dialed down.

You can achieve aspects of the news look with a cheap camera.
Small sensors will allow for a wide depth of field, where everything is in focus.
Frame rate is essential, news is shot in either 60 interlaced frames or 30 progressive frames.
So avoid large sensors and 24fps, which are the features filmmakers often want.


text:
Convert sRGB color to linear Color Space
Just wondering if there is a simple and fast way to convert a specific color from my Illustrator layout file (#e3000b) to a linear Color Space.
I am working in After Effects in a linear color space. When I add a new solid and enter my hex code for color, its not the same red as in my layout.
Thanks in advance

Using the calculator at http://davengrace.com/dave/cspace/,
Gamma-weighted #E3000B translates to linear sRGB #C50001

thank you very much, #C50001 is right! But the converter is some kind of confusing to me, where to you enter the rgb values to get the converted ones?

Convert your Hex to 0-255 range RGB at http://hex.colorrrs.com/ then input those RGB triplet values into the first row of the site in my answer. The converted values you want will show up on the third row. Multiply each of those values by 256. Round up (or down). Translate back to hex, if needed.


text:
Display multiple clips in DaVinci Resolve 12
I'm very new to DaVinci Resolve and I'm still trying to figure out what DaVinci Resolve is good at and for what effects I should use other software.
The result I want to achieve is to see multiple clips at the same time (in the render product, not only while editing). Each quarter of the screen should show another clip.
My approach is hardly satisfying:
To achieve that I tried to have a video in a video.
I resized the first clip and made it small. But that makes the rest of the screen black and I couldn't find out how make the black part transparent in order to show another resized clip.
There must be an easier way (though my approach should work, otherwise it wouldn't be possible to replace a green screen). Any suggestions?
BTW: Where can I learn such basic things? There must be a place to go.
Note: I'm aware of the split screen feature, but this is not what I was looking for (because it splits the screen only to let the user compare different color versions).

You are on The right track! There is not a specific effect to accomplish what you want to achieve.
The only way (unless there is a 3rd party plugin, I don't know about) is to stack the 4 clips on separate tracks in the edit tab. Select one of them open the inspector (panel on the top right of the edit page) scale down and adjust the placement.  The video clip on the video track below should become visible.
[Added by Michael Tiemann as a friendly amendment: In the panel where the scaling information is displayed, there are also parameters for the anchor point.  By default, images are scaled from the center, which means you have to add in X and Y offsets to get each clip going to each corner.  Instead, you can set the upper left anchor point to be the upper left corner of the video, the upper right to be the upper right, etc.  Then, when you scale, each video clip will retreat to its own corner.  If you want to animate this effect, you can have one clip expand from its corner and go fullscreen by scaling back to 100%, and you can return it to its corner by scaling down to 50%.]
Good luck.

Thanks. Maybe you can explain how to create that animation. I'm trying with key frames for Input Sizing (color page), but then the video tracks below won't show up.

Hi Sadik, Resolve has 4 sizing options on that tab.  Input sizing is meant to adjust the size of video coming into resolve. Output sizing is used to adjust whatever is going out of Resolve (entire timeline)  Node sizing only works on individual nodes. The one you are looking for is "edit sizing" it's in the same tab, but under a drop down menu. You can keyframe it and should be able to see any video on a track below it. Also I've heard that resolve 12 allows for more sexy animation through motionpaths. These should all be accessed in the edit page tlrather than the color page.

More information on these animation settings can be found in the user manual page: 438 (transform options) page: 448 (keyframing)


text:
Split PGS subtitles (.sup file)
I'd like to know if there is any method to split a PGS format subtitle pulled from a bluray as a .sup file.

it's not clear what is your goal. what do u mean by "split subtitles"

The sup file I have contains multiple episodes. I wish to split it into multiple sup files, each of which would contain a single episode.

Here is the structure of a .sup subtitle file and a link to the splitter I created. Information is either from linked reference or my own research.
The .sup subtitle splitter I created. http://forum.doom9.org/showthread.php?p=1737122
SupRip github page with sup related code. You can read more specifics about each section here that I don't discuss.
https://github.com/peterdk/SupRip/blob/master/Bluray%20Sup.txt
The hex 0x50 0x47 are headers for sections in the .sup file, however there are multiple sections per subtitle line. There is always (in my experience) a 0x16, 0x17, 0x14, 0x15, and 0x80 flagged section for displayed subtitles. There can be multiple 0x15 sections if the bitmap data is large. There are also "empty" subtitles which are used to end a subtitle which only have 0x16, 0x17, and 0x80 flags. Subtitles only have a start time and no end time or duration, so a subtitle is ended by the next subtitle starting. So if two subtitle lines are separated by a time period, a blank subtitle section is used to end the first subtitle.
Referencing the linked page these are the flags each header can have.
TIMES = 0x16
SIZE = 0x17
PALETTE = 0x14
BITMAP = 0x15
END = 0x80

Hopefully explaining everything with hex code of a full subtitle should help. I separated each of the sections and truncated the palette and bitmap sections.
Header structure, always 13 bytes long
50 47        start of header
00 01 E3 E0  time code
00 00 00 00  second time code (normally zero)
16           flag
00 13        data size

To get the time code to a usable form take the hex and convert to decimal, then multiple by 100,000 and divide by 9 to get nanoseconds.
0001e3e0 -> 123872 *100,000/9 = 137635555 ns = 1.37635555 sec
start of .sup file
1st subtitle

50 47 00 01 E3 E0 00 00 00 00 16 00 13 07 80 04 38 10 00 02 80 00 00 01 00 00 00 00 05 41 02 6F   Times section of subtitle, gives the start time of the subtitle

50 47 00 01 E3 34 00 00 00 00 17 00 13 02 00 05 41 02 6F 00 81 00 37 01 02 40 03 CB 03 04 00 46   Size section of subtitle

50 47 00 01 CD 04 00 00 00 00 14 01 47 00 00 00 ...       Palette section of subtitle

50 47 00 01 CD 2C 00 00 00 00 15 0C 68 00 00 00 ...      Bitmap section of subtitle

50 47 00 01 CD 2C 00 00 00 00 80 00 00     End section of subtitle, denotes the end of one subtitle

2nd subtitle (actually blank which ends 1st subtitle)

50 47 00 07 E7 80 00 00 00 00 16 00 0B 07 80 04 38 10 00 05 00 00 00 00   Times section of subtitle, gives the start time of the subtitle. Previous subtitle ends when this "subtitle" begins

50 47 00 07 E6 D4 00 00 00 00 17 00 13 02 00 05 41 02 6F 00 81 00 37 01 02 40 03 CB 03 04 00 46   Size section of subtitle

50 47 00 07 E6 D3 00 00 00 00 80 00 00      End section of subtitle, denotes the end of one subtitle

What is the "size" of a subtitle? the width? height? font size? Why can an empty/blank subtitle have a size?

If you are are referring to a section with the size flag 0x17. According to the linked reference this section holds position and size information and is either 10 or 19 bytes long. Since pgs subs are bitmap based this size and position should only be for how large and where the bitmap data is displayed on the screen.
I do not know why a blank pgs subtitle can have a size. I just know that is how some actual bluray subs have been formatted. The linked reference has more information on what kind of data the sections contain.


text:
x264 quality results based on source
If I was to compare a 720p video encoded (using x264) from an untouched 1080p Blu-ray rip with the same video encoded at a similar bitrate but from a 1080p x264 rip, which one is more likely to look better in terms of perceived quality?

If the 1080p encode has a high enough bitrate, one shouldn't notice a significant difference, else the BD source offers greater headroom to retain detail.

Isn't a double step doomed to a greater loss from the start?, one might doubt

Mathematically, yes. But your query concerns perceptual quality.  Run the command in this answer on both a 1st-generation and 2nd-generation encode to see how much difference you get.

A lower-than-optimal bitrate video with higher resolution could easily look worst than a smaller one with proper bit per pixel dedication. Of course a very important fact is the viewing device and condition. A smaller video should get upscaled to fill the screen, for example a 1280×720 will get upscaled in full-screen mode on a 1920×1080 screen.
So, in conclusion the perceptual quality highly depends also on other factors than the resolution only.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
What's the technical term for additional material at the start and end of a take?
When shooting footage, it's good practice to start a little earlier and end a little later than the actual action. That way, you get more freedom during editing. The same holds true for animated sequences or visual effects.
I'm sure there must be a technical term for that additional time at the start and end of a clip. I'd like to say 'this clip requires 5 frames [additional material at the start] and 10 frames [additional material at the end]'.
What's the term I'm missing? Googling didn't help.

I can't cite any authority, but the term I've used and heard most often is handles. It's not just used for live shots, but refers to any trimmable material that allows for transition points to be adjusted, etc. In your example I'd say "this clip requires 10-frame handles".

I have heard the term padding but don't know if it's a standardized term
From The Art of The Edit:

To allow time for a good transition, instruct your talent to fix a
  gaze on the camera for two seconds before and several seconds after a
  narration. A quick, sideways glance for approval, a swallow or a lick
  of the lips before or after speaking may be difficult to edit out.

May be confused with pre-roll

Be sure to allow for pre-roll. When you switch a camera from the stop
  mode to record, it rolls back several seconds before it achieves
  "speed" and begins taping. Allow five seconds, 10 to be safe, before
  cuing the talent to begin speaking or executing your shot.


text:
How do I drop certain amount of seconds in VirtualDub?
It seems the simplest thing you can do with video -- crop space or time dimensions. There is a video how to crop the spacial dimensions (although null transform filter does not seem to crop the selected region for me). Now, I want to drop first n seconds of my video. How do I do that with the notorious editor?

Cut and trim are the common terms for temporal cropping.

Move the timeline slider to the start point you want and set the Mark In point. The Mark In/Out buttons are to the left of the frame count display at the bottom.

Mark in point? Whatever. I have realized that what I need is called to cut a video and this is done using Edit -> Set selection.


text:
How to convert an mkv file with hevc encoding to mkv with avc
I have some mkv files with a hevc encoding which is not allowing me to burn to disc in covertxtodvd as it shows no video track as the encoding isn't supported, i was wondering if it was possible to convert the files encoding into avc encoding whilst keeping embedded subtitles and the same mkv format.
Thank you for reading,
Nick W

ffmpeg, a command-line tool, can do this:
ffmpeg -i input.mkv -c:v libx264 -crf 23 -c:a copy -c:s copy -fflags +genpts output.mkv

Adjust the CRF for larger or smaller size (lower number produces better quality but larger size)
Download ffmpeg (32-bit static version) from here.

thank you, i was also wondering if there is a command like this that allows me to keep dual audio streams?

If the source has dual audio streams, then the above command will keep them both.


text:
How to prevent users from downloading videos?
We want to provide VOD service via http/https, but we dont want users download a video by finding out the url directly from the web player or using a developer plugin like firebug.
We are told that only option for us is to implement DRM to protect video content.
Is it true that DRM is the only option?
If there are other options, please suggest it.
Any expert opinion is most welcome on this.
Thanks in advance.

I hope you get this direct-download issue solved.  I also want to point out that people can simply use screen-recording software (like Camtasia or even Snag-It) to record the video and audio as they watch it. The video quality will suffer slightly, but not by much. I don't think there is ANY way to prevent that!

@BrettFromLA thanks for the head up. we are aware of such activities, but not worried at all about it.

don't you think youtube would have found a solution to that by now?

@jiggunjer keepvid.com lets you download videos from YouTube. They didn't figure out a solution, apparently.

You could let people download the videos, but watermark every video with each user's name, so that you know  from whence leaks spring.  That, or reconsider your business model, because charging people for static content is a sinking ship.  Consider a service-oriented approach.

Unfortunately, no, that's the entire reason DRM exists.  It is a bit like trying to prevent someone from recording an on-air broadcast.  When you send video data over the internet to someone's player, they can simply store the information being sent to the player unless you obfuscate it and make it so that the player will only work under certain circumstances and will not share the data.  This, by definition, is DRM.
What DRM attempts to do is control the reading of the data entirely, so that it can not be copied.  This has varying degrees of success and rarely, if ever, works particularly well.  It may keep honest people honest, but if you are sending someone data in a way that they can access it, measures to try to stop them from copying it are... difficult.  The most advanced systems use special display drivers and encrypt the data right up to the point it is being displayed on the screen (HDCP), that way other software on the computer can't directly pull the information off the frame buffer being prepared for the screen.
There may be some ways you can mildly obfuscate the access to your video, but ultimately, if you send it in the clear, it is trivial for a knowledgeable viewer to store the datastream.  If you use DRM, it is substantially harder, but still likely to be able to be worked around by a dedicated attacker.

It is true that no security measure is ultimate. A determined attacker could break into any security system. Taking into consideration of normal users who are having average tech knowledge, I think DRM is the way to go. Thanks for the answer.

@user12305 - yes, but tools are created for people of average skill to bypass DRM.  I don't keep up to date on which systems are currently broken and to what level, but in general, DRM has a pretty horrible track record, though it's still better than just being unprotected if you need to try to keep it protected.  Just don't be surprised if it fails, especially if you go with poor quality DRM.

got it. would you be able to suggest any good quality DRM?

@user12305 - unfortunately not.  I don't keep up particularly closely on DRM technology and it is constantly changing as increasingly severe exploits are found to bypass them.

Another option is single use URL/access tokens. But this could get complicated if the browser uses range requests, which is almost certain. And even then the user could still get around that with enough motivation. DRM is the only really secure way.

Thanks for the input. We have already implemented expiring URL. but downside of it is that url is accessible for non logged in users until it expires. I guess that leaves DRM a better solution

We started using a Vimeo pro account. It has the ability embed a player in a web frame and (I think) prevent downloading. You can specify what domain(s) can load the video file. The dev working on the site was able to remove all the default Vimeo interface overlay elements. It'll go live soon. I'll post the link when it does.  I'd love to know if you guys/gals can obtain the file as we've tried to lock it up.

That's no protection. Do post the link.

This simply stops someone from sharing the URL. There's browser plugins that allow you to download the video when on the whitelisted website. As long as someone know the URL, DRM (encryption) is the only way to go.


text:
how to measure bitrate of video over time
Given an encoded video file with non-constant bitrate, how would one analyze the bitrate over time? So far I found one old program that produces a bitrate plot, but none that can give the raw data of the encoded frames.
I think bitrate data should be generated by averaging the size of a set of frames spanning 1 second--i.e. frames with a DTS belonging in that interval. So a 10 second video would have 10 data points describing the encoder input bitrate. Though I am curious to hear alternative ways of calculating bitrate.
Is there a way to get the size of each (encoded) frame? preferably with windows software. I know it is trivially easy for an uncompressed source (resolution * bitdepth * time).

Size of an encoded frame won't make sense for predicted frames. I'll supply an answer later in the day but basic way is to segment the video and then run ffprobe on each of the segments and output that data to a file.

oh good idea, I should have thought of that. Need more coffee.

Ah @Mulvya but when you segment the video into segments by keyframe you: 1) should not re-encode 2) need a source with (reasonably) homogeneously spaced keyframes

#1 is obviously true if you want to measure source bitrate. See answer for #2.

It does not make sense to speak of the size of an encoded frame in an inter-coded video stream, which is typical of MPEG-X videos. I-frames are self-contained but P- and B- frames are predicted frames and the final decoded result uses data from various inputs. On the other hand, the size of a single Group of Pictures (GOP) may be a meaningful measure.
The FFmpeg segmenter in combination with a compatible demuxer can break apart the video stream at GOP boundaries. By specifying an ultra-low time for segment size, you can ensure that each segment contains 1 GOP. Running a ffprobe on each segment will then provide the bitrate for that GOP.
I tested the command below on MP4s which had 1) a variable-sized GOP, 2) an intra-coded scheme and 3) fixed GOP of unusual length (11 frames), and each output had the expected result.
ffmpeg -i input.mp4 -an -c:v copy -segment_time 0.00001 -f segment i%0d.mp4

Each segment contained exactly 1 I-frame (each segment of the intra input contained exactly 1 frame in all).
Running ffprobe on each segment gives a bitrate reading:
Duration: 00:00:00.37, start: 4.466016, bitrate: 1539 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], 1520 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)

The above one is from the 11-frame GOP, and has a bitrate of 1520 kbps.

so if you have 1 source with GOPs of 1-2 seconds and other GOPs of around 250 milliseconds, your resulting plot would have erratic datapoints on the timeline. What would be a good work-around for that case? I suppose I'd group the GOPs into larger bins, i.e. average over 3-5 GOPs.

Just plot data rate (Y) vs Start Time (X) instead of duration. The Y remains unchanged from its Start till the next segment's Start time. If you want to get rid of the step function look, there will be some smoothing/interpolation function in your plotting s/w.


text:
Automatically generate videos from template
I need to create a number of videos from a template - they will have an image background, and then 1-4 separate videos appearing over the top. Something like this:

The catch - these videos will need to be automatically generated in some way by a server.
Is there some software out there that will spit out video files according to a template like this?
I'd need a way to set the background image, as well as the number and position of the overlay videos.
This will ideally be done on a Windows server, but I can use other operating systems if need be.

A script that generates a custom ffmpeg command based on inputs provided could do this. You'd need to construct a filter complex with scale/crop filters for each video and multiple overlay filters with time conditions for the compositing. If you're willing to learn and trial it out, grab the Win static binaries here and start with some basic guides.

Thanks - I've found a very similar request over on StackOverflow which gives me a starting point. http://stackoverflow.com/questions/13390714/superimposing-two-videos-onto-a-static-image


text:
Can I clean up Premiere Pro CS6 preview files like this?
I did a test with a small Premiere Pro CS6 project and discovered that for each change I made to an effect Premiere generated a completely new preview file and stored that alongside the old file ( which was apparently trash at this point )
Eg I did a rotation change and rendered a section and it created a preview file. I repeated this process and it made a second file. I would have expected it to overwrite the original because when I deleted all the preview files and generated a new preview it only ended up with a single preview file ( seemingly the same file as the last created ) — so I'm concluding that it would never use the previous 4 files yet it didn't delete them or give me an option to.
The reason I did this is that the preview files folder in my main project is 15GB in size; and I'm assuming much of this is trash based on the above. So I moved it out of the project folder pending deletion and generated a new set of preview files for the project, which which came out around 8Gb - and it seems to work fine.
My questions is:
Is there any problem with this method of regaining space other than it takes time to regenerated the preview. I mainly am curious because I haven't seen a reference to this technique anywhere; and also because I wonder why Adobe didn't add a button to purge and regenerate preview files (at least that I've seen) since it's fairly straightforward and reclaims back so much space.

You can delete Render files by going:
Sequence > Delete Render Files
Or by using third-party programs.


text:
How can I record audio with the USB mic and record with the camera without having to sync them?
I want to start making some YouTube videos, but I want to work with what I have for the moment, to see how it goes and learn using them for a while.
So I have a Behringer C1-U microphone and a Samsung NX1000 mirrorless camera. Is it possible to connect them both to the pc and record video and audio at the same time?

I don't think Samsung NX1000 can stream video to PC. So you can't "connect them both to the pc and record". You shall record first, and only then copy footage on the PC.
However some cameras have audio jacks inputs, to connect external microphone to them. And your Samsung NX1000 have one. But your microphone don't have audio jack output, so it outputs only digital signal. And your DSLR can receive only analog signal. So it is impossible to connect your microphone to your DSLR directly.
You need computer to convert digital signal to analog, and then connect it to your DSLR. It can be achieved with some kind of microcomputer like Raspberry Pi. Or, if you going to record only near your PC, you can plug your mic into PC, and then connect your PC's audio output to your DSLR's audio input. Maybe some settings on the PC should be adjusted for this to work properly. But it depends on your operating system.
After recording, do not forget to copy files from your DSLR to your PC.
Good Luck!


text:
Can FFmpeg output time duration since the start of a job?
Is there a way for FFmpeg to output or log time duration since a particular job/process was started?
I know that there are more or less complicated ways to display a progress bar which really seems more like a programmatical problem.
The reasoning is that I want to measure how long time my encoding jobs take (without having to set up a separate timer).

In Linux you can use the time command:
$ time ffmpeg -i input.avi output.mp4
  [...]
  real  0m1.927s
  user  0m7.067s
  sys   0m0.243s

This example took 1.927 seconds to complete.

or you can use ffmpeg -benchmark -i
Show benchmarking information at the end of an encode. Shows CPU time used and maximum memory consumption. Maximum memory consumption is not supported on all systems, it will usually display as 0 if not supported.

Use -benchmark.
You will see something like bench: utime=11.969s stime=0.315s rtime=1.908s, the rtime is what you want.

How do you use this command? I tired ffmpeg.exe -i input.ts -benchmark output.mp4 AS WELL AS ffmpeg.exe -i input.ts output.mp4 -benchmark, non worked

If you use the -report option, ffmpeg will create a logfile at initialization and the filename will contain the time at which it was created. You can use the last modified time of the log file to get the completion time, and thus the duration. On Windows, you could just check the creation time of the output as well.
Addendum: A rough way to get this information, universally, without altering the command or using a monitoring tool like time, as LN guided, is to note the encoding speed normally reported i.e. speed=5.50x. So, if the duration of the output file is 110 seconds, then time taken to encode is 110 / 5.5 = 20 seconds.


text:
How to show audio keyframes in Adobe Premiere CC?
How to show audio keyframes in Adobe Premiere CC?
Show Audio Keyframes option is ON although I can't see any keyframes on the timeline.
I am sure, keyframes are there, since volume controls change in Audio Clip Mixer as I move play head.

You need to expand the track to be large enough to see the waveforms and overlaid keyframes.  Mouse over the horizontal line that divides A2 from A3, drag downward, and your waveforms and keyframes should be revealed.
If you right-click in the waveform area, you have the option as to which keyframes it will display in the window.  By default it's Volume:Level, but it could be Panner:Balance (or others).

Oh man, I just spent an hour Googling, and all of the results on various forums were nonsense because they neglected to first say "expand the track to be large enough to see...".  Thank you!

I also found this to be helpful: To edit audio keyframes to create a fade, click the Pen icon in the toolbar. Create two keyframes, and then drag them. https://www.youtube.com/watch?v=zAoZSCXSfHs


text:
How to select multiple keyframes in Premiere?
I had accidentally created numerous wrong keyframes, trying to tune volume. Now I would like to delete them. Unfortunately, I can't select multiple keyframes by mouse:

When I release mouse, all keyrames remain not selected.

You can do it in the Effects Control window:

Even if keyframes were added on the timeline, it will work.
Good luck!


text:
Is it possible to create a continuously looping video?
Is is possible to create a continuously looping video? Maybe by editing the container it's in so that it restarts automatically?
I have a demonstration video that is playing on a TV in the lobby of our offices. The video is being played by the the smart functionality of the TV. The TV unfortunately doesn't include any kind of looping capability. My current solution has been to concat the video so it is one longer video but it would be nice to not have to go and restart the video every hour.
The file format that can be played is fairly flexible.

Not aware of a video file format which can encode that info (and more importantly, a player that can execute it). How about a media player with repeat function, like this one: http://www.asus.com/us/Home-Entertainment/OPlay_Mini/ ?

Some players will just loop if they reach the end of the content, yours doesn't appear to. Some players will only loop if the content is called "CONTINUE LOOP.AVI" It might be a long shot but worth a go...

I make similar videos for our corporate reception, interstate and overseas offices, events, conferences and presentations etc. The answer is to look outside the video file itself and focus on the application that is playing the file - you want the application to loop the video file playback.
An alternative approach that works on some devices is to embed the single instance of the video file in a PDF and set the playback preferences of the PDF viewer to loop.

You could use something like the raspberry pi zero for this.
https://www.raspberrypi.org/blog/raspberry-pi-zero/
It costs £4 and has an HDMI Output that feeds into most TVs. Using https://osmc.tv/ (formerly  raspbmc) you could loop a video file forever and have it boot automatically when it powers up

If you have the option to embed the video in a simple webpage you could use the HTML5 video player loop option:
<video loop="loop"></video>

Use a DVD authoring program. For example, Adobe Encore to create a VOB (MPEG2) DVD file. Most media players recognize this format. In the authoring software, you can make the movie autoloop, so the movie will always loop even after you shut down the system and restart it.

You can save it and open it with movies and tv, then select the 3 dots toolbar in the lower right corner and you should see a option called repeat!

You need to give some more info in your answer. You should probably mention that this solution is limited to Windows 8 & 10.

Similarly, if you upload to Youtube and as it's playing, right click and choose loop.
Needs to be done for each launch b

Band aid solution - when it's playing in Quicktime, go to 'view' and you can loop it from there. It'll loop for as long as the file is open, albeit with a minor 'hiccup' at the end of the loop.

The OP is using a smart TV, not quicktime.  I'm not sure how this is going to help them.


text:
Desaturate shadows in Lightworks
I'm using Lightworks as my main video editor (I use Blender occasionally), and use it to color grade too. I want to desaturate my shadows using either Lightworks or Blender, but I can't find that tool. Is it there, and if it's not, is it on something else I can use on my Linux system (not Resolve, needs very specific hardware i can't afford)? LUTs that do this are an option too!
Thnx ahead :)

In Lightworks, there's the selective color correction tool.
By moving the sliders like this you can select the shadows (luma slider) and desaturate them:

By  clicking "Reveal" you can see which parts of the image are going to be changed.
With much thanks to the guys at the Lightworks forum.
Source: Lightworks forum: Desaturate shadows

Neither Lightworks nor Blender really offer any coloring functionality advanced enough to do that natively. However, Davinci Resolve is a free program which has very advanced color grading functionality which will allow you to easily desaturate shadows. It also isn't that complicated of a program. It can be difficult to understand all the ins and outs, but basic functions are very intuitive.

As stated in my question, resolve is not an option for me because I'm on a linux system and the free version is only for Mac and Windows


text:
How to limit file size with ffmpeg?
I want to encode a video, that has a length of 60 seconds, to a target or maximum size of 10 MB.
There are two approaches I know of. One is explained in the FFMPEG-Wiki, and the other one I found in the documentation. Unfortunately, I haven't found an explanation on when to use what method.
Is any of those methods recommended? If not, what are the upsides/downsides of each method?
1) Calculate and set Bitrate to match the length of the video as explained in the ffmpeg-wiki

(10 MB * 8192 [converts MB to kilobits]) / 60 seconds = ~1365 kbits/s total bitrate
  1365k - 128k (desired audio bitrate) = 1237k video bitrate

ffmpeg -y -i input -c:v copy -preset medium -b:v 1237k -pass 1 -c:a copy -b:a 128k -f mp4 /dev/null && \
ffmpeg -i input -c:v libx264 -preset medium -b:v 1237k -pass 2 -c:a libfdk_aac -b:a 128k output.mp4

2) Use the -fs parameter and let ffmpeg figure it out.
ffmpeg -i input -c:v copy -c:a copy -preset medium -crf 23 -fs 10485760 output.mp4

In your 1st example, the first step should also use libx264 as c:v. In the fs example, you aren't transcoding the video, since -c:v copy is used. So, the preset and crf also don't have any effect.

This was helpful for me: https://stackoverflow.com/a/34547102/470749

The fs parameter will stop the encode once it hits its value. So, if the output hits the 10MB mark while encoding the 15th second, then that's the duration of your output file.
If you want to make sure that the entire file is encoded but it doesn't cross the set target size, then use the bitrate method. To accommodate the muxing overhead and other data within the target size, set your video bitrate slightly lower by, say, 1-2%


text:
Why does editing a video by Adobe Premiere Pro more than once decreases its quality?
For example: On first edit, I decreased the speed of video and saved it. Then again I imported it and made some other changes, like brightness adjustment, and saved. When I check the final file, the quality of video is decreased. Why does it happen? Is there any way to fix this?

There is a big difference between

saving your project, then returning to the project to do some additional changes, such as brightness adjustments, then exporting a media file, and
exporting a media file from your project, importing the result into a new project, doing some additional changes, such as brightness adjustments, then exporting the result of that to create yet another media file.

In the case of (1), you are working with your original source media, which is pretty much as good as it gets in terms of input quality.  In the case of (2), if you export a compressed file (and virtually every playable media file is a compressed version of the originals, which may also be compressed), then you are working with a second generation of quality.  While you may not immediately perceive that the second generation file is not quite as good as your original masters, compression errors and noise accumulates every time through the cycle.
One way around this problem is to only ever export in uncompressed file formats.  But this is not practical, as uncompressed 1080p video is 2.98Gbps (compared that to your typical AVCHD codec that is limited to 28Mbps, about 100x less).
The practical way around this problem is to return to the project that created your first media export.  In that project, add the brightness correction you want as an additional correction, export using the original sources, and then you will have media quality that's as good as your original export, with the color quality you were hoping to achieve with your second export.


text:
Mask "shadow" showing up in the middle of the scene
Ok, I've got a question which is pretty hard to explain.
I'm using Premiere Pro CC to produce a short movie.
Here's a picture describing (or at least trying to) my set:

"A" is the main track. "B" is the second track which I placed in the bottom right corner and "C" is an opacity mask on that track. On this track I've used Ultra Key to remove the background. I've also added a Cross Dissolve effect on "B".
So here's the problem. During the cross dissolve the mask ("C") shows in the middle of screen ("D").
Is this a bug or am I doing something wrong? How do I remove "D"?
Thanks!

During the time range in which the dissolve occurs, split the clip on A, place that segment on a track above B, and apply a mask on A so that C shows through. You can do this by creating a mask to show the C region and then invert it.


text:
VHS to digital, flickering, lack of video and good sound
I'm trying to convert some VHS videos into digital.
To do so, I got the VGB100 from August and connected it to the VHS player and to my computer.
I've used two applications to capture video:

Arcsoft Showbiz
VirtualDub

Both of them get the same input.
Most of the time the image doesn't even show but when it does, it is a very flickery image in general and from time to time you can see the image more or less good.

I've tried it with the most recent VHS cassettes I have (spiderman 1, Toy Story 1...) and I get the same result with all of them.

Do you think the problem is in the VHS cassettes?
Or in the VHS player?
Or in the SCART cable / output / cable?
Or even on the VGB100 device?

Can you connect the VHS to a TV?

If you are using old VHS player, then its head can be dirty
Also VHS cassettes' tape can be dirty, but how I understand you using new cassettes.
So, try to connect your VHS player to TV. If signal will be the same, you need to locate that thing:

And clean it and head (black thing on background to the left)
You can do it by yourself or maybe there still exist place in the world, where professionals can do it for you.

I connected it to the TV and it worked perfectly. It seems the device VGB100 from August just doesn't work properly. I'll return it. Thanks for your answer!

It's because these are commercially duplicated VHS tapes and have copy guard encoded in the video signal. It prevents copying as you have discovered.
The giveaway are the white bars in the vertical interval that I can see in your screen grab.
There's no way around it short of using a time base corrector or frame synchronizer.
They are on eBay though I am not encouraging you to copy the protected intellectual property.

What do you mean by "commercially duplicated VHS"? It is not a commercial VHS. It was a blank VHS used for personal purposes. And I was able to solve the problem by using an analog camera to pass the content into it. And from it to the computer.


text:
Combining Hdmi video with composite audii
I have a setup with a videocamera in a chapel and an audio amplifier. The output of the camera is HDMI. The output of the audio is composite (red and White).
Next I have streamer with HDMI input that streams that input over the network to a headend.
Inbetween those two the camera hdmi output needs to be combined with the audio into one hdmi output.
With what hardware can this be done (low cost)? Thanks for your feedback!

Something like that should work:
http://www.ebay.co.uk/itm/Premium-HDMI-DVI-Audio-Combiner-With-HDMI-Repeater-Function-/311215250396


text:
After Effects: How do I add a Marker onto a layer?
how do I add a Marker onto a layer in case I have no numpad?
Thanks in advance

Select Layer. Then from the top menu:
Layer => Add Marker
Or if you want to do it from your keyboard you can modify shortcuts using this article.

By default Ctrl+8 will add a marker. If you have a region selected then the market will be applied to that region. If nothing is selected, the marker is applied to the comp's timeline at the top.
https://helpx.adobe.com/after-effects/using/keyboard-shortcuts-reference.html


text:
What exactly do eggcrates do to light?
What exactly do eggcrates do to lighting? What is the benefit over adding an eggcrate to a diffuser?

Here is a video that shows a series of effects from no Egg Crates® to 60°, 50°, 40°, 30°, and finally 20°.
The answer is that up to a certain ratio of subject size and distance from the lighting source, Egg Crates make a light source more directional (harder shadows) while also allowing you to maintain a larger source (which offers the benefits of diffusion within the beam spread range).  Beyond a certain ratio (i.e., a small subject far away from the light source), Egg Crates have no meaningful effect because the subject fits entirely within the clear aperture of every cell in the matrix.  In that case the Egg Crate's only function is to reduce the overall lighting intensity just the same way a scrim does.
Another way to think about the effect is to imagine that each cell gives you a mini light source that has a certain beam spread angle.  A single, 2" light source with a 20° beam spread gives a light cone that is D*tan 20° + 2" where D is distance to the subject from the light source.  At 5' (60"), that computes to about 22", but it also has a lot of falloff from the center of its beam (fully illuminated) to its edge (dark because all light eventually eclipsed).  Now imagine that the 22" light circle is subdivided into an 11x11 grid of 2" squares at the subject.  Across the north-south and also east-west axis, the squares go from least illuminated (at the edge) to most illuminated (in the center) and back again, because the square in the center gets fully un-eclipsed light, whereas each square away from the center "sees" an increasingly eclipsed source.  Squares that are within the 11x11 grid but outside the radius of the 11-grid diameter circle are completely un-illuminated because they are fully eclipsed.  If you then created an 11x11 grid of 2" sources at the source, each square around the center would add its percentage of light to each square within the original 11x11 grid defined for the subject area, and the sum of all those squares is--equally illuminated within the 11x11 grid.  Around that 11x11 grid at the subject will be a fall-off pattern that is linear along the edges and circular at the corners.  A 48"x48" Egg Crate gives a 48"x48" area of even illumination 60" away, again with linear fall-off along its longer edges and quadradic fall-off around its farther-out corners.

Excellent answer.  Wish I could +2 it.


text:
After Effects: Shortcut for showing all transforming properties of a layer
just wondering if there is a shortcut in after effects to reveal all transforming properties (scale, position, opacity, etc.) of a selected layer at once?

Some shortcuts depend on the language and your keyboard layout.
For a german layout it's: Ctrl+Ü.

However concatenating the shortcuts always works.
For Scale, Position and Opacity press S, Shift+P and Shift+T.

There's 3 options:
Ctrl+` for Toggle expansion of selected layers to show all properties
UU for Show only modified properties
U for Show only properties with keyframes or expressions

Mhh. Ctrl + does not work here... Also I can't find it in the menu.

It's Ctrl + grave (key above Tab / below Esc).


text:
ffmpeg: pillarbox 4:3 to 16:9
I'm confusing myself over how the video filters work, particularly how they work together, I think.  I have two MKVs, pulled from DVD, that are respectively 16:9 and 4:3.  What I would like to do is ultimately combine them (mkvmerge widescreen.mkv + fullscreen.mkv) and to do that I need matching display aspect ratios.
So I would like to pillarbox the 4:3 video as I encode it, and then hopefully append it to the 16:9 video.  I've tried a number of filters to accomplish this, and the closest I was able to get was a slightly wider than expected video, otherwise pillarboxed properly.
ffmpeg -i fullscreen.mkv 4:3 -vf "pad=853:480:66:0,scale=720x480,setdar=16:9" [etc.]

The pixel dimensions are 720x480, the display dimensions are 853x480, and the two MKVs can be successfully merged (after reencoding the widescreen.mkv to the same video codec, but without video filters).
However, the resulting display of the fullscreen video is pillarboxed, yet slightly horizontally stretched.  In 1:1 pixels it measures 720px across, not 640.
I figure I'm doing the math wrong, or misunderstanding how the filters are supposed to operate, or something simple, but my understanding of ffmpeg video filters is basically nothing.

Assuming both MKVs are rips of NTSC DVDs, these are the commands you need:
For 4:3 video
ffmpeg -i "input43.mkv" -vf "scale=640x480,setsar=1,pad=854:480:107:0" [etc..]

For 16:9 video
ffmpeg -i "input169.mkv" -vf "scale=854x480,setsar=1" [etc..]

(Note H.264, the codec you are likely using, needs dimensions to be even, so specifying 853 as width will lead to ffmpeg feeding 854 pixels to the encoder and then auto-setting a funky SAR.


text:
Can video be composited for live streaming?
I was watching a Twitch.TV stream of a panel of announcers discussing eSports live, and while all of the graphics, sets, backgrounds, lighting looked great, I thought it would be nice if the raw video of the announcers was also processed with composite editing, for a surreal, polished film effect. But I'm not sure: Can a video be composited fast enough to be streamed live, and are there tools capable of doing this?

The answer is yes, video can be composited fast enough to be streamed live.  The tool that does this is called a switcher.  Typically a switcher introduces a single frame delay from input to composited output.  By connecting the output to a streaming encoder, you can stream out your live, composited video.
For an example, see the Blackmagic Design ATEM System.

You can also do it with software, for example Wirecast.


text:
Convert MTS AVCHD files into a more sharable format, such as mp4
I was using a Sony Alpha series camera which created avchd files, which are videos, and the file format is .mts
I am wondering programs are people using to convert these without compromising on quality? Looking for something very user friendly and one click.
I noticed iMovie isn't equipped to handle these files, and I do have After Effects and Premiere at my disposal, but those are the opposite of what I am looking for.
I've seen programs on Google but I am curious what you are using and why
'Free AVCHD to Mov' does not work for the Sony A7s II movie files on my Mac

Lightroom provides a one-click export function from MTS to Mp4 that works very well. Unfortunately it is a lot slower than ffmpeg and other copy-wrapper solutions, because Lightroom appears to be re-encoding instead of just copying streams out of the MTS wrapper into an MP4 wrapper. For the record I couldn't get any of the copy-wrapper solutions to work using AVCHD footage from a Sony A7sII.
Lightroom also has the capability to stack the new video overtop of the original file, so that it doesn't look like there are duplicates in the catalog. This is pretty ideal for me.

I used ffmpeg (https://en.wikipedia.org/wiki/FFmpeg, http://ffmpeg.org/) to exchange the container format while keeping the original video and audio data. You can also use it to transcode the video, but many of the stream formats work in other container formats as well, so the -vcodec copy -acodec copy parameters will keep the original quality. I used something like
ffmpeg -i movie.mts -acodec copy -vcodec copy movie.mp4

(untested, I don't have access to the computer I use for video work at the moment). With
ffmpeg -i movie.mts

you will get more details on the stream formats in your file and you can then decide what to do with them.
I even had to use it to copy to the same container (mpeg transport stream format) with sony files since the original files caused other software to become slow, what did not happen with the new but same container.
Ffmpeg is a command line tool and it is very user friendly (especially, it provides you with a lot of information about your files) and when you have found the best parameters for your case then it will become a 1-click solution since you can re-use the command on all your files.

Since the OP seems to be using a Mac, they can use a snapshot binary from https://evermeet.cx/ffmpeg/

hmm, anything with a GUI and how would i extend that to a batch process?

I have no idea about a GUI but to batch process all files in a folder, you could e.g. use a for loop. for i in *.mts; do ffmpeg -i $i -acodec copy -vcodec copy \basename $i .mts`.mp4; done` on most shells (syntax may differ depending on the shell used; untested again, just to illustrate the principle).

I get these errors http://pastebin.com/CKGGSGC4  , a file of comparable size is created in .mp4 format, but it is not sendable in iMessage or compatible like Apple .mp4s are.

I do not use apple computers, so I have no idea about the software you are using. Are you able to play the file? Maybe in vlc? If not, you could provide a sample file (of the unconverted source file) such that others can check if it works for them.

@Chris okay maybe I will later, its just Sony A7s II avchd files, one of the default settings. So I am wondering what other people are doing

Lightroom exports them perfectly into mp4, and stacks the file with the other original file, so it doesn't look like there are duplicates in the catalogue.

Ttry this ffmpeg command:
ffmpeg -i input.mts -c copy -fflags +genpts -flags +global_header output.m4v

This command, and Chris' resulted in a jerky output video, in the players that would play them (Quicktime is what I tried)

Is your source video interlaced? If it is, there's a way around that. Paste mediainfo probe of the file. Use View -> Text mode


text:
ffmpeg streaming to rtmp and extracting image periodically
I'm using this command to receive a input stream and transcode it to a different resolution and stream it to ustream.
ffmpeg -hide_banner -loglevel info -progress /tmp/ffmpeg.log -i udp://10.0.0.150:8181?listen \
-framerate 30 -video_size 1080x720 -vcodec libx264 -b:v 768k -crf 23 -preset medium -maxrate 800k -bufsize 800k \
-vf "scale=640:-1,format=yuv420p" -g 60 -c:a aac -strict -3 -ar 44100 -ab 32k -f flv rtmp://<ustream url>/<ustream key>

I also want to extract a full quality snapshot every 1 minute. I read here how I can extract a thumbnail from a video periodically and I read this explaining how to send one input stream to different output streams with different video filters.
When I combined the two commands I ended up with this:
ffmpeg -hide_banner -loglevel info -progress /tmp/ffmpeg.log -i udp://10.0.0.150:8181?listen -filter_complex '[0]split=2[in1][in2];[in1]scale=640:-1,format=yuv420p[out1];[in2]fps=1/60[out2]' \
-map '[out1]' -framerate 30 -video_size 1080x720 -vcodec libx264 -b:v 768k -crf 23 -preset medium -maxrate 800k -bufsize 800k -g 60 -c:a aac -strict -3 -ar 44100 -ab 32k -f flv rtmp://<ustream url>/<ustream key> \
-map '[out2]' img%03d.jpg

The command almost works, but the audio is missing on the livestream. The images are created correctly and the video is fine but there is no audio. How can I also get audio in my livestream?

Try
ffmpeg -hide_banner -loglevel info -progress /tmp/ffmpeg.log -i udp://10.0.0.150:8181?listen -filter_complex '[0:v]split=2[in1][in2];[in1]scale=640:-1,format=yuv420p[out1];[in2]fps=1/60[out2]' \
-map '[out1]' -map 0:a -framerate 30 -video_size 1080x720 -vcodec libx264 -b:v 768k -crf 23 -preset medium -maxrate 800k -bufsize 800k -g 60 -c:a aac -strict -3 -ar 44100 -ab 32k -f flv rtmp://<ustream url>/<ustream key> \
-map '[out2]' img%03d.jpg

"Output with label '0:a' does not exist in any defined filter graph, or was used elsewhere"

Try revised command.


text:
cloud backup routines
I am looking for cloud backup or remote backup routines and practices that may be used for storing video.
Specifically if services or practices that offer versioning are relevant. If so, why or why not? Any examples of services you use will also be appreciated

I've used Backblaze for this. I understand that CrashPlan Pro and other similar services work in the same way. Basically, you install the software (free download), do some setup, and then it just runs in the background. Every time you create a new file or modify an existing one, it will (at some later point when there's less activity on your system) just back it up to the cloud. You can usually configure it to constrain how much bandwidth it uses, which folders you do and don't want backed up, and maybe even when backups occur. And if you have a very large initial backup, they'll even send you a hard drive to back it up to. You send it back once the backup has occurred. From then on, it's incremental over the internet.

I'm not allowed to comment on the first post, so I'll put my comment here... I agree, pretty much all the crashplan/backblaze/etc... services do what you're looking for. I personally use SpiderOak for privacy reasons, but there are lots of options in this area.
If you want to roll your own (open source), you can go with something like Amanda (http://www.amanda.org/) or Bacula (http://www.bacula.org/) and send those backups to some cloud based service of your choice.

my main thing is how external harddrives are backed up, and how deleting my local copy for space is maintained. It looks like CrashPlan is the route for me.


text:
Does DVD support non-interlaced formats (576p)?
I have an old VHS homevideo that has been converted to DVD (PAL-576i) in a photo-shop.
I have decided to add some menus and edit some things in Premiere Pro CC/Encore and maybe convert the aspect ratio from 4:3 to 16:9 (by adding black bars in the sides) since it probably will be shown on widescreen hdtv's before burning copies to the rest of the family.
Since I will be working on it, I thought i might as well try to remove scan-lines by de-interlacing it in the process, to improve viewing on non-CRT displays.
I know some DVD-players have progressive scan capabilities, but some doesn't and I don't know which type of player will be playing the dvd.
So... I guess my question is:

"Will it make any sense to de-interlace/re-encode the video to 576p,
  or will the dvd-players not care at all?"

Here is a file analysis output of one of the .vob files
 ***** Analyzed File Results *****

*** General Parameters ***
- Name:  VTS_01_1.VOB
- Container:  Mpeg Program Stream
- Creation Date:  2006-01-01 01.00.00
- Size:  1
- Duration:  10s 753ms
- Bitrate:  798 Mbps
- Fast start:  Not available
- Encoding Library:  Undefined
- Encoding Application:  Undefined

*** Video Track Parameters ***
- Format:  MPEG-2 Video
- Size:  1
- FourCC:  0x10000002
- Track number(s):  0
- Bitrate:  Max.: 9 282 Kbps
    Average: 782 Mbps
    Min.: ---
- Frame rate (fps):  Max.: Undefined
    Average: 25.000
    Min.: Undefined
- Bitrate mode:  Variable
- Encoding profile:  Main@Main
- Resolution:  Undefined
- Width (Pixel number):  720
- Height (Pixel number):  576
- Pixel Aspect Ratio:  Undefined
- Display Aspect Ratio:  4:3
- Chroma subsampling format:  YUV 4:2:0
- Standard:  PAL
- Interlacing:  Interlaced - Top Field First
- Encoding library:  Undefined
- Additional Parameters:  BVOP: Yes
    Matrix: Custom
    GOP: M=3
    Bits/(Pixel*Frame) ratio: 75.438

*** Audio Track(s) Parameters ***
*** Audio Track #1
- Format:  AC3-A52
- Size:  499,7 KB (0%)
- FourCC:  0x2000
- Number(s) and language(s):  189 (0xBD)-128 (0x80): Undefined
- Details:  Undefined
- Profile:  Undefined
- Bitrate:  384 Kbps
- Bitrate mode:  Constant
- Resolution:  16 bits
- Rate:  48.0 KHz
- Channel(s):  2 (stereo)
- Position:  Front: L R
- Encoding Library:  Undefined
- Additional Parameters:  Not available

I had this issue come up a few months ago, and what I found out was that the video stream frames, irrespective of source properties (field or full frames), are stored as field pairs in authored VOBs, although the scan mode and order is correctly noted in the metadata for benefit of players.
I've had multiple DVDs of progressive source accepted by Amazon Createspace. So you can go ahead and deinterlace.

Great. I haven't done this before and wouldn't waste my time researching how to do it, if the dvd-player wouldn't care anyway. Thanks.


text:
iMovie- drawing?
We have some movie, in which we would like to draw live on . So for example, you see an object in the movie, then a circle is being drawn around it , and a few small images jumps out of it.
Can this be done with iMovie ? something like picture in picture effect with the movie and some images ? or should we make the animation separately ?
I know iMovie has this frame by frame effect , but for this to work we would need to have many parts of a circle, then run them frame by frame to the movie- which seems problematic.
Then if we create the animation outside of a movie editor, it wouldn't be transparent - like around an object .
Whats the simplest way ?

This answer in the Graphic Design forum explains how to make an image background transparent in either of two ways.  If you have an animation you have captured (perhaps by screen-casting your drawing session into a series of images), you can use an image editing tool that can do batch processing, such as The GIMP, to create the transparency type most appropriate for your particular scenario.

There is a way to draw in iMovie all you need is a video of a line drawing and then iMovie will do the rest!
See if you put it on green/blue screen you can make the video transparent!
And it will still be a movie, I made my own movie on keynote! It is better if the movie has a different color background then the drawing because iMovie will just erase everything!


text:
Does having hardware encoding chip help?
I've been googling for a while now so I finally decided to ask others as well as I'm pretty darn confused.
I'm looking to be able to stream at 1080p at 60fps ( from a gaming laptop, it's more than capable, running actual game at 300fps uncapped ). I know about ShadowPlay and it's fairly easy to use but it's annoying how it automatically changes my stream's title and the quality is pretty bad even at best settings.
Then, I have found the Live Gamer Extreme which has 1080p at 60fps recording and hdmi passthrough, but it doesn't have h.264 encoding chip so I'm receiving RAW data in OBS ( there are cards that have hardware encoding chips already but those don't do 60fps as far as I can see )
So, does having a h.264 encoding chip help in any way ?
Because I'd like doing the whole thing on one laptop and not having to use two laptops one for gaming and one for encoding would be great.
In OBS's Encoding tab I can't find any option like No encoding needed since the signal is already encoded, so, should I look anymore for 60fps w/ encoding chip or should I go with this game capturing card and use the other laptop for encoding.
Thanks in advance !

A hardware encoder will produce video with less CPU usage. However, it will require a higher bitrate to achieve the same quality image.

I'm not familiar with that specific device, but I can answer a resounding YES to the question of "does having a dedicated h264 encoding chip help?". With a proper hardware device you can either let it run totally solo (preconfigured with settings and then just connected to the network) or you can connect it to your laptop to command and control it, but it will not use any of your machine's cpu for encoding.

While this is true, video quality is ALWAYS be worse at a given bitrate using a hardware encoder than a good software implementation such as x264

What do you mean? Let's say the hardware encoder is using x264, if you compared that to a software implementation of x264 at the same bitrate, the quality should be identical.
I often use both hardware and software based h264 encoders, and if I use the same setup, the quality is exactly the same for me.

This is false. first, there is no such thing as hardware x264. x264 is the name of a specific implementation of an h264 encoder. Some encoders can produce better quality than others at a fixed bitrate. In fact x264 can produces better/worse than itself by changing the preset and trading more CPU time for extra quality. At high bitrates the difference may not be noticeable. But a low bitrates, it is very obvious.

I don't want to argue with you, this isn't helping the thread. The question asked was a specific question: He wants to use a single machine to game at very high qualities, while simultaneously streaming out a 1080p 60fps live feed. A hardware based encoder is pretty much the only way I can see to make this happen with one laptop, would you agree? Bringing in raw video and encoding it in software (even with the best ever x264 config in the world) will crush his cpu and leave nothing for the game.

You are correct here. What you are missing is that he want to send high quality video at a low bitrate. It is obvious that the OP is streaming to Twitch. Twitch has a soft cap of 3.5Mbps. 1080@60 3.5Mbps will look terrible on a hardware encoder. It may be passable using x264. So, yes, hardware will help the CPU/game, but it will hurt the video stream.

Agreed on that quality assessment. I know this isn't what he asked, but if it is Twitch, then forget the 1080@60 ... Just do a 720 @ 1.5m, and use software. His machine should be able to handle the game and the video encode no problem, and without having to purchase and use a separate dedicated hardware encoder.


text:
Exporting a video from Premiere spits out incorrect quality
I'm trying to export a video from Premiere(CC) with the following settings:

I recorded this video in Motion-JPEG 1080p/60Fps out of Bandicam. I've recorded videos in Bandicam (same settings as mentioned) and edited said videos in Premiere, and exported those videos with the same problem. I only noticed the issue just now.
The only difference in my export settings in Premiere this time, is that I decided to use 60Mbps target, as previous exports have been in the 20-40 range.
When my file had finished rendering I checked the bitrate and file size, and was shocked to discover Windows 7 telling me that it was 12Mbps and 3GB, despite Premiere's target being 60Mbps and estimated 11.5GB.
Looking at my previous video that was 40Mbps Windows is showing an actual bitrate of 8Mbps. My current video took about an hour to render, yet only has a measly 12Mbps.
Why is this happening and what can I do to prevent it/get full quality?

How is the video quality?

60 Mb/s is way overkill for 1080p video, even at 60 fps ... note that you set the target bitrate, not the average bitrate. Probably Premiere reduced the bitrate because a higher one wouldn't have yielded any better results. Why would you need a bitrate that high anyway?
Also, as @Mulvya mentioned, look at the video and compare the actual video quality ...

The video does look okay, but I'd still prefer maximum quality. I do think that 60Mbps is a bit high, but I don't want anything less than perfect.
Perhaps I should just be exporting in raw lossless format or something.

If you want lossless, use a lossless code. 'Perfect' does imply that this is what you want - lossy codecs such as H264 are by definition not perfect; they discard information to reduce file size. However, with bitrates that high, the amount of discarded information becomes so small that you won't see much of a difference. So if you can't spot any artifacts (on a good monitor), I would say you have your maximum quality ;-)

I exported another video with much more motion (video game) and exported at 60Mbps, Premiere spit out 60Mbps. Guess I assumed that targeting 60Mbps wouldn't go as low as 12.

When you export with h.264 in Premiere it has two bars as you show. A target bitrate, and a maximum bitrate.
The target bitrate is after all, only a target, and if your video doesn't have enough movement or fast action then you won't get the full Mbps that you've set. Even lowering it enough to only export 12Mbps because your video doesn't have a lot of movement.
Exporting a video with more movement will yield 60Mbps or more, depending on your settings.

You should not look at target bitrate as one you should hit. You set the quality you want, and it will come out with the bitrate that works for that quality. A lower number than your target is excellent!


text:
Video size for my home header
i would like to buy a footage video for my home header page, but i don't know what is the good size to have a good rendering and not a too long loading.
Web 640x360 25 fps Photo-JPEG
Web 640x360 25 fps H.264
SD 720x486 29.97 fps NTSC
SD 720x576 25 fps PAL
HD 1280x720 25p Photo-JPEG
thanks !

Go for the HD 1280x720 and get it compressed using Handbrake or ffmpeg or similar to H.264 video in MP4.


text:
Macro Videography: Lenses, Camera Options
I do some video of miniatures and I'm looking to upgrade my Canon T2i. A lot of the functionality for good macro videography has to do with the lens, but higher resolution helps as well so one can digitally punch in in post.
It seems for the $1-2k range, there are three cameras dominating the video market:

Panasonic GH4 - Lower price, records 4k internally
Sony A7S - Superior low light
BMCC 2.5k - Records RAW internally

Considering my use case (miniature videography + talking head), it would seem that the GH4 is the best option simply for the higher resolution and cost. Does anyone else find this to be the case? Also, anyone have any favorite macro lens for photography or videography?
Thanks!

You are absolutely correct that a good macro lens is crucial for a specialty such as shooting miniatures.  You are also correct that cropping into a 4K source to get an HD frame will still give you good video quality.  And it's also true that a RAW image format like BMCC is somewhat forgiving of not only cropping in, but zooming in to some extent.  But I would also caution that once you actually start zooming into consumer-grade digital video, it falls apart way, way faster than when you zoom into typical stills photos.  Since the SONY cannot record 4K natively, but only with an expensive external recorder, and you've set a budget ceiling of $2K, that means no zooming with the SONY.
I have three Canon macro lenses that are each great at what they do: the 100mm f2.8L, which is the simplest to use, the 180mm f3.5L, which is better for shooting nature (more working distance), and the 65mm f2.8 Macro Explorer, which shoots between 1:1 and 5:1 magnifications (great for bugs and other tiny, tiny details).  I don't use my Canon lenses on my GH4 (I also have a RED WEAPON with a Canon mount), but to answer your question, I'd pick the 100mm macro with a speed booster (not for f2.0 performance, but for field of view) and a GH4.  And I'd make great use of my K*FLect light reflector system to light my tabletop scenes.

Great info. Thanks so much. What's difference between cropping in and zooming in? You mean literally zooming in with a camera lens/moving the camera forward? How does a RAW format help that?

Two-part answer.  Part 1: If you have a UHD source image (3840x2160) and you select a sub-image that's at least 1920x1080, then you have at least one (and as many as four) source pixels per output pixel at FullHD resolution (1080p).  I.e., you crop the image and then further scale down.  However, if you crop in further (for example, a 1280x720 sub-image) and then you need to scale it up to 1920x1080, then you are zooming in, not cropping.

Part 2: When you shoot RAW, each source pixel is its own thing.  When zooming into such pixels, it can be filtered (blurred) to look somewhat natural so even when you have one source pixel trying to do the work of four image pixels, it doesn't look stupidly blocky.  However, if your pixel is part of a macroblock, its value is correlated with its neighbors not only in the source space, but in the compression space, and when one of those pixels has to be scaled up, the filters tend to highlight the shape of the macroblock, not the source image details.


text:
Make only a specific region of a video blurry
I have a lower third that  I want to use in adobe premiere. It's slightly transparent and I put an adjustment layer on top to add a bit of blur. When I add some footage to the after effects composition it looks correctly blurred. The problem is when I export it that blur doesn't apply to the footage in Premiere (not even when I import it using dynamic link). Is there a way to make the blur apply to the footage without having to import the entire edited project from Premiere into After Effects? I don't use AE much and I'd hate to keep paying for it only for that one thing.

Did you tried to make pre-comp?

In premiere is the lower third on a separate track from the footage?

In your Premiere timeline put two copies of the lower third above each other on top of the footage. Right click on the lower copy and choose Adjustment Layer from the context menu. Now it acts as a mask for any filters you apply to it, affecting only the opaque areas. Apply a blur effect to this adjustment layer and the footage below will blur where the lower third is opaque.

Now because adjustment layers use the opacity of the clip to set the strength of the effect you might find the blur won't be very strong where the lower third is semi opaque (this is what it looks like with the top layer turned off):

You can fix this by making a duplicate of your lower third in After Effects with a more opaque background, and using that as your adjustment layer:

And Voila! Your beautiful lower third with bg blur:


text:
Fast forward the timelapse vedio clip
I created a timelapse video from iMovie software and set the time to 0.1 second for every image. But the final output is not satisfying. It seems a bit slow video. I need the clouds to move faster, but they are moving slowly. It is total of 30 second video. I need it to be 15 second video, so that I can get a desired effect. But I cannot change the setting lower then 0.1 second in iMovie. Any suggestions?

I have used the below link as reference: youtube.com/watch?v=dPlEAFyGznE

Can you remove every alternate image?

@Mulvya: I need that clip to be HD, with more fps.

How does removing images change frame size (HD)? What's the fps of your current output?

@Mulvya: I think it's 720fps right now. Though I'm not sure of it. I tried this for the first time. and above I've posted the youtube link from where I've done it.

It won't be 720fps. The resolution will be 720p i.e. 720 pixels tall, and usually 1280 pixels wide. That tutorial uses a project of 30 fps.

In iMovie you can change the speed of a clip by selecting it in the timeline and then clicking on the icon that looks like a speedometer:

Then click on the "Speed:" popup menu and choose "Fast" or "Custom". The "Custom" setting lets you choose how much faster to make it (like 200%, or 50%).

Thanks a lot, it worked like a charm. But to me it gives maximum to double the speed. So I tried to do that process 3 times. Now, I have a 9 second video clip (that's amazing, and exactly what I thought of). Thanks again.

You can use ffmpeg, a command line program, to double the video speed:
ffmpeg -i input.mp4 -vf setpts=0.5*PTS output.mp4


text:
Scroll text left to right and back
I am using this line which works fine for showing text in 3 lines starting at 0.3sec, ending at 0.6 sec. in bottom left corner.
I would like to add scroll in and scroll out effect in ffmpeg.
Both in and out should be fast, lets say .05sec.
Scroll in should end in position like its written in code, remaining there for those 3 sec, then scrolling out.
ffmpeg -i scrollin.mp4 -vf "[in]drawtext=enable='between(t,3,6)':fontsize=50:fontcolor=Green:fontfile='ariblk.ttf':text='textline1':x=10:y=h-th-130, drawtext=enable='between(t,3,6)':fontsize=50:fontcolor=White:fontfile='ariblk.ttf':text='textline2':x=10:y=h-th-75, drawtext=enable='between(t,3,6)':fontsize=50:fontcolor=White:fontfile='ariblk.ttf':text='textline3':x=10:y=h-th-20[out]" -codec:a copy scrollout.mp4

Use this filter expression:
"drawtext=enable='between(t,2.5,6.5)':fontsize=50:fontcolor=Green:fontfile='ariblk.ttf': \
text='textline1':x=min(4*(tw\+10)-(abs(4-2*(t-2.5)))*(tw+10)-tw\,10):y=h-th-130"

The above is for the first line. I've changed the values/expression for the enable and xparameters. The movement starts at 2.5 seconds, settles at 3s, stays till 6s and then disappears by 6.5

This worked perfectly :) Added the expression to all lines. Now i am trying to add drawbox that should go under text like from http://video.stackexchange.com/questions/15551/ffmpeg-drawtext-filter-create-transparent-background-with-text but when i add the expression i get error "too many inputs specified for the "drawtext" filter. Maybe i write this problem to new question ?

Yes, make it a new question and include the full command you're using.

Here it is: http://video.stackexchange.com/questions/17522/add-transparent-background-to-ffmpeg-with-text-over-it

Sorry, miscklicked !


text:
Output format and quality to be same as input
Have many videos different videos of different format and quality in which i need to add small amount of text.
What command should i use to get same file format/quality for output as it was for input ?

What are the different formats you have?

.mpg and .mp4. What other data you need ? All are prepared for broadcasting, but some are made long time ago. Visually there is huge difference betwean old and new ones. I do not mind that as long as after i export them, their quality wont be lower then input. Will be broadcasted on cable TV.

Since these are for broadcast play-out over local storage, these commands are biased towards quality and away from filesize.
For MP4s:
ffmpeg -i input.mp4 -vf "text filters here" -c:v libx264 -crf 8 -c:a copy -map 0 -movflags +faststart output.mp4

For MPGs:
ffmpeg -i input.mpg -vf "text filters here" -c:v mpeg2video -q:v 2 -c:a copy -map 0 output.mpg

I have moved comments to chat as it was getting too verbose.  The old chat is also here.


text:
How to avoid uploaded video being re-encode by Facebook
I just uploaded a video to Facebook yesterday, and then I tried to download the video as HD, and I realized that Facebook actually re-encode the video even though the original video file doesn't rendered with high bitrate or super HD option.
Original video

File size: 50 Mb
  Length: ~3 mins
  Bitrate: 2 Mbps
  Resolution: 1280x720
  Frame rate: 25 fps
  Reference frame: 8
  Level: 4
  Audio bitrate: 128 Kbps

Uploaded video

File size: 20 Mb
  Length: ~3 mins
  Bitrate: 750 Kbps
  Resolution: 1280x720
  Frame rate: 25 fps
  Reference frame: 5
  Level: 3.1
  Audio bitrate: 48 Kbps

As you can see there's a big loss of quality in the uploaded video. How can I avoid Facebook leave my video untouched? Or it will re-encode the video no matter how small the file size is?

You can't avoid that (see the answer by @Mulvya). What you can do however is to upload your video to an external video hosting platform and link to it on facebook. For example, with a vimeo plus or pro account you can offer the user to download the original video file uploaded by you.

You can't avoid the re-encode. They do this to be sure that every video they serve is in a standardized format, resolution and bitrate. It would be inefficient and risky to vet all diverse set of incoming files to check if they meet all their parameters, some of which are not easily available to set or tweak at the user's end.


text:
Exporting in Premiere from mpg 720 to h.264 1920
What do i gain / does it make sense to export video that is originally loaded in Premiere as:
mpg 720x576 /25fps / 7000kbps
to
h.264 1920x1080 / 25fps / 12000kbs target (15000 max) ?
I am just adding lower third for few sec, no other modifications of the video.

No. I assume your 720x576 video uses anamorphic pixels, making for a 16:9 resolution. Still, there is no added benefit to the higher resolution, as it won't increase the quality of your video. On the other hand, your video file will be much larger. Export in your original resolution with a high bitrate instead (not higher than your source material though). If you need to export an uncompressed copy, use a visually lossless codec such as DNxHD or Apple ProRes.
That is, assuming by 'loaded into Premiere' you mean this is the resolution of your source material. If you are referring to your sequence and your source material actually has a higher resolution, create a new sequence with the respective settings, copy everything from your current sequence to the new one and export that using the same resolution as your source video.

Ok. I have data rate of 12000kbps, and total bitrate of 12384kbs. Which one should i aim ?

@BigBrother2010  The total bit rate includes all streams -- like audio. The video data rate is 12000kbps, that's what you aim to reduce, although you should apply the same logic to any audio streams: don't bother exceeding the original specs. Plus, a given bit rate at .h264 can outperform that same rate in mpeg2, so odds are 7Mbps is more than sufficient.


text:
How to get 'outer' composition's current time?
Suppose I've got 2 sequences, one named OUTER and one named INNER. Composition INNER is inside composition OUTER. INNER is shorter than OUTER and is placed in the middle of it's timeline. Inside INNER there is a text object which I want to display OUTER's current time - but I found out this is not so straightforward as I thought. My first idea was to create a solid namer TIMER inside OUTER and link the INNER's text object 'Source Text' to comp("OUTER").layer("TIMER").time and despite that this layer lasts from the beginning to the end of OUTER, the text shown from OUTER's perspective is always starting with 0.0 when INNER starts.
For the sake of clarity, here is the pic:
Is there a proper way to get linked composition's current time?

What happens if you change the expression on the Inner text layer to comp("outer").time?

nah, that doesn't work. The time property seems to belon to layers, not to comps. Weird.

If you change the inner text layer's source text to this it will work:
thisCompLayer = comp("outer").layer(thisComp.name);
thisCompLayer.time + thisCompLayer.startTime

You just offset the time to cope with the later start time.
Looks like when AE calculates values from another composition it just calculates them for the current comp's time. It makes sense, because there could be multiple copies, or no copies at all of the inner comp in the outer comp.

It works! Thank you so much, it will make my day so much easier.


text:
Stop video (something like a screenshot) in Hitfilm 3 Express
I am new in any kind of video cutting programs. I started using Hitfilm 3 Express, becuase it's free and simple to use, I think. I'm wondering if and how it is possible to make a video stop for as example 5 seconds, show up a text (to explain something) and then let the video go on. Currently im doing this by splitting the video in two parts, make a screenshot of the scene i want and then insert this screenshot between the two videoparts.

The usual way to do this is with a speed effect.  Create a cut around the one frame you want to render as a still.  Your timeline should look like this:
motion-before | single frame | motion-after

You can then place a speed effect on the single frame, slow it down to 0% playback speed, and it will happily play forever if you want.  Stretch single frame to 5 seconds of length (120 frames at 24fps) and then composite your text on top.
People do this all the time.  Some applications have a "freeze frame effect" which is precisely setting the speed to zero for a default number of seconds.