text:
How can I accurately immitate this Picasa filter with Premiere's color correction filters?
I'm trying to color-correct a video I'm working on. This is an example frame from the footage:

Since I'm a newbie and pretty clueless about good-looking color correction, I've tried playing around with some Picasa filters. Eventually I've came out with this:

This supposed to be a reference for me to later on immitate with Premire's color correction tools.
In Premiere, I've tried using Levels:

And RGB curves:

And this is the result:

After a lot of small adjusments, still you can see a big difference:

My main problem is that whenever I'm fixing one color, or one area of the frame, always another part is affected in a non-wanted way. For example you can see the wall in the Picasa version is more yellow than the one in the Premiere version, but the left-hand closet is less yellow than the one in the Premiere version. Meaning making the whole thing more yellow might fix the wall's shade but make the closet's shade worse.
My question is, what method should I use while using these filters (or others) in order to achieve a known effect? Is there a specific filter I should use before or after another? Or how could I determine the proper adjusment for affecting one color/shade but leaving another as it is?
This is important to me not only for this specific project, but also because I assume this method is what professional editors use when trying to achieve a specific vision they have for a frame.

Do you particularly like the the color grade you accomplished with picasa? Did that achieve something artistically and cinematographically that you were going for?

Which filter in Picasa did you apply, and with which parameters?

This might be better suited as a comment to your original post, but alas I do not yet have those privilegies.
Anyway, my answer to you would be a cliché one: Keep tinkering.
It's really a matter of finding out what effects Premiere can offer, deciding which will be able to assist you the most and then going back and forth between them until you find a result that pleases you.
That said, you might want to check out the Color Balance effect. I find it very useful in most projects.

If your goal is to get better at coloring.. yes keep tinkering. If you want a push button possibility download try SpeedGrade and try some of the preset "Looks". Ultimately, for any auto correction to look exactly like the Picasa one would be a piece of chance.
I am by no means a color guru, but I found these resources helpful in some recent projects:

Some quick basics

Kind-of Concept Overview but interesting

Color Correction Tutorials


text:
ffmpeg - Draw a box and scale its size with time
I need to draw a box that grows in size horizontally over a video (scaling its width as time goes by)
Since drawbox does not support the 't' (as in time) variable, I'm at a loss here. I've seen some solutions using overlay, but they are fixed width and are rather used to move the box around.
What's the workaround here?
EDIT
This is where I got trying to use drawbox and scale:
ffmpeg -y -i c81e728d9d4c2f636f067f89cc14862c.mp4\
  -filter_complex "\
[0:v]drawbox=0:0:20:20,scale=eval=frame:w='if(gte(t*20,600),600,t*20)':h=20[vb];
 [0:v][vb]overlay=x=80:y=350" a.mp4

With this I get an error of:
[Parsed_scale_1 @ 0x5596b5c61e40] Error when evaluating the expression 'if(gte(t*20,600),600,t*20)'.
Maybe the expression for out_w:'if(gte(t*20,600),600,t*20)' or for out_h:'20' is self-referencing.

Now, if I set the width to a fixed value, it runs, but then there's the problem that the overlay contains the whole video itself as it is the input of the drawbox filter. I'm not sure how to draw the box and scale it separately from the source video.

Use the scale filter after drawing the box. See https://ffmpeg.org/ffmpeg-filters.html#scale-1

Hi, thanks for the hints. I'm still unable to make it work, I'm quite a noob with ffmpeg still. I've updated my answer, it would be awesome if you could take a look at it! Thanks again

Ok, first upgrade ffmpeg to a current git version from https://johnvansickle.com/ffmpeg/. Then use the color filter to generate a stream with the initial size that you want. Then use scale to resize it. Finally overlay.

Is it only me or, is the reference documentation for drawing in ffmpeg very well hidden out there?

Thanks to @Gyan comments I've been able to come up with this solution, in case somebody else is interested:
color=c=red:size=1920x1080,
scale=eval=frame:w='if(gte(t*20,600),600,t*20)':h=20[cl];
[input][cl]overlay=x=0:y=0[finalOutput]

Just note that it is important that you download a current git version of ffmpeg because, from what I understood, previous ones do not support the 't' variable in the scale filter.

What would it take for a mere mortal to learn the syntax involved in this drawing technique? could you possibly point me in the right direction? Is there similar syntax for circles and for anti-aliased shapes?

Unfortunately ffmpeg syntax is quite convoluted, this question is from 1 year ago and I already forgot almost everything so can't answer your question directly. What can I say is that it requires a lot of trial and error and a lot of reading of this page here: https://ffmpeg.org/ffmpeg-filters.html

source: Stack Exchange

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

sort: votes


text:
Good free m2ts to mp4 converter?
I'd like to convert some AVCHD footage (.m2ts) to mp4 files. Can anybody here recommend a good converter (preferably free) that'll do a good job?

FFmpeg should be able to do this - assuming you don't mind getting down with the command line (there may be some GUI options out there too possibly).
My Olympus E-P3 produces .MTS files - I assume they're similar (AVC/AC3 in a Blu-Ray Video wrapper).
I ran the following command:
    ffmpeg -i 00001.MTS -vcodec copy -acodec copy -f mp4 00001.mp4
That just tells FFmpeg to copy the video and audio streams but put them in a new mp4 format (the -f option).
The resultant mp4 still has the same AVC/AC3 combination but now in a MP4 wrapper.
I played both source and output in VLC and they looked the same - obviously you should satisfy yourself that quality has been maintained.
I'll wager that most GUI tools to do this task use FFmpeg under the hood.

For Mac, there is a very simple and efficient solution that results in no loss of quality whatsoever, however it does require you to install some software.

Install the clipgrap app. This contains the necessary codecs required for step 2. You don't have to use the app again, and I just left it in the 'Utilities' folder in 'Applications.'
Download the 'Rewrap2M4V' file from this page. Put it on your desktop.
Now drag and drop your M2TS file onto the Automator icon of the file you just downloaded. An MP4 file will be created in the directory of the M2TS file.

Basically, the automator script changes the wrapper on the file from the awkward Panasonic one to a more friendly MP4. You can now edit or do whatever you wish with it.
The advantage of this solution is that it does not hinder quality through conversion as many converters do. It does not affect the actual file content itself. It is also very quick.

Alistair - thanks for that. Unfortunately I'm on Windows - any comparable solution?

I believe Media Converter can do this using one of the Re-Wrap AVCHD for Quicktime presets. Not sure what format you want your audio in, but one of them is PCM uncompressed. I've just modified the preset to AAC for my own purposes though.

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


text:
Extract streams from WebM
I hope my question fits the theme of this SE.
Is there any software that can extract streams from WebM videos? I don't want to convert (re-compress), I want the streams intact. Thanks.

It's close to off-topic, but I think there are enough legitimate uses for this in a studio/production context (which is what the site is really about) for it to be on-topic here.

Quote: "Since WebM is a Matroska subset, mkvtoolnix should let you demux the files. It's open source, cross platform, and the author provides binaries for Windows."
Source: https://superuser.com/questions/412890/lossless-extraction-of-streams-from-webm

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


text:
ffmpeg - burning in subtitles with non-square pixels
I've got a 16:9 standard-def movie into which I need to burn some subtitles. I'm using
 ffmpeg -y -i input.mov -vf ass="./captions.ass" output.mov

and in the subtitle.ass file I've tried
PlayResX: 1024
PlayResY: 576

and
PlayResX: 768
PlayResY: 576

But in both cases the subtitles came out stretched. Is there anything I can do to get them square—either with the ffmpeg command or the subtitle file? I'd rather not stretch the video twice, it's already looking a bit shabby.
Command and console output:
PS C:\Users\stib\Desktop> ffmpeg -i .\test.mov -vf "ass='./test_subs.ass'" test_out.mp4
ffmpeg version N-76144-ge91cd8a Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  4.100 / 55.  4.100
  libavcodec     57.  7.100 / 57.  7.100
  libavformat    57.  8.102 / 57.  8.102
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 12.100 /  6. 12.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\test.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2014-05-07 03:24:23
  Duration: 00:01:50.84, start: 0.000000, bitrate: 30340 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p(bt470bg/smpte170m/bt709), 720x576 [SAR 64:45 DAR 16:9], 28800 kb/s, SAR 118:81 DAR 295:162, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2014-05-07 03:24:23
      handler_name    : Apple Alias Data Handler
      encoder         : DV - PAL
      timecode        : 01:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2014-05-07 03:24:23
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2014-05-07 03:24:34
      handler_name    : Apple Alias Data Handler
      timecode        : 01:00:00:00
[Parsed_ass_0 @ 0000000002f61880] Shaper: FriBidi 0.19.6 (SIMPLE)
[Parsed_ass_0 @ 0000000002f61880] Using font provider directwrite
[Parsed_ass_0 @ 0000000002f61880] Added subtitle file: './test_subs.ass' (2 styles, 34 events)
[libx264 @ 0000000002f50cc0] using SAR=118/81
[libx264 @ 0000000002f50cc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0000000002f50cc0] profile High, level 3.0
[libx264 @ 0000000002f50cc0] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test_out.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    encoder         : Lavf57.8.102
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x576 [SAR 118:81 DAR 295:162], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2014-05-07 03:24:23
      handler_name    : Apple Alias Data Handler
      timecode        : 01:00:00:00
      encoder         : Lavc57.7.100 libx264
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
    Metadata:
      creation_time   : 2014-05-07 03:24:23
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc57.7.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (dvvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
[Parsed_ass_0 @ 0000000002f61880] fontselect: (Univers Com 55 Roman, 400, 0) -> UniversCom-55Roman, 0, UniversCom-55Roman
frame= 2771 fps=345 q=-1.0 Lsize=    8949kB time=00:01:50.85 bitrate= 661.3kbits/s
video:7133kB audio:1733kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.944520%
[libx264 @ 0000000002f50cc0] frame I:12    Avg QP:20.94  size: 50712
[libx264 @ 0000000002f50cc0] frame P:789   Avg QP:23.41  size:  6548
[libx264 @ 0000000002f50cc0] frame B:1970  Avg QP:26.27  size:   776
[libx264 @ 0000000002f50cc0] consecutive B-frames:  1.3%  5.5% 19.1% 74.2%
[libx264 @ 0000000002f50cc0] mb I  I16..4: 13.0% 72.4% 14.6%
[libx264 @ 0000000002f50cc0] mb P  I16..4:  1.0%  2.2%  0.4%  P16..4: 31.9%  9.3%  7.5%  0.0%  0.0%    skip:47.7%
[libx264 @ 0000000002f50cc0] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8: 21.4%  0.9%  0.2%  direct: 0.4%  skip:76.9%  L0:41.3% L1:54.7% BI: 4.0%
[libx264 @ 0000000002f50cc0] 8x8 transform intra:64.5% inter:75.4%
[libx264 @ 0000000002f50cc0] coded y,uvDC,uvAC intra: 66.4% 69.9% 34.2% inter: 5.9% 10.1% 0.9%
[libx264 @ 0000000002f50cc0] i16 v,h,dc,p: 18% 65%  3% 14%
[libx264 @ 0000000002f50cc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 18% 22%  4%  4%  6%  4%  5%  6%
[libx264 @ 0000000002f50cc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 26% 11%  4%  5%  8%  5%  5%  5%
[libx264 @ 0000000002f50cc0] i8c dc,h,v,p: 42% 25% 28%  5%
[libx264 @ 0000000002f50cc0] Weighted P-Frames: Y:2.3% UV:2.3%
[libx264 @ 0000000002f50cc0] ref P L0: 55.6% 13.1% 21.8%  9.5%  0.0%
[libx264 @ 0000000002f50cc0] ref B L0: 82.5% 13.7%  3.8%
[libx264 @ 0000000002f50cc0] ref B L1: 92.9%  7.1%
[libx264 @ 0000000002f50cc0] kb/s:527.13

ASS file:
[Script Info]
ScriptType: v4.00+
PlayResX: 1024
PlayResY: 576

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, BorderStyle, Outline, Shadow, Alignment, MarginL, Margi nR, MarginV, AlphaLevel, Encoding
Style: Default,Univers Com 55 Roman,36,&Hffffff,&Hffffff,&H0,&H0,0,0,0,1,2,0,2,10,10,16,0,0

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.54,0:00:04.70,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:04.70,0:00:06.96,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:06.96,0:00:11.78,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:11.78,0:00:14.81,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:14.81,0:00:17.39,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:17.39,0:00:20.60,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:20.60,0:00:25.22,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:25.22,0:00:30.31,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:30.31,0:00:34.48,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:34.48,0:00:37.11,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:37.11,0:00:41.28,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:41.28,0:00:45.14,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:45.14,0:00:49.98,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:49.98,0:00:53.79,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:53.79,0:00:54.97,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:54.97,0:00:58.59,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:00:58.59,0:01:01.88,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:01.88,0:01:05.73,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:05.73,0:01:07.95,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:07.95,0:01:10.56,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:10.56,0:01:14.00,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:14.00,0:01:17.27,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:17.27,0:01:19.99,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:19.99,0:01:25.51,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:25.51,0:01:26.48,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:26.48,0:01:27.45,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:27.45,0:01:28.80,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:28.80,0:01:31.37,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:31.37,0:01:31.92,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:31.92,0:01:35.05,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:35.05,0:01:39.18,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:39.18,0:01:42.72,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:42.72,0:01:46.37,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing
Dialogue: 0,0:01:46.37,0:01:51.25,Default,,0,0,0,,Lorem ipsum dolor sit amet,\Nconsectetur adipiscing

Please include the complete console output from your command, and provide the add ASS file (or just copy the contents into the question) if possible.

You can try adding the original_size filter option, such as:
-vf "ass=test_subs.ass:original_size=768x576"

Specify the size of the original video, the video for which the ASS
  file was composed. For the syntax of this option, check the
  Video size section in the ffmpeg-utils manual. Due to
  a misdesign in ASS aspect ratio arithmetic, this is necessary to
  correctly scale the fonts if the aspect ratio has been changed.

Based on the documentation of the subtitles filter, it uses libass for the rendering itself. This filter just has a routine to convert other formats to .ass before stepping aside for libass.

@Mulvya The original_size option was the important part of the answer, which I assumed the ass filter lacked, but it appears to just be undocumented (can't test now). Answer updated.

Tested - it works.

I found some ASS files, like this sample, which contain a Video Aspect Ratio tag but it seems to not make a difference in ffmpeg hardcoding.
The workaround I can think of right now is to create a complex filter where you create a transparent RGBA canvas of 1024x576; burn the subtitles onto them, scale the result to 768x576 or 720x576, depending on your source video and then overlay that output onto your video.


text:
inserting video clip into another video but keep original audio
I need to replace video in a larger mp4 file with a smaller mp4 clip - but leaving the original (larger clip) audio intact.
So for example I might want the first 2 seconds of SmallClip.mp4 to replace the video in LargeClip.mp4 starting at (say) 10 seconds in to LargeClip.mp4.
The format of both clips is likely to be identical, so I'm hoping I can copy instead of decoding for speed etc (I'll have to do it a lot).
Finally, I might want to do exactly the same thing but in several places in LargeClip.mp4 - all places in the output getting the video replaced with the same input clip's video.  I'd be happy to do this in multiple oerations if neccessary but if it were possible on one command so much the better :)
I'm reading up on the options for ffmpeg but I'm new to it and haven't figured it out yet.  Any help much appreciated!

Copying is only feasible if the resume point(s) of the large MP4 is a keyframe. Otherwise, this can be done in a couple of steps.

That's good to know - but how to output the small video clip at a certain point in in the large clip?  I can't figure it out.

You can use the concat demuxer in ffmpeg to do this. For accurate splicing, re-encoding is needed which is what the commands below do.
Step 1 Prepare the concat text file
You must first create a plaintext file, say, concat.txt, like this
file 'LargeClip.mp4'
inpoint 0.0
duration 10.0
file 'SmallClip.mp4'
inpoint 0.0
outpoint 2.0
file 'LargeClip.mp4'
inpoint 12.0
duration 5.0
file 'SmallClip.mp4'
inpoint 23.0
duration 4.0
file 'LargeClip.mp4'
inpoint 21.0

This shows the first 10 seconds of LargeClip, then the first two seconds of smallclip, then resumes the Largeclip at 12:00, shows it for 5 seconds, then splices in 23:00 to 27:00 of small clip, switches back to LargeClip at its 21:00 and keeps it till its end. These timecodes, in seconds, refer to the source file timecode, not of the assembled output.
Make sure that the sync of LargeClip isn't broken, i.e. after switching to SmallClip for 12 seconds, you want to resume LargeClip 12 seconds later from where you left it off.
Step 2 Concat the video streams
This command will skip the audio since we don't to splice the audio streams.
ffmpeg -f concat -i concat.txt -an -c:v libx264 -crf 23 -fflags +genpts spliced-vid.mp4

Step 3 Insert the audio from LargeClip
ffmpeg -i spliced-vid.mp4 -i LargeClip.mp4 -c copy -map 0:v -map 1:a Final.mp4

This looks like a wonderful answer - I will try it out and mark as an answer assuming it works.  Thanks!!

that worked thanks...with the small caveat that "duration" didn't seem to work, I replaced that with "outpoint" all the way through and it worked fine.


text:
How do I move (rearrange) the orientation of a video? Using ffmpeg
I want to crop the video at some position and move the part next to the part that wasn't cropped. (See image, it explains better)

This should do it:
ffmpeg -i input.mp4 \
-filter_complex "[0:v] crop=iw/3:ih:0:0,pad=iw:2*ih [left]; \
 [0:v] crop=iw/3:ih:(iw/3)+1:0 [middle]; \
 [0:v] crop=iw/3:ih:(2*iw/3)+1:0 [right]; \
 [left][middle] overlay=0:main_h/2,pad=iw:(3*ih/2) [out1]; \
 [out1][right] overlay=0:(2*main_h/3) [fout] " \
  -c:v libx264 -an -map "[fout]" trisected-vertical-overlay.mp4

I haven't supplied any specific video or audio encoding parameters. This just shows the overlay filter to use. You'll have to encode and map the audio, as needed.

Using crop and vstack:
ffmpeg -i input -filter_complex \
"[0:v]crop=iw/3:ih:0:0[left]; \
 [0:v]crop=iw/3[center]; \
 [0:v]crop=iw/3:ih:ow*2:0[right]; \
 [left][center][right]vstack=inputs=3[v]" \
-map "[v]" -map 0:a -c:a copy output

vstack is faster than pad + overlay.
If your ffmpeg is too old for the vstack filter then just download a recent build.


text:
Use ffmpeg to create a split screen video out of 5 videos- 4 videos in landscape one in portrait
I'm trying to create a series of split screen videos for students to work on remotely using ffmpeg. I need to create an ffmpeg split screen "template" for 5 videos, 1 in portrait and the other 4 in landscape.
All the videos have the same resolution: 1280x720. One is 720x1280 (portrait) and the other 4 are 1280 x 720 (landscape)
I want to create a split screen of dimensions 1680x720 out of the 5 videos so the portrait video is 400x720 and the 4 landscape videos as 640x360.
How do I modify this 2x2 grid ffmpeg code to allow this?:
ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -filter_complex "[0:v][1:v][2:v][3:v]xstack=inputs=4:layout=0_0|w0_0|0_h0|w0_h0[v]" -map "[v]" output.mp4

Assuming you want a layout of:
0 1 2
0 3 4

Command is:
ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -i input4.mp4 -filter_complex "[0]scale=-1:720[v0];[1]scale=-1:360[v1];[2]scale=-1:360[v2];[3]scale=-1:360[v3];[4]scale=-1:360[v4];[v0][v1][v2][v3][v4]xstack=inputs=5:layout=0_0|w0_0|w0+w1_0|w0_h1|w0+w1_h1[v]" -map "[v]" output.mp4

Great llogan This works if I put in the exact resolutions of each video output. Thanks for your help

Here's the code I used to get the 5 grid working properly
ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -i input4.mp4 -filter_complex "[0]scale=400x720[v0];[1]scale=640x360[v1];[2]scale=640x360[v2];[3]scale=640x360[v3];[4]scale=640x360[v4];[v0][v1][v2][v3][v4]xstack=inputs=5:layout=0_0|w0_0|w0+w1_0|w0_h1|w0+w1_h1[v]" -map "[v]" output.mp4

An alternative to xstack is using two vstacks to build the portrait columns out of the grid and then hstacking all three together at the end:
ffmpeg -y -i p1.png -i g1.png -i g2.png  -i g3.png -i g4.png -filter_complex "[1][2]vstack=inputs=2[p2];[3][4]vstack=inputs=2[p3];[0][p2][p3]hstack=inputs=3" output.png

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


text:
FFMPEG how do i remove png and blur from this code
how do i remove the 55.png code and blur.
ffmpeg -y -i 55.mp4 -i "55.png" -i "intro.mp4" -filter_complex "[0:a]atempo=1.15,volume=1.6,pan=stereo|c0<c0+0*c1|c1<c0+0*c1,aeval=val(0)|-val(1) [amain]; [0:v]setpts=PTS/1.15,crop=iw/1.2:ih/1.2,boxblur=1:2,scale=1280:720,setdar=16/9 [v1]; [v1][1:v]overlay=0:0 [vmain]; [2:v]scale=1280:720,setdar=16/9 [vintro]; [vintro][2:a][vmain][amain]concat=n=2:v=1:a=1" -vcodec libx264 -pix_fmt yuv420p -r 30 -g 60 -b:v 1400k -profile:v main -level 3.1 -acodec libmp3lame -b:a 128k -ar 44100 -metadata title="" -metadata artist="" -metadata album_artist="" -metadata album="" -metadata date="" -metadata track="" -metadata genre="" -metadata publisher="" -metadata encoded_by="" -metadata copyright="" -metadata composer="" -metadata performer="" -metadata TIT1="" -metadata TIT3="" -metadata disc="" -metadata TKEY="" -metadata TBPM="" -metadata language="eng" -metadata encoder="" -bufsize 500000k -threads 0 -preset superfast out2222.mp4

will really appreciate it if you can show me how to remove the Blur and 55.png Code Overlay

Your command with 55.png, overlay, and boxblur removed:
ffmpeg -y -i 55.mp4 -i "intro.mp4" -filter_complex "[0:a]atempo=1.15,volume=1.6,pan=stereo|c0<c0+0*c1|c1<c0+0*c1,aeval=val(0)|-val(1) [amain]; [0:v]setpts=PTS/1.15,crop=iw/1.2:ih/1.2,scale=1280:720,setdar=16/9 [vmain]; [1:v]scale=1280:720,setdar=16/9 [vintro]; [vintro][1:a][vmain][amain]concat=n=2:v=1:a=1" -vcodec libx264 -pix_fmt yuv420p -r 30 -g 60 -b:v 1400k -profile:v main -level 3.1 -acodec libmp3lame -b:a 128k -ar 44100 -metadata title="" -metadata artist="" -metadata album_artist="" -metadata album="" -metadata date="" -metadata track="" -metadata genre="" -metadata publisher="" -metadata encoded_by="" -metadata copyright="" -metadata composer="" -metadata performer="" -metadata TIT1="" -metadata TIT3="" -metadata disc="" -metadata TKEY="" -metadata TBPM="" -metadata language="eng" -metadata encoder="" -bufsize 500000k -threads 0 -preset superfast out2222.mp4

Excellent boss just what i was trying to do very nice. i also have another question i will update post 1.

@das You should post a new question for this.

ok thank you hope nobody Minuses my post like they normally do lol please check new post https://video.stackexchange.com/questions/29971/ffmpeg-creating-a-5-second-clip-from-single-png-and-compile


text:
Create 5 second intro from image and concatenate to a video
I want to make a 5 second intro from 55.png, and concatenate it to the beginning of 55.mp4. I would like to incorporate it into this command:
ffmpeg -y -i 55.mp4 -i intro -filter_complex "[0:a]atempo=1.15,volume=1.6,pan=stereo|c0<c0+0*c1|c1<c0+0*c1,aeval=val(0)|-val(1) [amain]; [0:v]setpts=PTS/1.15,crop=iw/1.2:ih/1.2,scale=1280:720,setdar=16/9 [vmain]; [1:v]scale=1280:720,setdar=16/9 [vintro]; [vintro][1:a][vmain][amain]concat=n=2:v=1:a=1" -vcodec libx264 -pix_fmt yuv420p -r 30 -g 60 -b:v 1400k -profile:v main -level 3.1 -acodec libmp3lame -b:a 128k -ar 44100 -metadata title="" -metadata artist="" -metadata album_artist="" -metadata album="" -metadata date="" -metadata track="" -metadata genre="" -metadata publisher="" -metadata encoded_by="" -metadata copyright="" -metadata composer="" -metadata performer="" -metadata TIT1="" -metadata TIT3="" -metadata disc="" -metadata TKEY="" -metadata TBPM="" -metadata language="eng" -metadata encoder="" -bufsize 500000k -threads 0 -preset superfast out2222.mp4

Info about my ffmpeg and about 55.mp4:
ffmpeg version git-2020-04-13-59e3a9a Copyright (c) 2000-2020 the FFmpeg develop
ers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfi
g --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libb
luray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --e
nable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-lib
twolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --
enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --e
nable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo
-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --ena
ble-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable
-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 78.102 / 58. 78.102
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '55.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2020-03-26T08:17:13.000000Z
  Duration: 00:04:29.12, start: 0.000000, bitrate: 1402 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709)
, 1280x720 [SAR 1:1 DAR 16:9], 1270 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 t
bc (default)
    Metadata:
      creation_time   : 2020-03-26T08:17:13.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/26
/2020.
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 127 kb/s (default)
    Metadata:
      creation_time   : 2020-03-26T08:17:13.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/26
/2020.

Info about 55.png:
    Stream #0:0: Video: png, rgba(pc), 305x432 [SAR 3778:3778 DAR 305:432], 25 tbr, 25 tbn, 25 tbc

post updated, added the code shown from video

boss sorry, allow me to provide the info for the intro.mp4 made from ffmpeg, this is the one that prevents the compile to work

Post updated sir sorry for the confusion, what am trying to do is create a intro.mp4 using the command line rather than opening sony vegas, everytime and then compile the intro with my 55.mp4, i just want to make intro.mp4 using command line and compile it with the final code i have

Just use the image itself as an input, loop it, and concat it  yes please this is exactly what i want to do, i just want a 5 second intro using my 55.png then start my original video wich is 55.mp4  ffmpeg -i 55.png wait i wil post it

post updated. added 55.png info

ffmpeg -y -i 55.mp4 -loop 1 -framerate 30000/1001 -t 5 -i 55.png -t 0.5 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -filter_complex "[0:a]atempo=1.15,volume=1.6,pan=stereo|c0<c0+0*c1|c1<c0+0*c1,aeval=val(0)|-val(1) [amain]; [0:v]setpts=PTS/1.15,crop=iw/1.2:ih/1.2,scale=1280:720,setdar=16/9 [vmain]; [1:v]premultiply=inplace=1,scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[vintro]; [vintro][2][vmain][amain]concat=n=2:v=1:a=1" -vcodec libx264 -pix_fmt yuv420p -g 60 -b:v 1400k -profile:v main -level 3.1 -acodec libmp3lame -b:a 128k -ar 44100 -metadata title="" -metadata artist="" -metadata album_artist="" -metadata album="" -metadata date="" -metadata track="" -metadata genre="" -metadata publisher="" -metadata encoded_by="" -metadata copyright="" -metadata composer="" -metadata performer="" -metadata TIT1="" -metadata TIT3="" -metadata disc="" -metadata TKEY="" -metadata TBPM="" -metadata language="eng" -metadata encoder="" -bufsize 500000k -threads 0 -preset superfast out2222.mp4

The intro needs audio to concat to the audio of 55.mp4 or else concat will fail. This example uses the anullsrc filter to generate silent audio. A short duration is declared because anullsrc duration by default is infinite. The concat filter will automatically extend this shortened duration to match its associated video segment.
The width, height, and aspect ratio of the 55.png is modified with the scale, pad, and setsar filters to match those of 55.mp4.

1 word excellent Bravo, 1 issue is the intro logo is to big,it enlarges to much can we have it fit center?

Can we have it centered like this https://i.imgur.com/DEsi9Fr.png  ,And look at your updated code image https://i.imgur.com/gFk7S2R.png

intro should be like this https://streamable.com/0sj61i

new update 100% correct, can you remove white background if not its ok since the image is png transperant it should be plain right ? if you cant its ok let me know thank you and yes you read my mind it is exactly how i want it.

@das Provide a link to 55.png.

https://i.imgur.com/v2fzSUS.png i also notice the video playback is 1x extra fast? can i tune it to be normal

https://streamable.com/rx4ye8 your video time 2:37
https://streamable.com/r1tv48 original video  go to time 2:56 and listen to sound playback compare

@das That's due to your inclusion of atempo=1.15 and setpts=PTS/1.15 which I assumed you wanted to keep.

thanks sir, am compiling and tuning that line of code and testing which is better for me,sorry about that,can you remove the white background

@das See updated answer. Most PNG with alpha wouldn't need premultiply filter, but yours does.

the audo how do to make it sound better just like original video no hissing noise higher audio quality

@das Remove volume=1.6 as the audio volume is probably clipping. This is becoming a never ending series of questions. I already answered the main question. The rest of these questions are not related to the main question of "how to add intro". You're supposed to make one question and it gets one answer. Then if you have another, separate issue you post a new question and it gets its own answer.

thank you @llogan you was so helpful may god bless you

ffmpeg -y -i 55.mp4 -loop 1 -framerate 30000/1001 -t 5 -i 55.png -t 0.5 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -filter_complex "[0:a]atempo=1.15,volume=1.6,pan=stereo|c0<c0+0*c1|c1<c0+0*c1,aeval=val(0)|-val(1) [amain]; [0:v]setpts=PTS/1.15,crop=iw/1.2:ih/1.2,scale=1280:720,setdar=16/9 [vmain]; [1:v]premultiply=inplace=1,scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[vintro]; [vintro][2][vmain][amain]concat=n=2:v=1:a=1" -vcodec libx264 -pix_fmt yuv420p -g 60 -b:v 1400k -profile:v main -level 3.1 -acodec libmp3lame -b:a 128k -ar 44100 -metadata title="" -metadata artist="" -metadata album_artist="" -metadata album="" -metadata date="" -metadata track="" -metadata genre="" -metadata publisher="" -metadata encoded_by="" -metadata copyright="" -metadata composer="" -metadata performer="" -metadata TIT1="" -metadata TIT3="" -metadata disc="" -metadata TKEY="" -metadata TBPM="" -metadata language="eng" -metadata encoder="" -bufsize 500000k -threads 0 -preset superfast out2222.mp4


text:
Is using codecs matter if Facebook re-encode all the uploaded videos?
I usually encode with libx265 and libfdk_aac to get good quality and small file size for posting in Facebook. I use ffmpeg as follows.
ffmpeg -i input.mp4 -vf -c:v libx265 -c:a libfdk_aac output.mp4

If Facebook, YouTube and others video hosting sites re-encode all videos uploaded, is the codecs used still matter?
If I use h.264 codec with mp4 or MOV format as Facebook recommended, will it reduce or bypass the Facebook's video processing?
If I use h.265 for smaller file size, will the viewers of my video save their mobile data usage?

If Facebook, YouTube and others video hosting sites re-encode all videos uploaded, is the codecs used still matter?

Both no and yes.
Technically, no, because they can handle most common formats and re-encode what you give it no matter the format.
Practically, yes, because you have to take into account your time, energy usage, and upload speed.

If I use h.264 codec with mp4 or MOV format as Facebook recommended, will it reduce or bypass the Facebook's video processing?

No. They almost certainly re-encode everything for consistency.

If I use h.265 for smaller file size, will the viewers of my video save their mobile data usage?

If the quality between the two formats is the same, then the answer is no.

What to do
Because it appears you are re-encoding something that has already been losslessly compressed I recommend that you upload the original file and avoid the needless re-encoding step. You'll save time and avoid generation loss.
If you have to re-encode
If you must re-encode, such as if the original was encoded inefficiently, or is too big to upload, or you want to modify the video (such as by using filters), then provide "visually lossless" or as close to that as you can while still being practical to encode and upload. Avoid lossless as it will make a huge file.

Rendering your video as a prores444xq which is 4gb big or using h264 to produce a 50mb file will result in the same data-usage at the user-end, since the files will be converted in the same codec by Facebook. However, your aspect ratio and overall size of the video will matter. I doubt that facebook would upscale a 1280x720 video to fullHD, so that might safe some data on the back-end.
However, encoding nearly lossless first will still result in a better image quality than rendering in a low-profile h264, even though it will be converted again. If you re-encode a huge file, it will look good for the re-encoded format, but if you re-encode an already heavily compressed file containing artifacts it will look worse in the end.


text:
Compress video while keeping details
I shoot POV bike videos using a GoPro Hero at 1280x720. Picture is fine (lots of details, fine color), but similar videos (also with GoPro or another helmet mounted camera, same resolution) in YouTube weigth just a 10% of mine, while looking gorgeous. Take a look at this RedBull example (83 MB) and then my last video (162 MB). RedBull look great at 16 MB/sec, while mine look not so good at 23 MB/sec (original size 480 MB). I'm using the same camera (or very similar), with no postprocessing. How can achieve a better looking video in YouTube? (BTW, I used kdenlive for editing).

While watching the examples it struck me that your video is stuttering as it is over the top with MBPS (23 MB per sec). So I would address your compression scheme first. I recommend that you consider rending your work in mp4 with 5 MB to 10 MB per sec. Here is the recommended video and audio compression as set by the folks at Vimeo for optimizing presentation on their site:
https://vimeo.com/help/compression
Another issue your video example is facing is that the GoPro does not have manual exposure controls. In your example, I see the bike going through bright areas and dark areas rapidly hence quick changes of exposure from the GoPro auto exposure. While the Red Bull example, shows the bikes in a stable light situation that does not force the GoPro to make wide adjustments. The solution to this problem is to either use a camera that offers manual exposure or shoot scenes that are evenly lit so they do not challenge the auto exposure to make big changes. Also, since the GoPro offers you at least a choice of Spot or Center Weighted auto exposure you might explore how one or the other might help expose the scenes more evenly.

Definitely agree - get the compression done before you send to YouTube.

YouTube will re-encode whatever you give it, and depending on the ratecontrol method YouTube uses, the complexity of the input can be a major factor in the file size of the videos YouTube re-encodes. Therefore, without altering your content, you may have little control of the size of the videos on YouTube's servers.
There is little need to adhere to specific bitrate suggestions: the best practice is to upload the best quality you practically can since YouTube (and others) are going to re-encode it anyway.

For Kdenlive specifically, I recommend a new export profile:
Open Kdenlive. Choose Render and then the Render Project tab. Click the Create New Profile icon. Fill out Profile name with H.264 Visually Lossless (video) / Vorbis (audio) or whatever you prefer. Extension is mkv. Parameters are:
f=matroska vcodec=libx264 -preset medium -crf 18 acodec=libvorbis aq=8 ac=2

For newer ffmpeg verions the parameter string is:
-f matroska -vcodec libx264 -preset medium -crf 18 -acodec libvorbis -aq 8 -ac 2

This should provide an output that is "visually lossless", yet it should be a manageable size for uploading. The audio format doesn't really matter as long as and Matroska and YouTube support it and you use a high enough quality (and assuming your ffmpeg supports the encoder). Others to consider are acodec=libmp3lame aq=1 or acodec=libfaac aq=100.
Who needs Premiere with such output flexibility?


text:
Why is audio generated by avconv choppy?
I am using avconv to generate an AV stream, and the video is perfect, but the audio is very choppy using iOS Safari.
Can anyone tell me what is wrong with my audio stream that's causing this?
When playing using VLC on Mac it is also choppy, but when using some Flash players and OPlayer Lite on iOS it's fine.
I have attached a file containing only audio (exhibiting the same problem) here:
This is my full command line
gst-launch-1.0 -v -e uvch264src profile=high iframe-period=20 device=/dev/video0 name=src auto-start=true src.vidsrc ! queue ! video/x-h264,width=800,height=600,framerate=20/1 ! omxh264dec ! omxh264enc target-bitrate=750000 control-rate=variable ! video/x-h264,profile=high ! h264parse ! queue ! flvmux streamable=true name=mux alsasrc device=hw:1 do-timestamp=true ! audioconvert ! audio/x-raw,channels=1 ! audioresample ! audio/x-raw,rate=44100 ! queue ! voaacenc bitrate=128000 ! aacparse ! queue ! mux. mux. ! queue ! filesink location=/home/pi/flvpipe.flv sync=false
avconv -i /home/pi/flvpipe.flv -f flv -strict -2 -c:v copy -c:a copy -f flv rtmp://wowzaserver:1935/live/mystream -vn -c:a copy -hls_time 10 -hls_list_size 3 -bsf h264_mp4toannexb /var/ramdisk/live.m3u8
My command line looks complicated - but it's just capturing audio and video from a UVC camera, encoding everything using openmax hw acceleration, before passing it to avconv to send to a wowza server.
I don't use gstreamer to deliver to the wowza server because it seems to corrupt the stream - avconv is much more reliable at the rtmp delivery

please provide the full command line you are using and it's full output. The link you have provided takes me to an empty page.

I've added my full script and used a different file sharing service for the linked content


text:
Converting GIMP curves files to Photoshop (.acv) for ffmpeg
I've seen a number of scripts for converting Photoshop .asv .acv files to a GIMP friendly format. Does anyone know if such a tool exists to do the opposite, i.e. converting a GIMP curve file to .asv .acv? I'm interested in this for use in the ffmpeg curves filter. Thanks.
EDIT: It seems like the ffmpeg documentation is wrong: http://ffmpeg.org/ffmpeg-filters.html#curves. The curve files produced by Photoshop (at least on OSX) are not .asv but .acv.

The documentation have been fixed. It will take a day or so for the online docs to regenerate. I recommended making a feature request/wish to support the GIMP curves files at the bug tracker.

FFmpeg #4858: Support GIMP curves preset files in curves filter

I ran into the same issue, so I threw together a Python script (posted and linked at the bottom). It doesn't convert the GIMP curves present into a .acv. But it does convert it directly into an argument for an ffmpeg curves video filter. I had hardcoded the files into the script, but to make it a bit more user friendly I added some instructinos and commandline inputs for the file-in and file-out.
NB: If you are doing a simple -vf you can copy and paste it directly. If you are using a complex filter graph you still need to put the [in] and [out] arguements on either side.
Here's a usage example: I've bolded the parts that you would need to add and ellipsed the very long filter statement.
simple vf: ffmpeg -i videoin.mp4 -vf curves=master="0....1.000" videoout.mp4
part of complex filter that concatenates two videos, color corrects the product, and adds a separate audio track:
ffmpeg `
-i vid1.mp4 `
-ss 0:0:03.04 -i .\vid2.mp4 `
-i .\audio.m4a `
-filter_complex `
"[0:v][1:v] concat=n=2:v=1:a=0 [stitched]; `
[stitched] curves=master='0.0/0.000000 0.01171875/0.008608 `
....0.99609375/1.000000' [stitchedcorrected]" `
-map '[stitchedcorrected]' -map 2:a:0 `
-vcodec libx264 -preset slow `
out.mp4

Hope this is helpful! Let me know if you need any help.
http://pythonfiddle.com/gimp-curves-to-ffmpeg-curves-arg/
import re

#make generator
lower=0
upper=1
length=256
zerotoonestepped256gen = [lower + x*(upper-lower)/length for x in range(length)]

def formatForFFMPEG(values):
    serializedValues = values.split(' ')
    list = []
    for i in range (len(serializedValues)):
        if not list or zerotoonestepped256gen[i] - float(re.match(r"^[^////]*",list[-1]).group(0)) > 0.01:
            list.append('%s/%s' % (zerotoonestepped256gen[i], serializedValues[i]))
    return list

#print instructions
print('This is a tool to convert a color curves map from GIMP to a curves filter that can be inserted into the -complex_filter. Note that you still need to append the input and output streams onto either side of the command.')
#get filename
file = input('Please input the absolute path to the GIMP Color Curve Preset File: ')
out = input('Please enter the output file (file will be overwritten if it exists): ')

#Open the curves file
curvesfile = open(file,"r")
curvesString = curvesfile.read()
foundValues = re.findall(r'(?<=samples 256) [\d. ]*',curvesString)

masterValues = formatForFFMPEG(foundValues[0][1:])
redValues = formatForFFMPEG(foundValues[1][1:])
greenValues = formatForFFMPEG(foundValues[2][1:])
blueValues = formatForFFMPEG(foundValues[3][1:])
alphaValues = formatForFFMPEG(foundValues[4][1:])

commandPrelim = 'curves=master="'

command = commandPrelim + ' '.join(masterValues) + '":red="' + ' '.join(redValues) +'":green="' + ' '.join(greenValues) + '":blue="' + ' '.join(blueValues) + '"'

with open(out, 'w') as out:
    out.write("Final Command\n\n" + command + '\n\n')
    out.write("master\n\n" + ' '.join(masterValues) + '\n\n')
    out.write("red\n\n" + ' '.join(redValues) + '\n\n')
    out.write("green\n\n" + ' '.join(greenValues) + '\n\n')
    out.write("blue\n\n" + ' '.join(blueValues) + '\n\n')
    out.write("alpha\n\n" + ' '.join(alphaValues) + '\n\n')

@kingfishersfire
Thanks for this script. It is the only one that works. I tried gimp2acv, which purportedly outputs an acv file directly, which is ideal because you only need use curves=psfile='<acv file>' , instead of a long string of points as with  curves=master='0....1.000', but it is an old script written for python2 and has many errors with python3, which is the only version that comes with OS X Ventura. I tried converting it to python3 with 2to3 but still got some issues that I had to correct manually. When it finally worked, I got a 4 byte .acv file.
Your script works but it is inconvenient to use because you have to run it each time and manually enter file paths each time you run it. I am using ffmpeg from a bash script and would like to simply call this script with file path args and cat the file to a variable to avoid pasting all those points in each ffmpeg call (curves=master='$curves'). That's what I do manually now. Is it possible for you to add that functionality to this same script as an option? I tried to do it myself but found that reading arguments from the command line is no trivial task like it is with other languages.

I did some work on converting the gimp2acv python module at fehlfarbe/gimp2acv: Converts GIMP curves to Adobe ACV curves from python2 to python3 and it now does exactly what the OP asked for. I posted it at the issue I started: After converting gimp2acv.py to python3 and manually correcting a few string-related TypeErrors, got .acv file of 4 bytes · Issue #1 · fehlfarbe/gimp2acv
Here is a direct link to it:
gimp2acv-master - python3.zip
Unzip it and cd to the directory 'gimp2acv-master - python3'.
Example:
python3 ./gimp2acv.py -i GIMPcurves.gcv -o GIMPcurves.acv
I tested it with ffmpeg -i "input.jpg" -vf "curves=psfile=GIMPcurves.acv" "output.jpg" and got the expected output.

The above script was modified by the author to work with python3.
fehlfarbe/gimp2acv: Converts GIMP curves to Adobe ACV curves


text:
Best presets to scale legacy 4:3 and 5:4 videos using ffmpeg
We have videos in row format (.mov) that are 4:3 (768x576) and 5:4 (720x576). We have a recommended preset for streaming over DASH to HTML5 and Silverlight players (this is the second pass):
ffmpeg -i input.mp4 -an -vcodec libx264 -profile:v main -pass 2 \
-vf scale=320:180 -pix_fmt yuv420p -g 75 -keyint_min 25 -b:v 384k \
-maxrate 384k -bufsize 384k -passlogfile passlogfile_fp output_320x180_384.mp4

with 5 more, but different resolution and bitrate:

480:270 -b:v 700k
800:450 -b:v 1300k
960:540 -b:v 1300k
1280:720 -b:v 3500k
1920:1080 -b:v 5000k

With the 4:3 source videos we are happy with the result - the image doesn't get stretched, but players add black border to fit the width. Although we are not sure if this preset is suitable for these source videos.
With the 5:4 we are not really happy, because the image is stretched for 16:9 display. How can we achieve the same effect as with the 4:3 source videos? Are these presets suitable at all for these video formats or should we be looking for something else?
Appreciate your help. Our knowledge about encoding is pretty limited.

In order to maintain the aspect ratio of the source movie through FFMpeg's scaler, you have to specify a scale with an unknown:
ffmpeg -i input.mp4 -an -vcodec libx264 -profile:v main \
  -pass 2 -vf scale=-1:180 -pix_fmt (etc...)

The "-1" will tell the scaler to make the output 180px high, and however many pixels wide the output must be to preserve it's original aspect ratio.
This would give you movies with the old aspect ratio, you need a way of forcing the original movie into an arbitrary rectangle.  The documentation give an example of how you do this:
ffmpeg -i input.mp4 -vf scale="'if(gt(a,4/3),320,-1)':'if(gt(a,4/3),-1,240)'"

This example will create a movie that is 320x240, and preserves the original pixel aspect ratio, whatever that may be.  The output will be positioned against the upper-left corner (I think) so you'll have to do a filter to repo it.


text:
Libav/ X264 failed to compile with Hi422p profile and mp4 container support
My goal is to encode several videos from SD PAL captured in ProRes(HQ) 422 10bit through AJA Kona 3 to H264 with Hi422p profile in .mp4 container. I work on Mac OSX 9.
I try the last x264 10bit binaries from Videolan.
It as the ability to encode in the correct profile but is not compiled with GPAC nor l-smash.
So I struggle to understand (I’m  a novice) how to complete a clean install of libav/lsmash/x264 with all the good configuration option, in the correct order…. since at least a week.
My last try was to clean my /usr/local folder where there was too many dirty things after all, install libav and x264 using this link : http://www.xin.at/x264/x264-guide-macosx-en.htm.
But it seems that :

a lot of warning during the make process of libav

e.g first one :
**libavfilter/avfilter.c:292:20: warning: returning 'const AVFilter *' (aka 'const struct AVFilter *') from a function with result type 'AVFilter *' (aka 'struct AVFilter *') discards
      qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            return f;**

at the end of the make install, it’s appear that nothing is installed neither in usr/local/lib or usr/local/bin.
So when i try to do a ./configure on x264 I got a
« libav: no »
but as l-smash is installed I got
« mp4:lsmash »

By "libav" are you referring to the FFmpeg libav* libraries, or the fork Libav that unfortunately chose the same name?

I refer to libav that you can source at libav.org.

But i succeed to compile everything now
MacBook-Pro-Regie:x264-10bit FDS$ x264 --version
x264 0.146.2538 121396c
built on Apr 16 2015, gcc: 4.9.2
x264 configuration: --bit-depth=10 --chroma-format=all
libx264 configuration: --bit-depth=10 --chroma-format=all
x264 license: GPL version 2 or later
MacBook-Pro-Regie:x264-10bit FDS$ x264 --help
x264 core:146 r2538 121396c

I'm not sure i can do an independant binairie with this now. For now i'm focus on encoding..

This question might get better answers at SuperUser

I'm voting to close this question as off-topic because it is about compilation, not use.


text:
ffmpeg filter_complex problem
I'm trying to achieve complex effect with ffmpeg, but I seem to be failing the syntax of -filter_complex somewhere.
The goal is to capture part of the screen (with UScreenCapture direct show device) where I display two images side by side (called [bg] and [key], or [rgb] and [alpha] in the filter chain). On the left is the image itself, on the right its alpha channel, shown in black and white. Then I want to compose that on top of another input (some video input from a file or other capture device... but a file in this case, called [video] in the filter chain).
To compose the three together, first I blend 'multiply' the alpha with the video, turning to black everything outside the white alpha(dumped into [out1]), and blend 'multiply' the image background with the negative alpha (dumped into [out2]). To end the chain I add the two outs with blend mode addition... and dump it to a pipe
Theoretically it should work but it keeps complaining about stream specifier 'alpha' matching no stream:
ffmpeg -v debug -f dshow -i video=UScreenCapture -i chroma.mp4 -filter_complex \
"[0:v]split[bg][key]; \
 [bg]crop=720:576:0:0, format=gbrap,setsar=0:1[rgb]; \
 [key]crop=720:576:720:0,format=gray8,setsar=0:1,scale=720:576[alpha]; \
 [1:v]scale=720:576,format=yuv420p,setsar=0:1[video]; \
 [alpha]negate[neg_alpha]; \
 [video][neg_alpha]blend=all_mode='multiply':all_opacity=1[masked_video]; \
 [rgb][alpha]blend=all_mode='multiply':all_opacity=1[masked_3d]; \
 [masked_video][masked_3d]blend=all_mode='addition':all_opacity=1[out]" \
-map "[out]"-c:v mpeg2video -f avi - | ffplay -

You should trim your filtergraph, if possible, to keep only the minimum filters necessary for the problem to arise. You should also include the complete console output from your command.

Have you tested to see that this works?


text:
The ffmpeg`s filter_complex blend respecting overlay`s alpha channel
I need to blend an video with an semitransparent png like this:
[1:0][0:0]blend=all_mode=average
Seems like the transparency of png is ignored.

What I missed?
How to make the ffmpeg to respect the overlay`s alpha channel?

Full example of my settings:
ffmpeg \
-i background.mp4 \
-loop 1 -f image2 -i transparent-overlay.png \
-shortest -y \
-filter_complex "[1:0][0:0]blend=all_mode=average" \
overlay.mp4

Output:
ffmpeg version 2.4.3- http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'background.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101
Duration: 00:01:36.40, start: 0.033333, bitrate: 1132 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 999 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, image2, from 'transparent-overlay.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #1:0: Video: png, rgba, 640x360 [SAR 2835:2835 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0x3580cc0] using SAR=1/1
[libx264 @ 0x3580cc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x3580cc0] profile High, level 3.0
[libx264 @ 0x3580cc0] 264 - core 142 r50 dd79a61 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'overlay.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc56.1.100 libx264
Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.1.100 libvo_aacenc
Stream mapping:
Stream #0:0 (h264) -> blend:bottom (graph 0)
Stream #1:0 (png) -> blend:top (graph 0)
blend (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
frame= 81 fps=0.0 q=28.0 size= 78kB time=00:00:03.52 bitrate= 180.7kbits
...
frame= 2468 fps=146 q=-1.0 Lsize= 7220kB time=00:01:38.64 bitrate= 599.6kbits/s
video:5643kB audio:1507kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.981916%
[libx264 @ 0x3580cc0] frame I:11 Avg QP:19.23 size: 16922
[libx264 @ 0x3580cc0] frame P:1104 Avg QP:21.09 size: 4387
[libx264 @ 0x3580cc0] frame B:1353 Avg QP:24.45 size: 553
[libx264 @ 0x3580cc0] consecutive B-frames: 25.4% 0.4% 12.6% 61.6%
[libx264 @ 0x3580cc0] mb I I16..4: 14.3% 65.2% 20.6%
[libx264 @ 0x3580cc0] mb P I16..4: 0.1% 0.9% 0.1% P16..4: 35.2% 17.4% 8.8% 0.0% 0.0% skip:37.4%
[libx264 @ 0x3580cc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 31.4% 1.0% 0.2% direct: 0.6% skip:66.7% L0:31.0% L1:63.0% BI: 6.0%
[libx264 @ 0x3580cc0] 8x8 transform intra:72.5% inter:64.9%
[libx264 @ 0x3580cc0] coded y,uvDC,uvAC intra: 80.7% 54.2% 7.2% inter: 15.9% 6.9% 0.0%
[libx264 @ 0x3580cc0] i16 v,h,dc,p: 28% 43% 7% 22%
[libx264 @ 0x3580cc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 38% 14% 3% 6% 3% 15% 2% 10%
[libx264 @ 0x3580cc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 41% 11% 3% 7% 3% 15% 2% 10%
[libx264 @ 0x3580cc0] i8c dc,h,v,p: 51% 37% 9% 3%
[libx264 @ 0x3580cc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x3580cc0] ref P L0: 69.3% 20.7% 8.2% 1.7%
[libx264 @ 0x3580cc0] ref B L0: 96.7% 2.9% 0.4%
[libx264 @ 0x3580cc0] ref B L1: 96.0% 4.0%
[libx264 @ 0x3580cc0] kb/s:468.21

Please show the complete ffmpeg console output from your command.

@LordNeckbeard, complete log

I don't have an answer for this one. The docs for this filter could use some improvement to make them easier to follow. Try the ffmpeg-user mailing list.


text:
ffmpeg h264 crashes IE intermittently
First for moderators, this is relevant because I have incorporated ffmpeg in a program to render videos needed for a web-app.
My problem is that the videos I render randomly crash IE 11. Other browsers are fine. Here is a sample of my encoding strings: (Execution of all the strings  presented renders two versions of one video)
ffmpeg -start_number 1 -framerate 23.98  -i C:\videos\imagesequences\GOPR2001\startfoot_%%04d.png -profile:v baseline -level:v 3 -pix_fmt yuv420p -crf 1  -preset ultrafast -vframes 30  -vf fps='fps=23.98' -y C:\sprites\GOPR2001\GOPR2001_concat_1.mp4

ffmpeg -start_number 52 -framerate 23.98  -i C:\videos\imagesequences\GOPR2001\%%04d.png  -profile:v baseline -level:v 3 -pix_fmt yuv420p  -crf 1  -preset ultrafast -vframes 80  -vf fps='fps=23.98' -y C:\sprites\GOPR2001\GOPR2001_concat_2.mp4

ffmpeg -start_number 110  -framerate 23.98  -i C:\videos\imagesequences\GOPR2001\endfoot_%%04d.png -profile:v baseline -level:v 3 -pix_fmt yuv420p -crf 1  -preset ultrafast -vframes 31  -vf fps='fps=23.98' -y C:\sprites\GOPR2001\GOPR2001_concat_3.mp4

ffmpeg -f concat -i C:\sprites\GOPR2001\concatlist.txt -profile:v baseline -level:v 3 -pix_fmt yuv420p -crf 28  -preset veryslow -y C:\sprites\GOPR2001\mobile_GOPR2001.mp4

ffmpeg -f concat -i C:\sprites\GOPR2001\concatlist.txt -profile:v high -level:v 4 -pix_fmt yuv420p -crf 22  -preset veryslow -y C:\sprites\GOPR2001\GOPR2001.mp4

Where of course the concatlist.txt file contains the list of the three previously generated files. (I do effects on the front and tail end of the video this way.) One concatenation is for a mobile version. Either version causes the problem in IE

Are the vframes switches for trimming the file?


text:
ffmpeg - horizontal align of multiple drawtext
let you have a phrase where there is a word ( or a list of words ) that you want to underline, with a different color.
Apparently, you have to "split" your phrase into 3 different drawtext ( with different colors, but how can you set the exact "x" position for the second and third drawtext?
On the ffmpeg site , there is this example:
drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a

but I don't understand how to calculare the exact position of second element: "80" ? how "80" is calculated?
And finally, is there another graceful option to draw a word inside a phrase with a different color? ( best would be to use a single drawtext )

Make ASS (Advanced SubStation Alpha) subtitles and use the subtitles filter:

ffmpeg -i video.mp4 -filter_complex "subtitles=your_subtitles.ass" -c:a copy output.mp4

You can make the subtitles manually or with Aegisub.
SRT (Subrip) subtitles are much simpler than ASS and would be easier to make manually, but they will lack features that ASS can support. SRT will suffice for simple styling however (underline, bold, italics, etc), but not individual per-word color changing as far as I know.


text:
FFMPEG - How to use crop, scale and overlay all in one go?
Any ideas on the proper syntax to get crop to work with resizing and overlay all in one go?
The crop parameters are crop=1728:970:96:54 and I'm trying to work them into:
ffmpeg -loop 1 -i backgroundimage.png -i INPUTVIDEO.MP4 -filter_complex "[1]scale=1612:906[inner]overlay=154:170:shortest=1[out]" -map "[out]" -map 1:a -c:a copy -y -b:v 2000k -b:a 192K OUTPUT.MP4

Which input do you want to crop? backgroundimage.png or INPUTVIDEO.MP4. Where in the filtergraph should the crop occur? In other words, in which order should it occur? (Not immediately after crop obviously due to the crop being larger than the scale parameters.)

INPUTVIDEO.MP4 needs to be cropped. This example is taking INPUTVIDEO.MP4 and shrinking it down and placing it on top of the backgroundimage.png. Unfortunately, I need to crop according to the settings shown INPUTVIDEO.MP4 before dropping it onto the background.
I realize the scaling will have to change to something else which I can figure out afterwards - it was just the ability to crop, resize and overlay in one go that I was wondering about. Thanks!

To crop before scaling INPUTVIDEO.MP4:
ffmpeg -y -loop 1 -i backgroundimage.png -i INPUTVIDEO.MP4 -filter_complex "[1]crop=1728:970:96:54,scale=1612:906[inner];[0][inner]overlay=154:170:shortest=1[out]" -map "[out]" -map 1:a -c:a copy -b:v 2000k OUTPUT.MP4

That was perfect - Thank you llogan!


text:
Images to video using FFMPEG
I am writing as follows for a sequence of images like image1.png, image2.png, image3.png … image1234.png. My code for that is:
ffmpeg -framerate5 -start number 1 -i ".\Image%4d.png" -pix_fmt yuv420p text.mp4

But what pattern is needed for 0001.png, 0004.png, 0007.png, 0010.png, 0013.png, 0016.png, 0019.png?

Sequential series
1.png
%d.png

01.png
%02d.png

001.png
%03d.png

0001.png
%04d.png

image0001.png
image%04d.png

Non sequential series
If they image inputs are not sequential then use the glob wildcard:
ffmpeg -framerate 5 -pattern_type glob -i "*.png" output.mp4

The glob pattern may not be supported by Windows. In that case rename your images or use cat:
cat *.png | ffmpeg -framerate 5 -i - output.mp4

See the image demuxer documentation for more info.

Hi, Thank you for your Reply.But the Code is not working. Can you explain How to add cat for my Images?

@anil You need to show any errors you get. Can't help without more info. What is your OS?

Firstly,Thank you for your Reply. My OS is Windows 10

@anil What error did you get?


text:
Adobe Premiere Pro CC - Crop a video and export at the exact cropped size
I have a video that has 4 up-down-left-right black borders of different sizes.
I want to get rid of these black borders so the exported file has the exact size of the cropped area.
To do this, I used the "crop" effect (I would have preferred a tool that allows me to set the crop dimensions in pixels, but I guess that's not supported). But then I had a problem when exporting the video:
I'd like to be able to keep a hand on the parameters of the exported video, and ensure that the video will have the exact resolution of the cropped area. But I could not accomplish this.
Can someone tell me how to do this?
EDIT:
My source video is 1002 x 720 (so it's in landscape mode)
It contains a 316 x 562 portion I want to extract  (so, portrait mode)
The minimum I want is to be able to obtain a 316 x 562 video containing just the cropped section. The best I could obtain is a 632 x 1124 (or any other proportional scale) video on output.

I get the feeling there is a language barrier here, but it is really hard to make out what you are asking.  It sounds like you are trying to figure out how to get rid of the black borders around a video and then export such that there is no scaling applied to the portion that wasn't the borders.  Is that correct?

@AJHenderson:Yes, this is exactly what I meant.

I would probably approach it by first measuring the size of the area that you want to crop to.  This can be done by exporting a frame of the image and cropping in another program (like Photoshop).
I would then create a sequence based on the other settings of the video, but alter the resolution of the sequence to be that of the portion of the video you want.
After that, you should be able to bring in the video to the sequence.  By default, it will be come in at 100% of it's size.  It may not be perfectly centered in your frame though, so use the Motion settings under the effects control to position the actual video portion in the center of the frame.
You should then simply be able to export and the outside potions will be cropped off without any scaling.
This may seem a bit complicated, but it is the simplest way to do it since the default behavior is to fit the sequence to the size of the original clip and cropping doesn't do anything to change the sequence size.  That's why we have to start with the correct sequence size and when we have that, no crop effect is needed as only the content we want fits in the sequence.

Thank you, but it seems a little bit complicated. Before trying that, are you sure there is not a simplest way of doing ? Why a crop tool if this do not crop ?

Yes, I understand, but what I don't understand is what the crop tool is made for if it does not crop. In Photoshop, when you crop, it crops, no matter on what size you want to set the image or work area.

In Photoshop you aren't working on multiple items in one sequence. The dimensions of a clip are independent from the dimensions of the sequence. Crop functions as you'd expect but only alters the clip.

I found that using Adobe Media Encoder is much easier when just cropping.
Add the video to the queue and open the export settings.
On the source tab you can crop the video and there you can also enter how many pixels to remove at each side.
Remember to set the correct output size in the video tab on the right side.
Here is a screenshot showing how i did it:

That's what I was looking for! File > Export > Media > Source > Crop the output video > Crop Proportions > 16:9

This should be the best solution but for some reason 'match source' isn't actually respecting the crop. So I have to manually enter in the size. I hate AME so much. Such a clumsy disaster of a program.

Remember to set the correct output size in the video tab on the right side. ‼

If you come back there, I can't get it to work. It still export the video in the original resolution, I just have black borders everywhere instead of just left and right, and the actual video is smaller.
I am trying to crop a 4K video into a 4:5 format. Nothing that should be too complex, I just want it to remove pixels, not rescale the output.

I think I've found the easiest way!

Just crop the area you want.
Go to the Export window without worrying about the black margins showing.
Set the final resolution and export settings as you would want.
(THIS IS THE IMPORTANT ONE) On the top left of the Export Window, there are two tabs; SOURCE and OUTPUT. Go to the Source Tab.
On the left-most side, find the crop icon and activate it.
Now, MANUALLY crop the black margins out AGAIN.
Proceed to export.

I've been worrying about it all day and I am so happy now!
Thank you guys for the other answers that put me in the right direction.

This is the best solution! Also, I was searching how to crop in pixels instead of percent, and cropping on export is in pixels, nice.

Thank you, this worked...mostly. The only thing is while it crops the picture and centers it, it keeps the original canvas size. So if I have a really tall video and crop it to a square, the output is still a tall canvas with a square in the center.

Oliver, have you tried changed your sequence settings to the new dimensions?
You can also restrict/define dimensions in the export settings under 'Basic Video Settings'.
Hope this helps!

It is worth noting that the second option there would result in scaling up and then scaling back down at output.  You would need to match the sequence settings to the resolution of the actual image portion in order to avoid scaling.

I had the same basic problem, but mine was a little more complex.  I shot all the video footage on the same camera, and didn't need to crop any of the clips except the welcome speech clip.  I didn't realize it at the time, but in the frame was a kid picking his nose and eating his discoveries, not once but four times!  So I had to crop the whole frame, and then resize it so it would be the same size as the rest of the clips.  Here's what I did:
I opened up the clip I needed to crop in Premiere Pro, just that clip.  I cropped it by holding down the shift key to keep the proper proportions,  went to File - Export, and then Source in the upper left.  I cropped the black edges out again, and processed the video.  Once that was done, I imported the clip into the video I was working on, went back to the same time stamp in that clip as it was before, and inserted the clip right into where the original clip was with the nose picking going on.
There may be easier and faster ways to do this, but this worked for me, and I hope it will work for you, too.

Summarizing what I learned from this page and the steps I ended up taking to crop & make a new clip at that exact size:
Crop Video & Export at that exact new size
(e.g. for getting rid of any unwanted black bars):
Import video into Project Panel.
Drag onto Timeline Window to create a Sequence.
Choose In/Out points. (“i” and “o” keys)
File > Export > Media
Export Settings: Go to top left, click “Source” (so it’s blue), the Crop sign shows, and you can adjust your desired crop section right there, dragging the crop lines or via precise pixel info. Video & adjustments should be visible.
At the bottom of that window set Source Range to “Sequence In/Out,” so Premiere is only working on the segment you actually want.
On the right, within the same Export Settings window, you may have to enter the new video dimensions, after deducting the pixels that you ended up cropping out in the left side of the window. Then on the right side, under “Video,” find “Basic Video Settings,” Width and Height, make sure to UN-check those check marks that would force you to keep the old/original dimensions and image ratio. Then enter the new pixel info.
Scroll that same window up to get to the (currently still undisplayed) Bitrate Settings and choose the appropriate Bitrate.
(etc.)
Double-check in the right side of the window under “Summary” - “Output” that all the values are correct.
Then Export.
This will give you the cropped video as intended, in the new specified format size.

After Effects has an concept of 'region of interest', and you can crop a video clip visually to the size you want. You can then crop the composition to the same size and export that. This was  a much better solution for me trying to crop a video where the subject moved within the frame.
Premiere is first and foremore a video editing program, so if you're looking to arbitratily crop a video/sequence you're going to get a headache trying to do it.
Another important thing to be aware of it that if your final destination is web you'll need to make sure that you don't end up with single black pixel border around the image. For instance I just used the above technique and on iOS I get a single pixel black border at the bottom and on Windows I get a single pixel black border on the right hand size. It is some kind of rounding problem with the video encoder or decoder and not due to anything in the source video. I'm still struggling with this particular issue - and I've heard that mp4 prefers multiples of 16 for dimensions but that doesn't seem to be helping. Something to be aware of though if you have a video that needs to 'float' on the page seamlessly.


text:
FFMPEG Trying to make a 8K 30 FPS MP4 video out of several hundred 8K PNG images
I have been trying to make an 8K MP4 video @ 30 FPS out of a few hundred 8K PNG images using FFMPEG since forever, but to no avail. The PNG images are serially numbered, starting from 000000 and going like 000001, 000002, 000003 etc. They are also in the same folder as the FFMPEG directory.
This is the command I am using:
ffmpeg -framerate 30 -i 000%3d.png -pix_fmt yuv420p out.mp4`
I have tried various other permutations of the command but no joy. Any help is appreciated.
UPDATE:
I renamed all my PNG files to the following format: pic000.PNG, pic001.PNG, pic002.PNG etc.
After doing that I ran this command:
ffmpeg -framerate 30 -i "pic%03d.png" -level:v 6.0 -pix_fmt yuv420p  output.mp4 -report
Here is the error report:
ffmpeg started on 2023-03-23 at 20:58:19
Report written to "ffmpeg-20230323-205819.log"
Log level: 48
Command line:
ffmpeg -i "picC:\\Users\\User\\Videos\\FFMPEG\\tif-to-mp4.bat3d.png" -framerate 30 -level:v 6.0 -pix_fmt yuv420p output.mp4 -report
ffmpeg version 2022-01-30-git-1530b3f566-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable  libavutil      57. 19.100 / 57. 19.100
  libavcodec     59. 20.100 / 59. 20.100
  libavformat    59. 17.101 / 59. 17.101
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 26.101 /  8. 26.101
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
     Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'picC:\Users\User\Videos\FFMPEG\tif-to-mp4.bat3d.png'.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '30'.
Reading option '-level:v' ... matched as AVOption 'level:v' with argument '6.0'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option 'output.mp4' ... matched as output url.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url picC:\Users\User\Videos\FFMPEG\tif-to-mp4.bat3d.png.
Successfully parsed a group of options.
Opening an input file: picC:\Users\User\Videos\FFMPEG\tif-to-mp4.bat3d.png.
[NULL @ 000001716758de40] Opening 'picC:\Users\User\Videos\FFMPEG\tif-to-mp4.bat3d.png' for reading
picC:\Users\User\Videos\FFMPEG\tif-to-mp4.bat3d.png: Protocol not found
Did you mean file:picC:\Users\User\Videos\FFMPEG\tif-to-mp4.bat3d.png?

What happens?..

@Gyan Nothing really. I execute the BAT file but nothing happens. No file is outputted and I don't get any errors.
Thanks for commenting btw!

Add -report to the ffmpeg cmd and rerun. Share report file.

@Gyan I have modified my question to include the error report.

This is the input url that ffmpeg sees: -i "picC:\\Users\\User\\Videos\\FFMPEG\\tif-to-mp4.bat3d.png"  . See the last two lines.

@Gyan Why is that happening? I modified the source PNG file names to the pic000.png sequence and used -i pic%03d.png as the input argument. So what am I doing wrong?

Are you executing a bat file or just the ffmpeg command?

I am executing a bat file. Don't worry about it though. I was able to figure it out.
Added an extra % sign like so: pic%%03d.png, which made it work. This is on Windows 10.


text:
Do Premiere, After Effects and Adobe Media Encoder support huffyuv lossless codec?
Can the lossless HuffYUV codec be incorporated into the workflow of a VFX pipeline as an intermediate codec, given ample hard disk space?
I read that since Premiere and After Effects are now 64-bit and commonly HuffYUV is just 32-bit, that might pose problems. However, a x64 version is now available.
I would like to get opinions on a HuffYUV workflow, possible drawbacks and a complete installation guide with suggested settings to use, thanks!

They do on Windows, you need to use the AVI container as HuffyUV isn't available as a quicktime codec, afaik.
I used huffyUV for a while, but have switched to magicYUV which has a better range of colour space support (including 10-bit in beta).  UTVideo is another good option and is available for mac.
With the Premiere - After Effects - Media Encoder workflow I find that exporting to a flattened movie only happens when I am making the final master, I use Dynamic Link for the intermediate transfers from say AE to Premiere. As well as saving disk space it's faster and easier because you can make changes and have them update on the fly.
So for final masters these lossless codecs are great, with the one caveat–they may not be supported in the long term. Mostly they are developed by small teams or even a single person, so if they get a full-time job or have twins the project might tank. If you're making masters that need to be available for the long term – as in decades, then FFV1 is a good option, though for everyday use as an intermediate codec it's a bit slow.

Thank you for the clear reply, here my toughs: Dynamic Link is a good solution for light projects, but especially for AE and pre-compositions tends to get glichy and slow, that's why is something I not always use. About the codec aging and it's possibility to being portable in future they said to avoid Lagarith and other smaller codecs for the same reasons claiming Huffyuv as more supported around the globe, but i will give FFV1 definitively a try. Thanks! PS: FFV1 is supported by ffmpeg foundation right? So we have big chances that it will be always readable in future ?

Yep, that's the idea about FFV1. It's actually been adopted by a couple of archival institutions as a long-term archival format, including the Austrian film archive. With Dynamic link and heavy AE projects, I often pre-render and use a proxy while I'm working. Then at the end I delete the proxy before I master.

Being lossless the video is bit to bit identical to a Huffyuv one right? Only not so performant on cpu side during encoding (or also on decoding) ? In this case for archival I will use for sure FFV1 !

Yes, FFV1 is mathematically lossless. So input === output. We tested it before we adopted it. I believe that they've been working on improving the speed too.

Very nice, I will stay tuned so ;)


text:
Predict file size of a Huffyuv codec video stream
I like to do many comparisons and check before picking a codec and selecting its settings.
Settings with HuffYUV are few but more importantly I'm having trouble determining video file sizes.
Given pixel width, height and pixel format, is it possible to predict a file size for a video encoded with the HuffYUV lossless codec?
I would like to prepare a simple converter to get an estimate of how much space it takes hours, minutes, seconds ;)
Which formula can I use? I'm OK even if you throw me out a complex model, I'm kinda a math guy.
ps: I know my english is poor and is also a bit late so if you good guys think this question could be edited in a better way feel free to do it ;D

The answer is No. Besides the frame dimensions, there's the matter of content complexity. Without scanning the video and doing a first-pass as it were, it's not possible to predict the output size. A video consisting of a slideshow of very simple text slides will be much easier to compress than scenes of busy city life..etc.
The closest you may come to making some sort of prediction is to encode a few representative segments from the source file and compare those bitrates. If there isn't a large difference among the bitrates of the various encoded segments, then you may assume a bitrate in that range for the final output. Of course, this method can't account for anomalous segments in the video of very high or low complexity compared to the rest of it, so sample selection is important.

I see, so in this case I think will be need a different approach: grab tons of segments of videos of any different kinds, all of the same size eg: full hd would be a good starting point. Batch convert them all with huffyuv for a small amount of time, let's say not more than 3 min, do a statistical analysis of the file sizes getting a plain average, a maximum and a sort of "flavored average" for video with text, heavy media, and different categories content. Get your coefficients, prepare a simple calculator based on this coefficients. :)

My approach requires encoding multiple segments of the same duration from within the same video to a) check resulting bitrates and b) variance of bitrate across the segments. HuffYUV uses intraframe compression, so no need to use segment size of 3 minutes. In fact, make it closer to a few seconds.

Thank you for the suggestion, I'm tempted to bring some media here and do the tests. Yeah, your approach is the most correct for obtain the result of a single video, and better fit the original question. My final goal however was understand how in average a Huffyuv video will take.

Would be nice if you could help me setup the test environment, what is your recommendation ? 5 seconds could work ? or 10 in order to sample more frames ? there's a way for start a chat here or i have to reach like 7-8 comments ?

5 seconds is good. I'm not a coder, but if you are, you can write a script to pick N random numbers from 0 to D-5 where D is the duration of your input file. Then just execute   ffmpeg -ss T -t 5 -i input -c:v huffyuv -an "input-T.avi"    where T are the numbers you generated, one by one. It's upto you what statistical analysis you wish to perform with the resulting files, but mean and SD comes to mind. Consult the stats SE, maybe.

So you talking about of using a single file but scraping randomly 5 seconds many times in order to obtain a consistent result? I was thinking about something like that, I mean avoiding take let's say 100 movies but the first 5 seconds because in the most of the cases will be just written text and black background because of initial credits. PS: Yes i can code something ;)

The 100 files approach doesn't seem useful - it's like computing the nutritional value of a food item by averaging the nutritional values of fruits, meats, grains, nuts..etc. Even among fruits, there's significant difference in sugar levels, so it's just not that useful.

What I want to achieve is a bit broader average on what Huffyuv takes per minute, some people talk around 400MB in Full HD I want to check this theory and use this math info for predict a worst case scenario for storage requirements.

Worst case scenario is a video with a lot of noise. Take any video, add random noise using ffmpeg filter and encode to HuffYUV. A text slideshow is best-case scenario. A static camera talking head video is low-moderate scenario.

Let us continue this discussion in chat.

For 1080p, I often stick with.. (80 secs) - equals close to the 4gb limit.

It's realistic to assume so around 3.0 - 3.2 GB per min at 1080p I guess..


text:
Streamable Container for HEVC (H.265)
flv is a container which can be used to stream videos while they are being encoded. flv supports h.264 codec.
However, flv doesn't support hevc codec. Is there any container for hevc which is streamable?

MPEG -TS. See here:

All MPEG-2 TS operations from GPAC (client and MP42TS) are supported on
    HEVC. MP42TS can be used to generate TS files usable for DASH or for
    injection in modulation chains; it can also be used to send the TS over an
    UDP or RTP stream in unicast or multicast mode

I was not aware of GPAC. Will have to look into it. Let's see if this works. I'll update after trying it out. Thanks :)

It also works on ffmpeg with libx265

@aergistal How? Can you elaborate?

@shivams Eg: ffmpeg -re -i <input> -c:v libx265 -c:a ... -f mpegts udp://... You can also output it in HLS: ffmpeg -re -i <input> -c:v libx265 -c:a ... playlist.m3u8

apart from mpegts , what are other formats are supported. I want to stream video to an rtmp URL using h265. So do I have flv as the only option or are there any options that I can use for libx265?

When I use -f mpegts Nginx RTMP didn't accept it and did not generate .m3u8 file I got nginx 404 Not Found  message when I use this command ffmpeg  -re -i <input> -s 634x360   -vb 110k -c:v libx265 -preset ultrafast -c:a aac -ab 38k  -ar 44100 -f mpegts  rtmp://localhost/hls/live

RTMP requires -f flv. m3u8 is a playlist for HLS which does not stream over RTMP but over HTTP(S).

A bit old one but Google still lists it...
You can of course use RTSP "push" similar way as you'd do via FLV/RTMP. A bit less known method but also viable and supports H.265 (aka HEVC).

Thank you @Pavel. Could you elaborate a little more on how to do it? Or some references for the same?

Short and self-explanatory example would be: ffmpeg -i input -f rtsp -rtsp_transport tcp rtsp://localhost:8888/live.sdp - taken from FFmpeg official Streaming Guide, tested against Wowza Streaming Engine.


text:
Is it possible to mask out unsharp areas of footage with After Effects?
Is there any existing filter/effect, that will automatically mask out the unsharp area of my footage?
Let's say I have an object in focus and a lot of depth of field. How do I show only my sharp object?

As you may know from 3d packages depth information can be represented by a 2d Depth Map:

In therory it's possible to detect the defocused area of an image via depth estimation methods and generating a depth map using this information. The algorithm splits up the image by finding all relevant edges, analizes the gradient values and compare these areas with each other. I doubt that this is accurate enough for every shot, but could work in some cases. One of the latest papers, you can find here:  http://www.sjzhuo.net/defocusEstimation/
AFAIK there is only one available plugin for After Effects at the moment: http://www.yuvsoft.com/stereo-3d-technologies/automatic-depth-estimation/, but since this process is becoming increasingly important for stereoscopic workflows, it's a matter of time when more tools will become available.

thanks a lot man! Really interesting topic. I will give the plugin a shot and let you know if it worked for me:) thanks @poor

@SlimMarten You're welcome! Ok, great - keep me posted!


text:
How to Overlay Text in Premiere Pro or After Effects?
I am a newbie to both Premiere Pro and After Effects.  We are making exercise instructional videos and want to overlay text instructions - very much like this video:

.
What would be the recommended way to do this. We have both Premiere Pro and After Effects.
Thanks for any assistance/tips.

Premiere Pro have more basic text tools, but it is easier to work with. Also, it is better for long files.
After Effects allows you to manipulate with your text in much more various ways. You can use there more different text effects. But it is also more complicated.
So, it is up to you to decide. If you are looking for something basic, use Premiere. If you want to use some fancy effects, then use After Effects.
For example typewriter effect, which is used in video in your question is one of the standard AE effects. You can also achieve that with Premiere Pro, but you will spend more time on each text.

Shultc, thank you for the tip. So what I've done is created the basic video in Premier Pro (it was relatively easy).  My partner created the intro and outro in AE.  So now, I guess what I need to to is to bring in my exercise video (https://www.youtube.com/watch?v=-VUMfF45Azo) into AE, do my text overlay and loop the video if I need more time. Thanks! Your tip was very helpful!

If you want to use both programs you can use dynamic links
https://helpx.adobe.com/after-effects/using/dynamic-link-effects.html

I place text overlays in my Premiere Pro videos several times a week. (I produce a video every day.) Premiere Pro has a "Title" menu with many options:

Once you create a Default Still, Default Roll, or Default Crawl, you can drag it onto your timeline, size it, change the duration of it, and even animate it if you want to.

This can be accomplished both in Adobe Premiere and After Effects just like Shultc said.
You can start and use the After Effects Preset(default text effects) as you go along and start to use more advance effects and animation such as lower thirds, text reveal etc...
How to access and use adobe presets

What I usually do is to create a templates for different overlay text effects in after effects so whenever I want to use those specific effects I will just open that file and drag the video.
Same goes for intro and outro were in this allows you to save more time from creating the effect again from scratch.


text:
How to create slideshow/video from still images using a varying point of interest?
I have still images of a motorcycle's odometer, taken by hand whilst riding (varying angles) over the course of a 20000km motorcycle journey (i.e. the odometer is not always centered in the still image).
I plan to create a slideshow/video from these stills, but I would like to align the odometer to the centre of the frame, so that the viewer can focus on the increasing mileage as the stills are played in a timelapse/slideshow fashion, rather than have the odometer jitter around.
Does anyone know of any software that would allow me to quickly select the area of the odometer for each image, and then have the software rotate or pan the images based on this manually defined 'odometer region'? Or another method that is somewhat automated as opposed to adjusting each image inside Premiere Pro.
I hope this make sense...!
Thanks.

You can import all the images as a video i.e. an image sequence and then try to stabilize the "video" by selecting a distinctive part of the odometer as your target anchor. The result may still need some manual tweaking especially if there's a huge change in light, but it will be faster than doing it manually.
You might have to rename the images to form an unbroken naming sequence  i.e. img0001.jpg, img0002.jpg, img0003.jpg..etc. You can use Advanced Renamer to do this.

You can import all of the images into Photoshop as layers (File>Scripts>Load to Stack).
On import you can auto-align the layers (check the box that says auto-align) or following the import you can go to (Edit>Auto Align-Layers).
You could then create the video in Photoshop via the Timeline function if you wished - or export the aligned individual layers as JPEGS and import them to Premiere.

Both answers are good suggestions. All sorted. Many thanks alt-5 and Mulvya.