text:
ffmpeg split file retains original length
I've losslessly extracted 30m from a ~1.5h long video using the following ffmpeg command:
ffmpeg -ss 0 -t 00:30:00 -i in.mp4 -acodec copy -vcodec copy out.mp4

The split was successful and out.mp4 was created with the first 30m.
However... even though the video stops after 30m, video players such as VLC and Windows Media Player show the video length as still being ~1.5h long, and so does Windows Explorer when the file is selected.
How come the video length shown is different than the actual video length?
How can I adjust it so they will match?
I'm on Win7 using ffmpeg 64bit static from Feb 10th 2015.
Also, here is the output of the process:
ffmpeg version N-69672-g078be09 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-l
ibrtmp --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 --ena
ble-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 18.100 / 54. 18.100
  libavcodec     56. 21.102 / 56. 21.102
  libavformat    56. 19.100 / 56. 19.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5.  9.104 /  5.  9.104
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000307fe0] overread end of atom 'colr' by 1 bytes
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2015-02-11 15:31:12
    encoder         : HandBrake 0.9.8 2012071700
  Duration: 01:33:46.64, start: 0.000000, bitrate: 2556 kb/s
    Chapter #0:0: start -0.160000, end 301.040000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 301.040000, end 600.560000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 600.560000, end 901.040000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 901.040000, end 1200.560000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 1200.560000, end 1501.040000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 1501.040000, end 1800.560000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 1800.560000, end 2101.040000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 2101.040000, end 2400.560000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 2400.560000, end 2701.040000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 2701.040000, end 3000.560000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 3000.560000, end 3301.040000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 3301.040000, end 3600.560000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 3600.560000, end 3901.040000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 3901.040000, end 4200.560000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 4200.560000, end 4501.040000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 4501.040000, end 4800.560000
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 4800.560000, end 5101.040000
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 5101.040000, end 5400.560000
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 5400.560000, end 5626.640000
    Metadata:
      title           : Chapter 19
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 720x576 [SAR 768:715 DAR 192:143], 2391 kb/s, 25
 fps, 25 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2015-02-11 15:31:12
      encoder         : JVT/AVC Coding
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
    Metadata:
      creation_time   : 2015-02-11 15:31:12
    Stream #0:2(und): Subtitle: mov_text (text / 0x74786574)
    Metadata:
      creation_time   : 2015-02-11 15:31:12
Output #0, mp4, to 'out.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    encoder         : Lavf56.19.100
    Chapter #0:0: start 0.000000, end 301.040000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 301.040000, end 600.560000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 600.560000, end 901.040000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 901.040000, end 1200.560000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 1200.560000, end 1501.040000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 1501.040000, end 1800.560000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 1800.560000, end 2101.040000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 2101.040000, end 2400.560000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 2400.560000, end 2701.040000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 2701.040000, end 3000.560000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 3000.560000, end 3301.040000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 3301.040000, end 3600.560000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 3600.560000, end 3901.040000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 3901.040000, end 4200.560000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 4200.560000, end 4501.040000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 4501.040000, end 4800.560000
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 4800.560000, end 5101.040000
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 5101.040000, end 5400.560000
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 5400.560000, end 5626.640000
    Metadata:
      title           : Chapter 19
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x576 [SAR 768:715 DAR 192:143], q=2-31, 2391 kb/s, 25 fps, 25 tbr, 90k tbn, 90
k tbc (default)
    Metadata:
      creation_time   : 2015-02-11 15:31:12
      encoder         : JVT/AVC Coding
    Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 159 kb/s (default)
    Metadata:
      creation_time   : 2015-02-11 15:31:12
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=45000 fps=5763 q=-1.0 Lsize=  590048kB time=00:30:00.00 bitrate=2685.4kbits/s
video:553577kB audio:35153kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.223870%

Here's the output of ffmpeg -i out.mp4:
ffmpeg version N-69672-g078be09 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-l
ibrtmp --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 --ena
ble-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 18.100 / 54. 18.100
  libavcodec     56. 21.102 / 56. 21.102
  libavformat    56. 19.100 / 56. 19.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5.  9.104 /  5.  9.104
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.19.100
  Duration: 01:33:46.64, start: 0.000000, bitrate: 859 kb/s
    Chapter #0:0: start 0.000000, end 301.040000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 301.040000, end 600.560000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 600.560000, end 901.040000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 901.040000, end 1200.560000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 1200.560000, end 1501.040000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 1501.040000, end 1800.560000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 1800.560000, end 2101.040000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 2101.040000, end 2400.560000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 2400.560000, end 2701.040000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 2701.040000, end 3000.560000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 3000.560000, end 3301.040000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 3301.040000, end 3600.560000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 3600.560000, end 3901.040000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 3901.040000, end 4200.560000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 4200.560000, end 4501.040000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 4501.040000, end 4800.560000
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 4800.560000, end 5101.040000
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 5101.040000, end 5400.560000
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 5400.560000, end 5626.640000
    Metadata:
      title           : Chapter 19
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 720x576 [SAR 768:715 DAR 192:143], 2519 kb/s, 25
 fps, 25 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574)
    Metadata:
      handler_name    : SubtitleHandler
At least one output file must be specified

Please include the complete console output from your command. Which players specifically are you using?

@LordNeckbeard - see updated question :)

@LordNeckbeard - see second update at the bottom of the question :)

@LordNeckbeard - I'm hanging my hopes up, so please let me know even if you don't know the answer ;)

Does it make a difference if you remove -ss 0? What if you move -t 00:30:00 after the input so it gets used as an output option instead?

@LordNeckbeard - yup, moving -t to after the input -i did the trick.. Write it as an answer and I'll accept it :)

btw, I see it as a design flaw. I think command arguments should be as order-agnostic as possible

Option placement does matter, but -t is both an input and output option, so I'd assume it wouldn't really matter. Perhaps you found a bug. Does it occur with all inputs, or just a certain one(s)? I can't duplicate the issue.

As @LordNeckbeard wrote in the comments, moving the -t flag to after the -i flag works:
ffmpeg -ss 0 -i in.mp4 -t 00:30:00 -acodec copy -vcodec copy out.mp4

Or use -shortest as an output option.  I think what's going on is -t maybe applies to only one of the streams in the input file, or something.


text:
Is there a "Lightroom for Video" product?
I'm doing photography, audio recording, and video just for fun.  I have a full Creative Cloud subscription.  I mention this to help clarify my fundamental objectives and very limited perspective and experience.
It appears to me as if folks consider video more "one time use" than still photographs in that there are things that help a work flow for a project.   But my main concern right now is just keeping track of things.  And this is where "Lightroom for Video" idea comes from.
LR allows me to add tags.  Tweak the original.  Create virtual copies and tweak them uniquely.  Group photos into "collections" (in addition to the underlying file system / folder structure).  And it even allows me to geotag them now so I can find them by location.  I'm assuming that I will find these features useful for videos as I shoot more and more.
I can add the videos to LR and I can do some of these features but its clear that LR really isn't happy.  I'm not sure why but the performance was rather horrid after ingesting 500G of videos last weekend.  It seems, perhaps, to have recovered by now.
The basic question is: what is the closest thing to LR for videos that you know of given what I view as LRs features above.  For example, it would be neat if I could create a "virtual" copy and add in and out points.  Indeed, it would be nice if there was a way to catalog Premiere sequences so I could quickly find and re-use them.  Honestly, my desires extend to Audition as well so I could take a waveform, make a copy and apply destructive "process" to it, but still keep it "with" the original and properly tagged so I can find it, understand what I did with it, and re-use it or at least use it as a starting point later on.
I see that Adobe has "Prelude" but light surfing says that its not intended for one-man shops but more for work flows involving lots of people.  But, it appears to have some features for "ingest" that Premiere does not have.
Edit:
I am using Adobe Premiere and their other products.  As I mentioned, I have a full CC subscription.
Perhaps I'm missing something but I don't see how I can search metadata or even easily "see" things like sequences of other projects.  I can keep track of things via the file system but that level of "keeping" track is rather primitive.
An analogy is email.  Originally, I kept track of email via folders and I had to hunt and search for things.  Now, with all the search tools at my finger tips (e.g. Apple's Spotlight or Google's GMail search) I can search and find things instantly.
Also... there are times when copies are made... in particular Audition has destructive "process"es that alter the copy it is working on so if you want the original, the user must make a copy first.

Take a look at Media Asset Management systems. There are some SaaS offerings that might be practical for your needs. And expect even more announcements with NAB only just about a week away.

Honestly what you're describing sounds like a non linear editing system, e.g Premiere. Premiere works non-destructively, so if you import your clips into a project you can add in and out points that do not affect the original clips. You can also move clips to bins (≈ folders) to organise them without moving them in the file system, and there's a heap of metadata that you can add (right click on the column headers in the project window to see the available options)

I think the closest thing to what you are talking about is Adobe Prelude.
It's custom built for content ingestion, logging and metadata of video content.
Depending on how many people are involved in your workflow and how much time you have budgeted, this could be a helpful part of your workflow. However, if you're a one-man shop, you might need to adjust your expectations of how long tagging and sorting video content will take.

Short answer, there is not really any "Lightroom" for video. But there are non linear editing programs out there that do all the things you want to do with your footage. So, as someone else said here, you want to start using Premiere or some other editing program.
Learn how to organize your projects professionally. You're never going to make duplicates of files (except in some circumstances), but you are going to create duplicates of edits, string-outs, sequences, clips, etc.
So, here's a typical project organization, inside Premiere in this instance (make a clean version of this project, call it "Default", and simply open it and save it with another name each you work on a new project; that way you don't have to re-create all those folders all the time):

And here's an example of drive organization:

Thanks.  I am using Premiere Pro and other CC products.  As far as I know, I can't really search within a project from outside or from another project.  Am I missing something?

No, you can't. You can import projects and/or individual sequences from other projects (as you surely know), but you can't search other projects from inside an opened project. I'm a pro-editor and I've never had the need for this function. Not sure why you would need it. Maybe change the way you are working or looking at the problem you're facing in a different way?

source: Stack Exchange

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

sort: votes


text:
How to change the pace of imported mov video clip in after effects
Sorry for noob question or a possible duplicate.
We got a .mov inside a AE project. What we are trying to do is change the tempo of this so duration isn't 4 sec for example, but instead cause our audio is 6 seconds we would like it to simply scale in time so it becomes 6 seconds.
Is there a way to do it?

Method 1
The Last column on the right — in your pic it says растягиваться but in the English version of AE it's called Stretch — that's the one you need to modify Click on the number that says 100%.
Alternatively, select the layer and from the Layer menu choose Time>Time Stretch… (I'm not sure what it is in Russian).
Then you'll get a dialog that lets you choose the duration you want, or a stretch factor if you want to choose the playback speed.

Method 2:
Apply Time Remapping to the layer (choose Layer from the menu or Right-Click the layer and then choose Time>Enable Time Remapping or hit cmd/ctrlalt/optionT).
This will create a keyframe at the start and end of the layer.
Drag the last keyframe to the point where you want the layer to end.
Method 3
Park the playhead at the time you want the layer to end.
With the layer selected hit ctrl/commandalt/option,, which will stretch the out point to the current time.
You can do the same with the in point using ctrl/commandshift,.

It is called "stretch" in the english version. I checked.  If you ever edit this post, you can remove that question mark.  I just don't want to edit it to make a single-character change.

The question mark was because the sentence starts with "See the last column…" I've rewritten it, thanks.

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


text:
How to resolve ffmpeg error cannot load default config file?
I have got this error message when using ffmpeg
[Parsed_drawtext_0 @ 03bdc300] Could not load font "/Library/Fonts/DroidSansMono.ttf": cannot open resource
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 03bdc300] impossible to init fontconfig
[AVFilterGraph @ 03d9b840] Error initializing filter 'drawtext' with args 'fontsize=15:fontfile=/Lib
rary/Fonts/DroidSansMono.ttf:timecode=00\:00\:00\:00:rate=25:text=TCR\::fontsize=72:fontcolor=white:
boxcolor=0x000000AA:box=1:x=860-text_w/2:y=960'
Error opening filters!

Does anyone know how can I resolve this issue?
I'm using ffmpeg on Windows 7. I've downloaded ffmpeg from ffmpeg.zeranoe.com/builds
This is what I entered and what came up:
c:\ffmpeg\bin>ffmpeg -i in.mts -vf "drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: timec
ode='09\:57\:00\:00': r=25: \x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1"
-an -y out.avi
ffmpeg version N-70634-g3bedc99 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzli
b --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --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 --enab
le-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 12.100 /  5. 12.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'in.mts':
  Duration: 00:00:23.42, start: 1.040000, bitrate: 9937 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1440x1080 [SAR 4:3 DAR 16:
9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
[Parsed_drawtext_0 @ 02ac2f20] Could not load font "/usr/share/fonts/truetype/DroidSans.ttf": cannot
 open resource
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 02ac2f20] impossible to init fontconfig
[AVFilterGraph @ 03cdb840] Error initializing filter 'drawtext' with args 'fontfile=/usr/share/fonts
/truetype/DroidSans.ttf: timecode=09\:57\:00\:00: r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box
=1: boxcolor=0x00000000@1'
Error opening filters!

c:\ffmpeg\bin>

Please show the actual command and the complete console output.

I have entered my info by editing my original question. let me know if I need to include anything else @LordNeckbeard

You're on Windows, but your path to the font looks like *nix.

I see. What should the path look like for the windows?

Got it. The error is cuased by the font location in the command is of a Linux computer. The font location need to be different for windows.
The error caused by this line in the command: drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf
The above line does not work in Windows.
For windows change to: drawtext=fontfile=/Windows/Fonts/arial.ttf

Using this drawtext in a program I wrote to embed Created dates into images, I found that you have to escape some characters like colons and backslashes using some versions of FFmpeg with the '\' escape character as you did in the timecode sequence. Also enclose paths in single quotes for possible spaces in path or name:
drawtext=fontfile='c\\:\\\Windows\\\Fonts\\\Times.ttf'

or
ffmpeg -i in.mts -vf "drawtext=fontfile='C\\:\\\Windows\\\fonts\\\truetype\\\DroidSans.ttf': timecode='09\\:57\\:00\\:00': r=25: \\x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y out.avi

Also some fonts contain multiple .ttf files like Times New Roman.  Double clicking this shows Times New Roman Regular, Times New Roman Bold, etc. Times new Roman Regular properties shows its name is Times.ttf.  Be sure to use the correct one.

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


text:
Detect GoPro camera model from MP4
I have raw video file named GP010661.MP4, which seems to be taken with GoPro. Is there a way to detect the exact GoPro camera model and mode used for this video?
This is the the output of ExifTool:
ExifTool Version Number         : 9.46
File Name                       : GP010661.MP4
Directory                       : .
File Size                       : 3753 MB
File Modification Date/Time     : 2014:11:27 09:37:20+03:00
File Access Date/Time           : 2015:02:19 09:22:46+03:00
File Inode Change Date/Time     : 2015:02:19 09:22:46+03:00
File Permissions                : rw-r--r--
File Type                       : MP4
MIME Type                       : video/mp4
Major Brand                     : MP4 Base w/ AVC ext [ISO 14496-12:2005]
Minor Version                   : 0.0.0
Compatible Brands               : avc1, isom
Movie Header Version            : 0
Create Date                     : 2014:11:27 11:19:55
Modify Date                     : 2014:11:27 11:19:55
Time Scale                      : 90000
Duration                        : 0:17:25
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 2014:11:27 11:19:55
Track Modify Date               : 2014:11:27 11:19:55
Track ID                        : 1
Track Duration                  : 0:17:25
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1920
Image Height                    : 1080
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : avc1
Source Image Width              : 1920
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Compressor Name                 : .GoPro AVC encoder
Bit Depth                       : 24
Color Representation            : nclc 1 1 1
Gamma                           : 2.2
Video Frame Rate                : 59.94
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2014:11:27 11:19:55
Media Modify Date               : 2014:11:27 11:19:55
Media Time Scale                : 48000
Media Duration                  : 0:17:25
Handler Type                    : Audio Track
Handler Description             : .GoPro AAC
Balance                         : 0
Audio Format                    : mp4a
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 48000
Movie Data Size                 : 3933436091
Movie Data Offset               : 1474560
Avg Bitrate                     : 30.1 Mbps
Image Size                      : 1920x1080
Rotation                        : 0

The reason I need it, is that file chokes on my Ubuntu 14.04 with VLC and I couldn't even watch it. It took few days to recode the videos, and I do not want to run into the same problem again. If I know the camcoder model and mode, I can to ask people to use different camera or settings.

What are the specs of your computer?

@kazanaki, Intel® Pentium(R) D CPU 3.20GHz × 2, 8 Gb

Well your system is powerful enough. If you play the video with mplayer or xine does it still choke?

@kazanaki, mplayer doesn't choke, but it plays the video like 2x slower (audio is too quiet, but speed ok). Actually, mplayer warns after some time Your system is too SLOW to play this!

@kazanaki, wow xine did it. Sound is ok, picture is smooth and fast.

Ok. I added it as an official answer. Mplayer has a lot of backends (even an openGL one) so you might want to experiment. If xine works fine and you are happy then of course use that to view the videos..

MP4 files don't have as much data as .JPEG or .CR2 files so there is probally no way to know. Your cpu is that fast and GoPro footage is hard for the computer to play.

This video is 1080p at 60 fps and 30Mb/s.
That rules-out quite a lot of cameras in the GoPro range. From the current generation, only the GoPro Hero4 Silver and GoPro Hero4 Black are capable of grater than 25Mb/s. In the previous generation, only the top-end GoPro Hero3+ Black was capable of more than 25Mb/s.
Your video was almost certainly captured on one of these three cameras.

Yea, it suxx that guys could not choose file format that allows to store diagnostic information along with video data.

None of the data provided seems to be useful in identifying the camera model.  The best bet would probably be to ask the people who shot the footage about it.  They may remember which camera they used for the shoot.

I still have the file produced by the camera. Maybe that information just not in EXIF tag?

It is possible that exiftool couldn't read the particular tag maybe, but probably unlikely.  I believe EXIFtool is usually pretty complete.  Sometimes it outputs a code that may not be human readable, but I don't see any such values.

Perhaps your VLC installation has a problem.
If you try with an alternative player it might work! (like mplayer or xine)
Your system is powerful enough to handle GoPro videos.
Perhaps try installing the windows codecs in mplayer and also make sure that X-Windows has the xvideo extension enabled (any any other video related extensions)

Well, installing xine fixes the problem with slow playback, but it is still doesn't explain how to

Maybe xine is compiled with different flags than vlc. Especially the backend options for actually rendering the video.

The filename suggests that it's not a HERO6 Black, & HERO7 (White, Silver, Black) GH01xxxx.mp4 or GX01xxxx.mp4, but an older HERO with the filename pattern GOPRxxxx.mp4.
Camera Models: HD HERO2, HERO3, HERO3+, HERO (2014), HERO Session, HERO4, HERO5 Black, HERO5 Session, HERO (2018)
Single Video GOPRxxxx.mp4
Example GOPR1234.mp4
Camera Model: HERO6 Black, & HERO7 (White, Silver, Black)
Single Video GH01xxxx.mp4 or GX01xxxx.mp4
Example GH011234.mp4 or GX011234.mp4
See at gopro website for more details https://gopro.com/help/articles/question_answer/GoPro-Camera-File-Naming-Convention

Welcome! "See this link" answers are discouraged here in case they become unavailable in the future. Please try to summarize or paraphrase the contents of the link in your answer so that future readers can benefit from it.

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


text:
quickly extract video frames with ffmpeg
I am using ffmpeg to extract frames from videos. I have the following code thus far:
ffmpeg -i vid.mp4 -vf fps=1/10 images%05d.png

My issue is that it takes awhile! 6 seconds per image on average. Is there a way to speed this up? I am working with tens/hundreds of videos and I'm wanting to write up a shell script to automate the whole thing, but I don't want it to take days!
I have seen other programs that can do this but they have to literally play through the video to reach the frames to extract. That would be far too slow. Perhaps ffmpeg is doing something like this?
Any ideas how to speed this up?
The videos at hand are 1920x1080 GoPro videos and I'd like full resolution images.
Here's the output from the console:
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfdk-aac --enable-libfaac
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vid.mp4':
  Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: mp41mp42isom
creation_time   : 2015-09-18 03:38:20
  Duration: 00:01:18.23, start: 0.969178, bitrate: 20388 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 20004 kb/s, 29.97 fps, 29.97 tbr, 180k tbn, 59.94 tbc (default)
Metadata:
  creation_time   : 2015-09-18 03:38:20
  handler_name    : Core Media Video
  encoder         : GoPro AVC encoder
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
  creation_time   : 2015-09-18 03:38:20
  handler_name    : Core Media Audio
[swscaler @ 0x7fdb12000000] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'images%05d.png':
  Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: mp41mp42isom
encoder         : Lavf56.36.100
Stream #0:0(und): Video: png, rgb24, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 0.10 fps, 0.10 tbn, 0.10 tbc (default)
Metadata:
  creation_time   : 2015-09-18 03:38:20
  handler_name    : Core Media Video
  encoder         : Lavc56.41.100 png
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
frame=    9 fps=0.2 q=0.0 Lsize=N/A time=00:01:30.00 bitrate=N/A
video:17647kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

I have no idea if what you're doing is optimal, but "playing the video" to extract frames is essentially what has to happen, at least a little, if the frame you're extracting is not an I-frame (most frames are not).
The chosen frame is likely represented as the accumulated differences since the last complete frame, which is what interframe compression does. In order to extract it, a program must read and reconstruct the intervening frames -- not from the beginning of the video, just from the most recent complete frame
Depending on how many frames you need from each video, it might make sense to first convert to an "all-I" codec like MJPEG, where every frame stands alone. Then extracting any given frame would be much faster. When done you can delete the converted file.

I think the bottleneck here is frame seeking rather than decoding. Try encoding a file in ffmpeg from a mid-point in the source  (-ss 2400 or 40 minutes in) and ffmpeg will take some time to get going. Whereas on modern silicon, software players easily decode and process 24-30, if not 60, frames per second to provide realtime playback. That said, converting to I-frame only codec is the right way forward.

Converting the whole video to an MJPEG doesn't make sense to me over just converting all frames to JPEG then deleting the ones you don't want. Am I missing something here?

@user24601 - One difference would be that once you have MJPEG you can still play the video to locate frames. Of course it depends on what the OP's process is -- decoding to a JPEG stack vs an MJPEG video should take about the same amount of time. It's what comes after that, that matters.

@Jim You can "programmatically play" a jpg stack, assuming they are sorted. If you're targeting specific frames, you'd just call the file name in a jpg stack ... Just thinking out loud. I'm working on a related project involving image extraction from a video.


text:
Is it possible to merge two or more videos in real-time like this?
Is it possible to play video online that's made of two or more video files?
Here's what I mean.
My site is hosted on Linux/Apache/PHP server. I have video files in FLV/F4V format. I can also convert them to other available formats if necessary. All videos have same aspect ratio and other video parameters.
What I want is to have online video player that plays video composed of multiple video files concatenated together in real-time, i.e. when user clicks to see a video.
For example, user sees video titled "Welcome" available to play. When he/she clicks to play that video, I take video files "Opening.f4v", "Welcome.f4v" and "Ending.f4v" and join/merge/concatenate them one after another to create one continuous video on the fly.
Resulting video looks like one video, with no visual clues, lags or even smallest observable delay between video parts. Basically what is done is some form of on-the-fly editing or pre-editing, and user sees the result. This resulting video is not saved on the server, it's just composed and played real-time.
Also, if possible, user shouldn't be made to wait for this merging to be over before he/she sees resulting video, but to be able to get first part of the video playing immediately, while merging is done simultaneously.
Is this possible with flash/actionscript, ffmpeg, html5 or some other online technology? I don't need explanation how it's possible, just a nod that it's possible and some links to further investigate.
Also, if one option is to use flash, what are alternatives for making this work when site is visited from iphone/ipad?

hi, Did you come up with a solution to your problem? I have currently the exact same problem. I read into Dash but I am currently stuck at the concatenating of m4s segments in an abitrary order.

DASH HTML5 video streaming already works by getting the player to load video in chunks that are usually about 10 seconds long.  You should be able to cook something up that gets the player to display your segment seamlessly, by giving it a DASH-like list of videos.
You might need to remux your video segments into .mp4, if some web browsers choke on the flv container format.  (assuming that's the container for f4v, which I've never seen before.)


text:
What types of cables support closed captioning?
For example, I know that HDMI cables explicitly do not send a CC signal to the TV, even if the source and TV both support it.
I assume that coax cable does support it since I can use a digital antenna and receive CC on my TV from digital over the air broadcasts (in the US).
Is there any other cabling that will carry the actual CC signal for the TV to decode?
I am currently sending a DVI signal to projectors in an auditorium and I am sending the same image by VGA over CAT5 to HDTVs in our lobby. We may need to add Closed Captioning to the lobby feed only so I do not want to change the image going to the projectors in the auditorium.

Can HDMI even carry non-decoded video bitstreams?  I thought HDMI only carried raw video, like DVI or DisplayPort.  So whatever decodes the TV signals into pixel values would have to handle the captions / subtitles.  (I know HDMI can carry audio bitstream for AC3, EAC3, DTS, DTS-HD, etc. etc.  But I've never read anything about software to bitstream h.264 out of your graphics card over HDMI to a TV, just audio.)

Whether captions appear on a TV rarely has anything to do with the cable used, because there generally is no separate 'CC signal'. If you omit the assumption that it's affected by the cable, maybe you could reframe the question to focus on a specific concern.

@JimMack Under analog broadcast TV, my understanding is that CC signal is sent under Line 21. This only exists because of a timing gap where no image is sent to allow for the CRT to move back to the top of the frame to begin the next pass. I also understand that this method does not apply to modern TVs and their respective signals.

@MilesCarmany That's true (EIA-608), but I don't see what that has to do with cables. In digital systems caption data is interleaved as packets in the stream (EIA-708), not sent as a separate signal or on a separate cable.

Your question was initially confusing because you had focused on "cables" which is not the correct way of looking at this.
Once you've decoded a video signal to components, the closed captions are no longer available. If they were not inserted as open captions (aka subtitles) then they're simply not there.
So any transport that removes the Line 21 caption data or the digital caption packets eliminates your ability to defer captioning at the distant end -- you must insert the captions / subtitles before transport. That's the case with DVI / VGA / HDMI.
If you must allow the ability to choose a captioned or non-captioned display at the distant end, you would have to send two component feeds (e.g. two CAT5s), one captioned and one plain, and A/B switch them at that end.

I don't mind the question. I think of it in those terms too. So HDMI, DVI, VGA no.  Composite, SDI, and RF yes.  Composite is typically a Yellow RCA or can be BNC coax.  SDI (HD, SD, 3G) is also BNC Coax.  When you say Coax above you are referring to RF, which comes in both analog NTSC and digital ATSC versions, both of which support CC, and typical cable ends are F connectors.  Composite and NTSC are SD resolution, so if you want to go HD your choices are SDI or ATSC RF.  For the latter, a simple monitor will not do, it has to include an ATSC tuner.  But if HDMI is anywhere in the chain, CC is lost. SDI connectors on monitors are rare/expensive, so probably not an option.  Only other option is to decode the image twice in your studio, one with opened captions and one without, and send one to the lobby and the other to your projectors.

The closed caption information in the HDMI component is lost when you convert that digital format into a VGA signal, which is analog: The closed caption information is not injected into line 21 of such standard therefore the closed caption information is not there.
Closed caption information is handled very different in a digital signal than in the NTSC standard. You need a microprocessor to extract the signal from the digital HDMI cable and re-build and inject it into line 21 of your analog VGA signal.
In other words: VGA and NTSC both use the same Closed Caption analog format. HDMI and VGA & NTSC are two different worlds and the digital information will never be available to your monitor the way it needs it. By design the information is simply not there.
To handle this need you have three solutions assuming you want to use the CC decoding capabilities and features of your VGA/NTSC monitors: a) One is the offered before: It requires a separate processor to decode from HDMI and encode to VGA/NTSC standard. This is easily accomplished using Linux-based software gear. b) The other solution is to keep your transmission DIGITAL through your UTP cabling all the way. This means not to convert to Analog and inject the signal directly to your HDMI input in your remote monitors (assuming you have HDMI input capabilities in such monitors). For this purpose you need to get HDMI UTP extensors (not VGA) like these: http://www.ebay.com/bhp/hdmi-over-cat5 .
c) A very elegant alternative would be to use HD modulators and send the signal in a unused HDTV channel (for instance 39.1) and feed the signal through a coax cable to the tuner connector of each TV monitor (assuming they have an HDTV tuner circuitry). Something like these can do the job: http://www.pviusa.com/MICROMOD-Compact-HD-RF-Modulator_p_72.html?gclid=CjwKEAjwz9HHBRDbopLGh-afzB4SJABY52oFUGrfVR-DYY4ljXhNVtX5lBiCUwFMPvYUBERhZUVGpRoCH8Hw_wcB .
If recabling is not an option and your monitors are, indeed, HDTV and you have to stick to UTP cabling then your best option is (b): HDMI extensors through UTP. It is a mistake changing from HD Digital format to VGA Analog and then to HD digital again in the other end!. I guess you may want to grab some of these gadgets from EBAY.

This HDMI closed captions information is wrong -- there is explicitly no Closed Captions information in the HDMI signal.
Standard document CEA-861-E, published May 2008, which defines the HDMI data signal, explicitly states:

The physical/link standards in Annex B, Annex C and Annex D do not
  support transport of closed captioning (CEA-608-C [44] and CEA-708-C [45]);
  therefore, the source processes these elements.
Specifically, if closed captioning is to be displayed, it is decoded by
  the source, inserted into the video, and displayed as open captions.
  Similarly, if system Information, program information, events, service
  descriptors, etc. are displayed, related graphical information is inserted
  into the video by the source.
Control of closed captioning settings, programs, events, etc. is
  a feature of the source, not supported by
  this interface and beyond the scope of CEA-861-E.

“source device” = cable set top box.
Currently, the only source of Closed Captions is the Composite Video signal
(yellow cable/connector), but that is an outdated 720×480 resolution video signal.
To force the HDMI source and sink device manufacturers to include and display Closed Captions requires federal legislation in Washington, DC.  Call your US Congressman/Senators.

In the US, closed captioning is not limited to composite / NTSC video (EIA-608) but has been available for digital transmission for many years (EIA-708). I don't see what you think legislation would accomplish?

There are numerous questionable features (e.g. Ethernet) which are expensive to implement which Are being added to this HDMI spec. For some reason, they explicitly state in this specification that they will Not implement Closed Captions, which is relatively easy to implement. Thus the CEA-861 members' refusal to carry Closed Captions in their digital form, translated into a designated Infoframe, indicates the presence of some members on the 861 committee who are resisting Closed Captions transport between the Cable Set Top Box and the TV -- most likely, Hollywood.

For clarification purposes, the purpose of Closed Captions is to deliver captions or subtitles to the TV or TV support equipment as Data.  This allows the TV and other TV support equipment to manipulate the text Data and deliver new features and products which could have assisted the Deaf/Hard-Of-Hearing  community over the past decade.  While the  Set Top Box remains the terminus for this data, it cripples the ability to provide TV visual and audio enhancement features to this community.


text:
Creating text graphics from a data feed
Does anyone know how to create text/graphics from a data feed?
I'm streaming live events and need to take a text data, (mainly CSV files) containing names, clubs, points and position data and transform it into on-screen graphics. I'm struggling to find software that will do this.
I have been using Imagine Infocaster, but it has many drawbacks and uses a USB dongle that couldn't be replaced if damaged. I've also tried CasparCG which is far too complicated and has no useful tutorials.
Wirecast looked promising, but the scoreboard feature is far too basic and doesn't support live data feeds or customisation.
Anything that could do this task and send the result to a Blackmagic Decklink card or Ultrastudio would be magic.

I think you might need a hardware title/ logo generator, but I can't recommend any good ones.

Thanks Jason, I'm having a look at dedicated character generators now.

The obligatory ffmpeg answer (not a very good one, other answers still needed):
You could feed your video through ffmpeg -vf drawtext=textfile=onscreen.txt:reload=1
With whatever other drawtext options you need to put your text where you want it, with the font you want.
reload=1 makes it check the text file for changes every frame, but doesn't give you a way to update the formatting, screen position, or anything else on the fly.  (and you'd have to build your own custom thing to render your data into line-wrapped text.  You could maybe control the on-screen position with leading spaces and newlines.)  And -vf drawtext isn't very nice to use anyway.

I'm trying out a plug-in for PowerPoint called DataPoint, which is working quite well. It allows live updates during a presentation, now I just need to figure out how to arrange tabular data by numeric value. DataPoint is found at: http://www.presentationpoint.com/GB/Software/DataPoint


text:
FFMPEG: Why does the concat filter cause loss of a/v sync/lipsync?
I am doing some tests with the FFMPEG concat filter (DASH experiments), and am seeing that I start losing lipsync after a few concatenations.
Is it expected that one can concatenate independent MP4-boxed streams?
This seems curious that loss of sync should happen, as I am doing the following:

Transcoding all sources into the same bitrate, frame rate, GOP size,
   dimensions and codec.
Using MP4Box to create a set of small N-second
   slices, each being a single GOP.
Interleaving the slices with the
   concat codec from each asset (v1,slice 1;v2,slice 1;v1,slice2...)

Because I am very careful to precondition all the sources to be "in sync", I would expect that concatenating these files should not cause any audio presentation issues, and should look just like a DASH asset (the actual purpose of this test).
UPDATE: I am starting to wonder if it has something to do with some kind of presentation time stamp not being updated correctly, either on the cut or the reassemble side. It always seems that the audio is cutting before the video, and always for the same amount, regardless of the GOP size (being careful of course to make the GOP size a whole fraction of the overall slice size).
As per Mulvya's request, here are the steps I am performing:
Note that I am purposely setting it to one GOP per slice, on the theory that a GOP size smaller than a segment size might be causing the problem. Didn't seem to be the issue.
ffmpeg -i 360a.mp4
       -vf scale=640:360,setsar=1/1 -r 30 -b:v 1000k
       -c:v libx264 -x264opts keyint=300:min-keyint=300:scenecut=-1
       -c:a aac -strict -2
       360a-a.mp4

(-strict -2: as you can see, I'm using the stock release built on a Mac, which seems to scream about AAC a lot. Could this be the issue?)
Note that using the copy codec for audio didn't make a difference.
mp4box -split 10 360a-a.mp4

ffmpeg -i 360b.mp4
       -vf scale=640:360,setsar=1/1 -r 30 -b:v 1000k
       -c:v libx264 -x264opts keyint=300:min-keyint=300:scenecut=-1
       -c:a aac -strict -2
       360b-a.mp4

mp4box -split 10 360b-a.mp4

mp4box -cat 360a-a_001.mp4 -cat 360b-a_001.mp4
       -cat 360a-a_002.mp4 -cat 360b-a_002.mp4
       ...
       -new output.mp4

I also tried two forms of the concat operation:
ffmpeg -f concat -i files-18516 -movflags +faststart  -strict -2 -c:v libx264 -c:a aac/copy abc.mp4

And the "complex" version (that word REALLY fits!  :-)  ):
ffmpeg -i 360a_001.mp4 -i 360b_001.mp4 -i 360a_002.mp4 -i 360b_002.mp4 -i 360a_003.mp4 -i 360b_003.mp4 -i 360a_004.mp4 -i 360b_004.mp4 -filter_complex  [0:0] [0:1]  [1:0] [1:1]  [2:0] [2:1]  [3:0] [3:1]  [4:0] [4:1]  [5:0] [5:1]  [6:0] [6:1]  [7:0] [7:1] concat=n=8:v=1:a=1 [v] [a] -map [v] -map [a] -strict -2 -c:v libx264 -c:a aac/copy abc.mp4

And here are the input and common output formats as reported by FFMPEG. As you can see, the two files were already pretty similar. The extra step is to handle files with different aspect ratios, etc. Note that the video might get stretched...the point here is to test audio issues, not really the video, so I didn't bother padding.
File 360a.mp4:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '360a.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.50.100
  Duration: 00:00:30.53, start: 0.033333, bitrate: 1169 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 1033 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

File 360b.mp4:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '360b.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.50.100
  Duration: 00:00:31.43, start: 0.033333, bitrate: 1120 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 981 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Common Output Format:
Output #0, mp4, to '360a/b-a.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.48.100
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 1000 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc55.69.100 libx264
    Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc55.69.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))

Each slice looks essentially like:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '360a-a_001.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2015-04-26 19:23:40
  Duration: 00:00:10.00, start: 0.000000, bitrate: 1183 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1046 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Can you post the commands you used? Both MP4Box and ffmpeg.

@Mulvya : done.

encoder settings: You shouldn't need to mess with scenecut.  If x264 wants to insert a non-IDR I frame to compress better, let it.  Your min-keyint setting will make sure any extra I frames are not IDR (keyframes).  IDK if this will help compression any on scenecuts, but it shouldn't hurt.  And should have no bearing on your a/v sync issue.  Audio: ffmpeg's built-in aac encoder is significantly worse than libfdk_aac.  If you find you need to xcode your audio, use that.  Preferably don't xcode the audio at all.  (-c:a copy), once you get your a/v sync sorted.

Is a/v in sync in the split files, before remuxing them into a merged video?  e.g. if you just play one of the 10-sec files with your player of choice.

Also, try with x264opts=stitchable=1; that might or might not be needed.  Looking in the code, the option is only checked in one place, to set h->pps->i_pic_init_qp in x264_ratecontrol_new(), whatever that means. :P  I would guess that this would be a "plays or not" issue, rather than just leading to a desync, unless the player's error-handling or invalid streams is leading to desync.  But really I don't know.

Why use mp4box to split and concat? ffmpeg offers segment and concat options as well. Split using "-f segment -segment_time 10" and end with "360a-a%03d.mp4". Then create a text file with one entry on each line like "file '360a-a001.mp4", interleaving the entries in the correct order. Then join using -f concat -i text.txt  and also with -flags +genpts -async 1

@PeterCordes : To answer your excellent questions, the keyint settings are for when one uses DASH. For adaptive encoding, one must have fixed GOP sizes. At least that's the current party line in the not-too-well-specified DASH world. As for -c:a copy, that was my original implementation...it made no difference. By the way, how do you get "code inserts" in the middle of a line?

@PeterCordes question 2: yes, the A/V sync seems fine in each 10-second segment.

@Mulvya Question 1: As for using MP4Box, I was originally just using the FFMPEG split and concat filters. I apologize for giving the MP4Box concat form, up until the very end, I was using the concat filter (the question specifies concat!). I will post a version using that. As for using MP4BOX split, the "word out on the street" in the DASH world is to use MP4BOX for splitting, as it "apparently" is "DASH aware". Remember, these are DASH tests I am doing...the loss of A/V sync on concat was an accidental discovery.

@Mulvya  GENPTS WAS THE ANSWER! Thank you so very much. Frankly, I would have expected PTS to be generated by default (if you are in the FFMPEG group, please consider doing that), but so be it :-)  . If you please state your comment as an answer, I will choose it and give you some game points :-)

@Mulvya Since PTS is not generated by default, when should I be generating it, and when should I not? I would assume that PTS calculation would slow down encoding, so if it can be avoided I would prefer to do that. But in a DASH world, where is PTS generation necessary for proper operation? Even though DASH has nothing to do with reassembly, there WILL be scenarios where I am concatenating in a DASH environment (such as producing a single asset for non-DASH complient players).

@Mulvya Regarding your comment about libfdk_aac, I see that none of my FFMPEG builds support it. Can I dynamically add an encoder without rebuilding? I am currently using it in a server-side environment, and am loathe to rebuild a tool in live use.

code inserts: backticks.  see the markup guide.  re: genpts.  Calculating fresh timestamps is a couple adds / multiplies per frame.  x264 does more work than that per PIXEL.  I'd expect it's literally impossible to measure the performance impact of genpts.

re: fixed GOP.  Yes, you want each segment to be a single GOP.  Non-IDR I frames aren't GOP boundaries.  Prediction / references / etc. can cross I frames if they aren't IDR frames.  I was suggesting you keep your keyint:min_keyint settings, but drop your scenecut setting.  IDK if x264 will do any better without it, but it shouldn't do worse.

re: libfdk_aac: If genpts fixes your sync problems even with -c:a copy, then use that.  Otherwise, make a test-build of ffmpeg, or get a static binary.  Make sure it works well, THEN replace the server's /usr/local/bin/ffmpeg.  If you are xcoding audio, libfdk_aac is the only decent AAC encoder for ffmpeg.  See http://www.hydrogenaud.io/forums/index.php?showtopic=102699 for a fairly recent listening test someone did, comparing fdk_aac against ffmpeg's native encoder.  "Significant and big quality advantage"...

Glad it worked out. Added answer. I'm not a coder or part of ffmpeg. I also don't work that much with streaming media, but in my video editing work, I use ffmpeg fairly regularly for conversions and other sundry work, so I've encountered these common issues before.

Split using -f segment -segment_time 10 and end with 360a-a%03d.mp4. Then create a text file with one entry on each line like file '360a-a001.mp4, interleaving the entries in the correct order. Then join using -f concat -i text.txt and also with -fflags +genpts -async 1
The -fflags +genpts -async 1 is necessary to ensure that the concatenated audio segments will switch over at the same time as the video segment.

-fflags, its two "f"s and not one

For me the -async 1 was the key. I had all the other pieces, but without that things were still getting messed up.

authors: Антон Смирнов


text:
Is H.264 subject to exploits / are some H.264 codecs subject to exploits?
How safe are H.264 streams from exploits? More exactly, are the consumer-grade H.264 codes generally "safe"?
I am currently gratuitously transcoding A/V files to avoid being exposed to possible exploits. This was after I noticed that some older video files will have very curious errors in them, errors that make me wonder if they are indeed exploit attempts ("strange, why's there a STRING in the middle of the stream?"). I do know that in some older formats/codecs, there were indeed past exploits.
Since H.264 codecs are a bit more modern than some of the older ones, I would like to know if such an elementary stream is safe in the "usual suspect" players: Windows Media, VLC, Quicktime and the major browsers (I use Chrome and Firefox, but should include Safari and InternetExploder just in case).
In that case, if the video is an H.264 elementary stream, I would not need to do a sanitization transcode step, and just create a new MP4 container. This would at least remove any container-based exploits. In other words:
ffmpeg -i <file> -c copy newcontainer.mp4

(or -c:v copy, and transcode the audio, etc).
Clearly, white room safety would require transcoding everything, but that's getting all Felix Unger.

All anyone might be able to say is that there are no known holes in the various players.  (I don't know if that's true, just that it's impossible to know that there are no undiscovered bugs in a complex piece of code.)  H.264 streams are complex enough to have lots of corner cases.  They're parsed with speed-optimized code written in C and assembly.
You're quite correct that this is a HUGE attack surface, esp. when you allow arbitrary input formats, including ones with crufty old demuxers / decoders written by some random guy a long time ago, who might or might not have had security in mind.  This article about ffmpeg security fixes is quite interesting.
re: ascii strings inside video files.  That's not uncommon at all.  x264 output embeds a string like
x264 - core 142 r2455 021c0dc - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=6 deblock=1:2:2 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.50 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-4 threads=6 lookahead_threads=1 sliced_threads=0 nr=200 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=6 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:0.50

And of course strings will find lots of sequences of characters in the ascii range, just by random chance.  Some containers use sequences of ascii characters as the magic values to indicate what type of object something is.  e.g. mp4 has "moov", "mdat", and other atoms.  If you can pick any sequence of 4 bytes for your format, you might as well pick ASCII characters to make things easier to debug.
I think transcoding all incoming video would incur a HUGE quality / CPU / storage overhead.  Transcoding with nightly builds of ffmpeg would potentially shield you from known bugs in the typically old version of ffmpeg in VLC stable releases, and whatever bugs are in closed source stuff from Microsoft and Apple.
Remuxing is not a bad compromise.
There's also a balance between destroying metadata vs. passing through more potentially harmful stuff.  (e.g. chapters, subtitles, ...)
If I were actually doing this, I'd probably store my output in mkv files.  Using a different container is maybe better insurance against any weirdness from an input mp4 getting passed on to an output mp4.
Also, if you're actually doing this, I guess you'd run ffmpeg (or MP4Box for just mp4->mp4 remuxing) in a sandbox chroot or vm, or even just as an un-privileged user, so successful exploits are contained.

Thank you for the excellent answer! So if I were looking to sanitize the container, an MP4->MKV->MP4 would be superior to a straight MP4->MP4 recontainerization?

Probably no better than MP4->MP4 remuxing.  MP4->MKV MIGHT turn a buffer overflow -> remote code execution into just a crash in chapter parsing code, for example.  (Or it might not, remuxing won't always help.)  Putting it back into MP4 might line things up the same way as the original container.  If you really still want the output to be MP4, mp4->mp4 remux is probably the same as mp4->mkv->mp4.  And you could do it with MP4Box or something, instead of ffmpeg.


text:
How to extract MOOV atom/metadata from MP4 file?
Can one "dump"/extract the MOOV atom from an MP4 file? If so, how? Hoping for an obscure FFMPEG command.
I need to be able to process/play a stream without searching for the MOOV atom over and over again. For very long streams, this can run into several megabytes of data. It's rather strange, I don't think the MOOV atom is huge, I just think that it is scattered thruout the first N megabytes (i.e. toplevel data at the begnning, with references to further atoms that are later in the stream).
Thus, it would make sense for me to extract the MOOV atom out of the file, keep it

You can use AtomicParsley to parse the metadata of a MP4-file. For example
 AtomicParsley /path/to.mp4 -T 1

will print the whole atom tree.

Maybe I'm a bit late, but I'd use bento4 mp4dump, it's really easy to install on mac with brew brew install bento4
mp4dump 1.mp4

[ftyp] size=8+16
  major_brand = iso5
  minor_version = 200
  compatible_brand = iso6
  compatible_brand = mp41
[moov] size=8+740
  [mvhd] size=12+96
    timescale = 1000
    duration = 0
    duration(ms) = 0
....

You can also use qtfaststart -l fileName which outputs something more human readable like :
$ qtfaststart -l myFile.mp4
ftyp (32 bytes)
free (8 bytes)
mdat (283805466 bytes)
moov (3541465 bytes)

The Python qtfaststart is different from the qt-faststart binary (bundled with ffmpeg)  and can be installed using this command:
sudo -H $(which pip) install qtfaststart

qtfaststart command line arguments :
$ qtfaststart -h
Usage: qtfaststart [options] infile [outfile]

Options:
  --version     show program's version number and exit
  -h, --help    show this help message and exit
  -d, --debug   Enable debug output
  -l, --list    List top level atoms
  -s, --sample  Create a small sample of the input file

The qtfaststart sources are here

On my Mac, where I get all these nifty utilities with brew, the command is actually qt-faststart and is part of the ffmpeg package.

@GwynethLlewelyn qt-faststart is a binary program but qtfaststart is a Python program, they have different command line arguments. I don't a Mac at hand so I cannot help you anyfurther than this or with brew-pip

Thanks so much, @SebMa, you're quite right — there is indeed a difference — but unfortunately brew and brew-pip don't seem to like qtfaststart; apparently, there is a conflict somewhere between the brew-provided package, and the package provided by pip itself (i.e. brew believes both to be the same). easy_install qtfaststart will work with the system's Python (2.7.X in macOS Catalina).

Unfortunately this only list "top level atoms", not the whole tree


text:
How to keyframe a crop in Premiere Pro CC
I am working on a school project, and it starts off with a 5 second count up that takes up the full screen. I am using the prebuilt insert timecode effect built into Premiere. What I have done is cropped all but the minutes and seconds out of the view.
What I would like to do next is to transition it to the bottom right corner while shrinking it.
Any help/advice would be welcome. If theres another program that does it easier, then feel free to let me know.
EDIT:
Here is what I have:

Here is it without the crop:

Here is what I would like to have the timer transition to:

Here is the non-cropped version of the smaller timestamp:

Welcome Jordan :) I would like to help you, but your question is not clear. Please add a screenshot and try to describe what do you want to achieve. For a simple crop just keyframe the scale value of your footage. Note: If you have to scale the footage about 107%, might be better to set the project to a smaller output format like 720p.

@poor I have added some pictures, I hope this illustrates further what i'm trying to do. I have a feeling that this is going to be rather simple...

Before I start I'd like to mention that this would be much easier in After Effects. If you plan on doing this more often, you should consider learning AE to be able to do things like that faster.
So, to follow your approach I created a transparent layer, put the timecode effect on it and cropped it using the crop effect. It looks like this right now:

Since you want to resize and move it, you'll need to activate the animation for two parameters in the effects panel: The "size" parameter of the timecode effect and the "position" parameter under the motion effect (which is applied to each clip by default). You can do this by clicking the clock symbol next to the parameters name (see the next image). Make sure that your playhead (in the timeline) is at position 00:00, since activating the animation will create a keyframe at the current position.

Now, move the playhead to the point where you want the animation to end (i.e. the timecode has arrived at your desired position and size). First, alter the percentage value of the "size" parameter of the Timecode effect. A keyframe will automatically be created (see the small diamond shape in the timeline next to the effect settings panel). Then, adjust the "position" parameter of the motion effect. Again, a keyframe will automatically created. Adjust both parameters until you're happy with size and position. Then you're basically done.


text:
Video software to add video effects similar to Apple's Photo Booth
Apple Mac OS X includes Photo Booth, an application for taking photos and videos with the built-in camera (if available, of course). Photo Booth can also add effects while taking a picture or video. In the recent version (Yosemite), Photo Booth is able to detect faces and adds the effect to every face detected in the image/video, see this example I found on YouTube:

Photo Booth applies effects in real time and cannot add effects to already recorded footage.
Is there any video editing software or video effects software available which can do this, i.e., add an effect similar to Photo Booths face detection based effects to existing video?

You could always run a screen grab on photobooth.  Snapz Pro will let you capture video.  Or do you specifically want something different than photobooth?  There's also processing.org, but you'd have to write it yourself.

Thanks, @JasonConrad: I want to apply Photo-Booth-like effects to existing videos.

If you want to create the same effect after you shot the video, you could use Adobe After Effects.
Chose one of the filters under Effect>Distort. For example, let's choose Bulge.
Now you need to create keyframes so that the central point moves along with the face. You can either do this manually or use a tracker.
There are a lot of tutorials on tracking.

Apple's Motion has a variety of distortion effects that you can apply to existing video. For example, you could use the "Poke" filter from the "Distortion" category to do something similar to the above video.


text:
Http Live Streaming for beginners
I'm new to live streaming and it's quite hard to find good information for beginners. Could anyone recommend resources to HLS besides Apple's documentation?
I'm trying to make an app similar to LiveStream where videos can be broadcasted to multiple users in real-time.
I've run into some services like encoding.com, heywatchencoding.com, and wowza, but I'm having difficulties with what each platform provides as the documentations for each seem to be for more intermediate/experienced users.
By any chance, do anyone of you guys know if I can use wowza with Parse.com services?
Thanks

I would suggest you research a bit further and then refine your question. To me it seems that there is a bit of confusion in terms of the software components needed for creating a livestream. First you need to have a software component that acquires a live video from some device. This video needs to be encoded. Once it is encoded it can be streamed by a streaming server. There are a lot of softwares or software as service, that can do that. Also you should figure out what streaming protocol you want to use (rtmp, rtsp?) and how many concurrent streams you need to have.
Some pointers to check out:
Monaserver
https://github.com/MonaSolutions/MonaServer
Ffmpeg streaming guide
https://trac.ffmpeg.org/wiki/StreamingGuide
Nginx rtmp streaming
https://github.com/arut/nginx-rtmp-module/wiki/Getting-started-with-nginx-rtmp

Yes, I too think you need to refine your question. What platform are you steaming to? YouTube and Facebook Live are free and popular. Wirecast software can push to those endpoints with the sleekness of a Mac OS interface. In terms of hardware needed to recognize/encode HD feeds (e.g. HDMI or SDI) you need something as simple as a Black Magic mini recorder (or any BM device for that matter) for a single or premixed feed. The rest is is up to the power of the computer CPU and Internet bandwidth.
Hope I helped.


text:
Can individual tracking points be edited in After Effects?
I solved a rather long scene in After Effects for camera tracking.  Later, I realized that the tracking point I chose "jumped" out of its stable position for a split second.  This only became apparent after I had attached a graphic to that point.
Re-doing the analyze/solve steps is rather time consuming.  I was wondering if the tracking data for the point I have chosen is accessible and whether it is possible (and easy) to edit out the offending data point/points.

(I can't comment because I don't have 50 reputation yet lol)
By the way, if I got what you mean you just have to move with the Selection Tool the keyframe on the Composition screen.
For making the path smoother and more accurate the sub-Pen Tool called Convert Vertex Tool.
Finally, on the timeline thanks to Graph Editor, add dynamicity to the animation in-between frames (delay and advance).

Is your answer related to fixing the problem manually?

Yes, automatically I think you can just change the parameters of the tracer (that I'm sure you tried). If omething "jump" usually are few frame, otherwise you should change the point to track because that is not good.


text:
Keyboard shortcut for "Add clip to conversion list" in GoPro Studio?
Cutting videoclips in GoPro studio is pretty easy:
Press I for Mark In, O for Mark Out and Space for pause/continue. Editing a video would be pretty much faster, if a keyboard shortcut could be also used to add a videoclip to the conversion list, instead of clicking the button with mouse.
Is there a shortcut for the "Add clip to a conversion list", or is it possible to somehow make one? The answer can include usage of third-party programs such as Autohotkey etc.
My operating system is Windows 7.

If you google GoPro Keyboard Cover there is a skin with all the shortcuts on it - from GoCam Accessories I think it's called.
Edit: Just realised I could paste a link:
http://www.gocamaccessories.com/shop/gopro-studio-keyboard-cover-for-macs/


text:
Adobe Premiere Pro CC aspect ratio streched
Couple of last times I rendered with Premiere Pro I notified that aspect ratio is stretched by height. I'm rendering 1280x720 at 1.333 aspect, and it worked fine every time till now, I didn't change any settings or anything, video previews are looking normal, and only output is stretched. I'm getting really frustrated here, any help? Here are images of sequence settings and export settings:

With 1.333 aspect you mean the pixel aspect ratio? In that case it's now wonder your video comes out distorted ... if you want a 1280x720 resolution with a normal video aspect ratio, use quadratic pixels (1.0) instead. I don't fully understand your problem though. Could you provide information about the resolution and pixel aspect ratio of the source material and the desired output format?

I'm usually using 720p with 1.333 aspect to get that anamorphic look and widescreen, but now when I'm exporting in that way it somehow exports video in 16:9 aspect a stretches it. Footage is from DSLR at 1080p with 16:9 aspect and I'm exporting it in h.264 Match Source preset.

That still sounds curious to me. Does that mean you deliberately stretch your video? Because a resolution of 1280x720 used with a 1.333 pixel aspect ratio would leave you with a widescreen video that appears stretched in width. If you're using Match Source with your 1080p footage, it will export in 1080p, meaning 16:9 aspect ratio ... if you have set your sequence settings to something other than that, this will lead to all kinds of unwanted results ...

If a stretched video is really what you want, you should set your sequence settings to match your original videos resolution and pixel aspect ratio and then export it using the video and pixel aspect ratio you want, but I don't see why you should want that ... maybe I just don't understand what you're trying to achieve

No, I'm not, I'm making sequence at 720p with 1.333 and than scaling footage down to fill, maybe this will reflect it better, here are images of how output should be: http://dupovacemir.ga/wanted-output.jpg and how it actually is: http://dupovacemir.ga/output.jpg

To be more specific, this is the kind of output I want:  http://dupovacemir.ga/work/demolition-day

So you're trying to achieve a 2.35:1 video aspect ratio (i.e. widescreen) by scaling the source video to fit and cutting off a strip at either the top or the bottom (or both)? (edit: I just realised you wrote that 10 hourse ago. Now I feel stupid. Sorry) Ok that makes sense (even though I don't really like the idea of cutting parts of your 16:9 image to make it look cooler); so your sequence settings look like this, is that correct? If so, please post screenshots of your export settings, if the problem only occurs after export, those are most likely the cause

Yes, thats exactly how it is set, here are the export setting, with and without pixel aspect ratio correction toggled, with, and without

Ok I've tried to reproduce your problem. After exporting, how did you check the video? Because I got a distorted video when I opened the exported file (exported with 1280x720 at 1.333 PAR) in the VLC media player, which recognised the video as 16:9 rather than 2.35:1. I could correct that by manually switching to this aspect ratio in VLC. I don't know what happens though when uploading that to vimeo (tried that, but now I'm stuck in vimeos converting queue ...)
I'm going to go to bed soon, but I will get back to that tomorrow and see what happens in vimeo!

Yeah, I'm using Media Player Classic and can also set it manually, but that wont fix anything, but now you see whats the problem, and thanks a lot for the effort.

Ok I checked the video I uploaded to vimeo, and indeed, it doesn't recognise the 1.333 PAR, resulting in a deformed video. I don't know if the PAR is in some way embedded in the meta data of a video, so I don't ecaxctly have a solution ... however, I came up with a workaround (which is a bit dirty, admittedly); use quadratic pixels instead and adjust the amount of pixels either horizontally to achieve your 2.35:1 aspect ratio; so use either. ~1280x540 or ~1706x720. I know this isn't exactly what you were asking for, but at least it works ... (anamorphic video is a mess either way, so ...)

^Posted this as a comment since it isn't really an answer. Sorry I can't help you :( Also, the exact dimension may be slightly wrong, you'll have to try it out or google the correct dimensions, possible widescreeen dimensions should be easy to find

Use square pixels for everything. Avoid pixel dimension stretching at all costs. Unless you're dealing with archive footage or anamorphic lenses, and there's no choice. This advice will make your life easier.

I would check up in the Output window (second image). In the top left there is that option: Scale to Fit. Try changing that. Also check the "Fit" option in the bottom of the window right under the video.


text:
Is there any way to efficently compress multiangle recordings?
I have a DVD (a concert recording) which uses the multi angle feature for 3 different angles. I just encoded it with Handbrake on 3 separate but identical machines (all of the same model and maker, same version of Handbrake and same encoding settings), each encoding a different angle.
My problem: my thought was that mkvmerge would be able to do some deduplication for me where possible, so that where the same group of pictures appears in the streams it would only store it once in the output file, but the sum of all input files is equal to the output file, thus resulting in a file that is as big as the raw data of the DVD.
More background info: Of course the DVD has chapters, if you skip through these, they show identical scenes on all 3 streams, however if you seek a bit further inside the chapter you can see different camera angles. So by just looking at it there is the same and also different content, using Matroska's editions would be very labor intensive and I think I would have to encode the entire thing again once I figured out where all the different scenes are.
How can I achieve a smaller file size in this case? I thought since Matroska incorporates advanced features like VFR that there would also be some way to handle this. Would it help to enable compression in mkvmerge/mkvtoolnix-gui (it has been disabled by default after some releases) or some other Matroska writing library or application, if so where and how?
I just played the output file with VLC, selecting a different video stream opens up a new window for each stream on Ubuntu 16.04, so I can view all 3 angles at the same time (indeed they all show different camera perspectives from time to time), not what I expected or had in mind, but interesting.
Here are the details of the streams:
Video
Format                                   : HEVC
Codec                                    : V_MPEGH/ISO/HEVC
Codec profile                            : Main@L3@Main
Duration                                 : 01:16:26:00
Bit rate                                 : 1 983 Kbps
Width                                    : 694 pixels
Height                                   : 576 pixels
Frame rate mode                          : CFR
Frame rate                               : 25.000 fps
Frame count                              : 114650
Colorimetry                              : 4:2:0
Bit depth                                : 8 bits
Stream size                              : 1.06 GiB (74%)
Writing library                          : x265 2.1:[Windows][GCC 5.3.1][64 bit] 8bit
Encoding settings                        : wpp / ctu=64 / min-cu-size=8 / max-tu-size=32 / tu-intra-depth=2 / tu-inter-depth=2 / me=3 / subme=3 / merange=57 / rect / amp / max-merge=3 / temporal-mvp / no-early-skip / rskip / rdpenalty=0 / no-tskip / no-tskip-fast / strong-intra-smoothing / no-lossless / no-cu-lossless / no-constrained-intra / no-fast-intra / open-gop / no-temporal-layers / interlace=0 / keyint=250 / min-keyint=25 / scenecut=40 / rc-lookahead=30 / lookahead-slices=0 / bframes=8 / bframe-bias=0 / b-adapt=2 / ref=4 / limit-refs=2 / limit-modes / weightp / weightb / aq-mode=1 / qg-size=32 / aq-strength=1.00 / cbqpoffs=0 / crqpoffs=0 / rd=6 / psy-rd=2.00 / rdoq-level=2 / psy-rdoq=1.00 / log2-max-poc-lsb=8 / no-rd-refine / signhide / deblock=0:0 / sao / no-sao-non-deblock / b-pyramid / cutree / no-intra-refresh / rc=crf / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ipratio=1.40 / pbratio=1.30
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601

Video
Format                                   : HEVC
Codec                                    : V_MPEGH/ISO/HEVC
Codec profile                            : Main@L3@Main
Duration                                 : 01:16:26:00
Bit rate                                 : 2 095 Kbps
Width                                    : 694 pixels
Height                                   : 576 pixels
Frame rate mode                          : CFR
Frame rate                               : 25.000 fps
Frame count                              : 114650
Colorimetry                              : 4:2:0
Bit depth                                : 8 bits
Stream size                              : 1.12 GiB (98%)
Writing library                          : x265 2.1:[Windows][GCC 5.3.1][64 bit] 8bit
Encoding settings                        : wpp / ctu=64 / min-cu-size=8 / max-tu-size=32 / tu-intra-depth=2 / tu-inter-depth=2 / me=3 / subme=3 / merange=57 / rect / amp / max-merge=3 / temporal-mvp / no-early-skip / rskip / rdpenalty=0 / no-tskip / no-tskip-fast / strong-intra-smoothing / no-lossless / no-cu-lossless / no-constrained-intra / no-fast-intra / open-gop / no-temporal-layers / interlace=0 / keyint=250 / min-keyint=25 / scenecut=40 / rc-lookahead=30 / lookahead-slices=0 / bframes=8 / bframe-bias=0 / b-adapt=2 / ref=4 / limit-refs=2 / limit-modes / weightp / weightb / aq-mode=1 / qg-size=32 / aq-strength=1.00 / cbqpoffs=0 / crqpoffs=0 / rd=6 / psy-rd=2.00 / rdoq-level=2 / psy-rdoq=1.00 / log2-max-poc-lsb=8 / no-rd-refine / signhide / deblock=0:0 / sao / no-sao-non-deblock / b-pyramid / cutree / no-intra-refresh / rc=crf / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ipratio=1.40 / pbratio=1.30
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601

Video
Format                                   : HEVC
Codec                                    : V_MPEGH/ISO/HEVC
Codec profile                            : Main@L3@Main
Duration                                 : 01:16:26:00
Bit rate                                 : 3 143 Kbps
Width                                    : 694 pixels
Height                                   : 576 pixels
Frame rate mode                          : CFR
Frame rate                               : 25.000 fps
Frame count                              : 114650
Colorimetry                              : 4:2:0
Bit depth                                : 8 bits
Stream size                              : 1.68 GiB (98%)
Writing library                          : x265 2.1:[Windows][GCC 5.3.1][64 bit] 8bit
Encoding settings                        : wpp / ctu=64 / min-cu-size=8 / max-tu-size=32 / tu-intra-depth=2 / tu-inter-depth=2 / me=3 / subme=3 / merange=57 / rect / amp / max-merge=3 / temporal-mvp / no-early-skip / rskip / rdpenalty=0 / no-tskip / no-tskip-fast / strong-intra-smoothing / no-lossless / no-cu-lossless / no-constrained-intra / no-fast-intra / open-gop / no-temporal-layers / interlace=0 / keyint=250 / min-keyint=25 / scenecut=40 / rc-lookahead=30 / lookahead-slices=0 / bframes=8 / bframe-bias=0 / b-adapt=2 / ref=4 / limit-refs=2 / limit-modes / weightp / weightb / aq-mode=1 / qg-size=32 / aq-strength=1.00 / cbqpoffs=0 / crqpoffs=0 / rd=6 / psy-rd=2.00 / rdoq-level=2 / psy-rdoq=1.00 / log2-max-poc-lsb=8 / no-rd-refine / signhide / deblock=0:0 / sao / no-sao-non-deblock / b-pyramid / cutree / no-intra-refresh / rc=crf / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ipratio=1.40 / pbratio=1.30
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601

Edit: a good explanation why this cannot work will also be appreciated.

The name for this feature is Multiview Video Coding (MVC):

an stereoscopic video coding standard for video compression that
  allows for the efficient encoding of video sequences captured
  simultaneously from multiple camera angles in a single video stream

Can't be done, at present. Not using open source tools. There may be academic or commercial encoders that can do this.
In any case, the primary design motivation of MVC is to efficiently compress the two views of a stereoscopic 3D stream, which are very similar to each other. I have my doubts it would be efficient if the camera angles are sufficiently different.

In your case, each angle is an independent video stream and is encoded accordingly. The container (Matroska) is simply just that, it packages the data - it has no ability or business to consolidate the data within or among video streams.
It would be the job of the encoder - in this case, x265 - to work with all 3 streams, and produce a single output stream that can store all views efficiently. And the job of a compliant decoder to reproduce those 3 angles if given such an encoded stream. But Handbrake or FFmpeg ..etc don't sport MVC encoders (or decoders).

Most of the R&D seems to be going towards compression systems for light field displays, so there doesn't seem to be any commercial implementation available right now. MVC may come along with that, but it is unclear just how much texture/shading data will be required for those formats to function.


text:
Why does parameter round in ffmpeg's cropdetect default to 16?
I have been experimenting with some ffmpeg options and I could not figure out, why the resulting files had been in a format I did not want. After further combing through the man pages, I realized that i used cropdetect=24:16:0 in my video filters. This was a result of googling and copy-pasting. After reading the man page, I changed the values to cropdetect=24:2:0, which got me to the results I expected (video of 720x540, SAR 1/1, DAR 4/3).
"Sadly", the man pages states:

round:
  The value which the width/height should be divisible by. It defaults to 16. The offset is automatically adjusted to center the video. Use 2 to get only even dimensions (needed for 4:2:2 video). 16 is best when encoding to most video codecs.

I cannot find information, why 16 should/could be "best" for "most video codecs". Can you give me a hint? Do I do anything severely wrong, if I use '2' instead of '16'?

I found http://support.brightcove.com/en/video-cloud/docs/optimal-video-dimensions which states again, that everything should at best be a multiple of 16, or, if needed of 8 or 4. Again no explanation, no reasoning, just the statement.

It seems like this might be due to video compression itself: http://forum.doom9.org/archive/index.php/t-143215.html holds a comment by LoRd_MuldeR, who states that the compression (still generalized) works on blocks ofh the size 16x16 and that smaller parts of the pictures will be padded. But he also states: "However with x264 the cost for none-mod16 is pretty low. Wouldn't worry too much!" This is enough of an explanation for me, so perhaps anyone else might stumble over this. Have fun.


text:
How to do mpeg/mpg to mov lossless conversion?
Does anyone know how to do lossless conversion from *.mpeg/mpg to mov?
I was asked to extract video from DVDs and do editings in FCPX, however FCPX cannot edit *.mpeg/mpg file natively, therefore I need a way to convert it from mpeg.
I have tried two applications to convert mpeg files:
a) FFmpeg: I used c:v copy to do file wrapping to Mov file, but the conversion was failed, each frame of converted video file is jittering. Looks like there're some information missed in Mov header.
ffmpeg -i {input_file}.vob -c:v copy -copyts -threads 8 -sn -y {output_file}.mov

ffmpeg started on 2015-01-30 at 16:48:48
Report written to "ffmpeg-20150130-164848.log"
Command line:
ffmpeg -i /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob -c:v copy -sn -t 30 -report -y /Users/yusizhang/Movies/vod2Mov.mov
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  1 2015 20:24:48 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver --disable-shared --enable-static --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-zlib --enable-avfilter --enable-fontconfig --enable-libfreetype --enable-libass --enable-libutvideo --enable-filters --enable-postproc --enable-runtime-cpudetect
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument '/Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-sn' ... matched as option 'sn' (disable subtitle) with argument '1'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '30'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '/Users/yusizhang/Movies/vod2Mov.mov' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob.
Successfully parsed a group of options.
Opening an input file: /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob.
[mpeg @ 0x7fbc5201dc00] Format mpeg probed with size=8192 and score=52
[mpeg @ 0x7fbc5201dc00] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
[mpeg @ 0x7fbc5201dc00] probing stream 0 pp:2500
[mpeg @ 0x7fbc5201dc00] Probe with size=2012, packets=1 detected mpegvideo with score=25
[mpeg @ 0x7fbc5201dc00] probed stream 0
[mpeg @ 0x7fbc5201dc00] max_analyze_duration 5000000 reached at 5005000 microseconds
[mpeg @ 0x7fbc5201dc00] After avformat_find_stream_info() pos: 0 bytes read:4542608 seeks:2 frames:466
Input #0, mpeg, from '/Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob':
  Duration: 00:58:50.56, start: 0.233567, bitrate: 2887 kb/s
    Stream #0:0[0x1e0], 152, 1/90000: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR 8:9 DAR 4:3], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x80], 157, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 128 kb/s
    Stream #0:2[0x81], 157, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 128 kb/s
Successfully opened the file.
Parsing a group of options: output file /Users/yusizhang/Movies/vod2Mov.mov.
Applying option c:v (codec name) with argument copy.
Applying option sn (disable subtitle) with argument 1.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 30.
Successfully parsed a group of options.
Opening an output file: /Users/yusizhang/Movies/vod2Mov.mov.
Successfully opened the file.
detected 8 logical cores
[graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'time_base' to value '1/48000'
[graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'sample_rate' to value '48000'
[graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'sample_fmt' to value 'fltp'
[graph 0 input from stream 0:1 @ 0x7fbc51501240] Setting 'channel_layout' to value '0x3'
[graph 0 input from stream 0:1 @ 0x7fbc51501240] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[audio format for output stream 0:1 @ 0x7fbc515008e0] Setting 'sample_fmts' to value 'fltp'
[audio format for output stream 0:1 @ 0x7fbc515008e0] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[AVFilterGraph @ 0x7fbc51501880] query_formats: 5 queried, 12 merged, 0 already done, 0 delayed
[aac @ 0x7fbc52022000] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
[AVIOContext @ 0x7fbc5154cb80] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x7fbc51501b20] Statistics: 4542608 bytes read, 2 seeks

b) Qucktime X: I use Quicktime x to open mpeg files and "Save" it into another file. I thought it would be a lossless conversion, but the color was shifting and I saw the bitrate of video was drop.
Is there any good mpeg/mpg to mov wrapper tool which can do the "wrapping" lossless? Or is there a suggested conversion method?
Thanks!

Why does FC not support MPEG-2 video in MPG container? That sounds ridiculous. Can you show your ffmpeg command and the complete console output?

Hi LordNeckbread, I updated the description with ffmpeg command. FCPX cannot edit any file with Mpeg container... it really makes me headache.

You forgot the console output from your ffmpeg command.

ffmpeg -i {input_file}.vob -c:v copy -copyts -threads 8 -sn -y {output_file}.mov

That's the command, and I saw that in your question. I want to see what ffmpeg says after you enter that and complete the encoding. You can add -t 30 to output a 30 second video so you don't have to wait long.

Just a guess, try without -copyts. Timestamps are different in mov (it doesn't use frame timestamps, it uses frame durations)

Sorry, my bad. I pasted console output to the question. I tried withouut -copyts, but output mov file still has problem...

I found a way to resolve this jittering issue. The root cause is that mpeg file doesn't have full PTS info. There's a closed ticket of FFmpeg talking about exactly this problem:
FFmpeg ticket #974
In order to solve this problem, add -fflags +genpts before the input file. Here is a sample FFmpeg command:
ffmpeg -fflags +genpts -i /Users/yusizhang/Movies/DVDRemaster/dvd_1/track003.vob -c:a copy -c:v copy -threads 8 -sn -y /Users/yusizhang/Movies/vod2Mov_clean/Episode1_clean.mov

I re-opened the FFmpeg ticket, retitled it to: genpts not enabled automatically when remuxing from VOB to MOV.  It's silly that users have to run into a problem and then discover an obscure option.

Great retitled, I totally agree with it. Hope FFmpeg developers can take it into consideration. Thank you!

did they ever fix this?