text:
Re-encode with ffmpeg using libx265 - rawvideo
I have a script that is going through a media library and re-encoding files to HEVC with ffmpeg and using libx265. The default command I use is:
ffmpeg -i "$origFile" -map 0 -c copy -c:v libx265 -preset slow -crf 28 "$newFile"

However, for some files this process fails, it outputs the following information about the video:
Output #0, matroska, to 'test.mkv':
  Metadata:
    encoder         : Lavf56.15.105
    Stream #0:0: Video: hevc, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 23.98 fps
    Metadata:
      encoder         : Lavc57.14.100 libx265
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (copy)

And then, I just get the wall of errors that are printed below here:
[rawvideo @ 000000c56052c920] Invalid buffer size, packet size 295 < expected frame_size 1
769472
Error while decoding stream #0:0: Invalid argument
[rawvideo @ 000000c56052c920] Invalid buffer size, packet size 362 < expected frame_size 1
769472
Error while decoding stream #0:0: Invalid argument
[rawvideo @ 000000c56052c920] Invalid buffer size, packet size 5926 < expected frame_size
1769472
Error while decoding stream #0:0: Invalid argument
[rawvideo @ 000000c56052c920] Invalid buffer size, packet size 406 < expected frame_size 1
769472
Error while decoding stream #0:0: Invalid argument

I've tried following some other advice, since when I try and read the codec, it says "rawvideo", and using commands like ffmpeg -f rawvideo -pix_fmt yuv420p...., but that also does not work. If anyone has any insight or ability to help explain how to overcome this issue, it would be really appreciated. I've included the ffprobe output for this particular file as well if that is helpful:
ffprobe version N-76479-gc878082 Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --e
nable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-li
bass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libf
reetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libm
p3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --en
able-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libv
o-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-deckli
nk --enable-zlib
  libavutil      55.  5.100 / 55.  5.100
  libavcodec     57. 14.100 / 57. 14.100
  libavformat    57. 14.100 / 57. 14.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 14.101 /  6. 14.101
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, avi, from '109 - The Voices of the Dead.avi':
  Metadata:
    encoder         : Lavf56.15.105
  Duration: 00:58:35.47, start: 0.000000, bitrate: 359 kb/s
    Stream #0:0: Video: rawvideo, bgr24, 1024x576, 219 kb/s, SAR 1:1 DAR 16:9, 23.98 fps,
23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 kb/s

Your ffmpeg is too old. Windows users can get a build from Zeranoe. -strict experimental is no longer needed when encoding 4:2:2 and 4:4:4.

I will update it, and see if that fixes it.

I updated, and now I just get the stream of errors about invalid buffer size, exact same ones as mentioned above

What created the input file? Can anything else properly decode it? Are you sure it's bgr24, 1024x576, 24000/1001 frame rate? Can you show the complete console output from the command?

@LordNeckbeard I do not know what created the input, it was a downloaded video file, not my own creation. The entire console input is huge, but I will try and run/copy and put it up on pastebin sometime tomorrow. It is just the error repeating over and over and over again.

Basically, rawvideo is uncompressed full raster, so every frame is of identical bytesize and that's what FFmpeg expects. However, it's complaining that some frame sizes are (much) smaller than expected. A downloaded file will almost certainly not have a rawvideo stream. Even the input video stream bitrate suggests that. Try adding -c:v h264 before -i . If that doesn't work, try -c:v mpeg4

@Mulvya So, I'm actually wondering if I created them somehow. Here is a console output of a video I re-encoded from mpeg4 to hevc (http://pastebin.com/3KXjcmxZ) just this morning. This uses the exact same settings as all my other videos (see above post). You can see in the console output, it says the output format at the end is hevc, but if I use ffprobe on the new file, it detects that it is rawvideo? This does not happen for all my videos though

That explains it. FFmpeg isn't set to write any tags for HEVC in AVI. Your 'rawvideo stream' is most probably HEVC. Don't encode to AVI if possible. If you have to, add -vtag hvc1

@Mulvya should/can I remux the avi files to something else first? What would you recommend? The videos that are reading as rawvideo, can I "fix" them somehow? Looking through the list, I'm pretty sure all the videos that are failed in this way, are in fact AVI files

For files already encoded to AVI, you'll have to extract the video to a raw HEVC stream first:
ffmpeg -i in.avi -c copy -map 0:v -f hevc in.265

and then
ffmpeg -framerate 30 -i in.265 -i in.avi -c copy -map 0:v -map 1:a -video_track_timescale 1k fixed.mp4

Replace the framerate value with the true rate of the video.

Encode new files to MP4 or MKV.
ffmpeg -i "$origFile" -map 0 -c copy -c:v libx265 -preset slow -crf 28 "newFile.mp4"

Here is a new pastebin of that process. Can you just see if everything looks ok for this file? http://pastebin.com/rXBeRyGc  I wasn't sure about the "pts has no value" outputs

Looks ok. Drop the framerate and only use it the output plays too fast or slow.

Ok. Can you update the answer with one more part? If I have avi files that are not yet encoded to hevc, so ffprobe reports mpeg4 as the video codec. What process should I take to encode these to hevc files?


text:
Can I digitalize a video with a RCA-Jack adapter?
I have a stereo AUX to Jack adapter that can be plugged to an old cassette-based video recorder

Would I be able to digitize my video with this AUX to Jack adapter?
I would run the casette on the video camera and use ffmpeg to get the Jack input.

The cable in the picture is an analogue cable, so it's getting an analogue signal from your camera. It's just a cable, so the signal at one end is exactly(ish) the same as the other. To digitise it you'll need a device to convert the analogue signal into digital code. There is a big range of these devices, from cheap USB dongles on ebay like this to broadcast standard boxes like this. The quality of hardware and software will vary, I'd hazard a guess that you'll mostly get what you pay for.
When looking for a converter you have to make sure that it is converting from analogue to digital. No cable alone can do this, it needs some sort of processing. Basically if you find something that has analogue sockets on one end (like the red white and yellow plugs on your cable, you call them AUX, but they're more commonly called RCA connectors. Professional equipment may have BNC connectors instead) and a digital plug on the other (usb, firewire, thunderbolt, etc. – but probably not HDMI because you generally can't record HDMI without specialised equipment) that you can plug into a computer then you're good to go.

source: Stack Exchange

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

sort: votes


text:
ffmpeg copy highest quality audio track of a specific language
Say you input has 2 english audio tracks, 7.1 and 2.0.
You want to copy the audio track of highest quality (number of channels) to audio.ext
If I use -map 0:m:language:eng it selects all english audio tracks where I thought by default it would only copy the highest channel audio track.
Example:
ffmpeg -i *mkv -map 0:m:language:eng -vn -acodec copy output.flac

What's your full command?

A map option will select all streams matched by the specification. The 'best' stream is only selected in the absence of any map options.
So, you'll need a two-stage process to do this:
ffmpeg -i in.mkv -map 0:a:m:language:eng -vn -acodec copy -f nut - | ffmpeg -f nut -i - -c copy output.flac

The first ffmpeg process sends all English language audio streams to the 2nd ffmpeg process, which will select only the 'best' among the received streams for output.
If you want to keep metadata, and not worry about the codec of the input file, you can change your output to .mkv

That's the 'file format' set for the piped data. ffmpeg generally detects the format based on the extension of the output file. There's none specified by - so we have to set one. -f matroska would work as well but nut supports finer timestamps so I prefer that.

nut is not really necessary here, just a habit for me. ffmpeg can't auto-supply extension.

I've added this to your answer so is more relevant to others. Thanks so much! I'll cleanup old comments

Trying to adapt this to subtitles doesn't work. Any idea why? -map 0:s:m:language:eng -vn -scodec copy -f nut - | ffmpeg -f nut -i - -c:s srt "${file%.mkv}".eng.srt

Share full log.

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


text:
Fixing a .ts file with Checksum error
I have got a 8GB .ts video file, unfortunately when I tried to copy it from my hard disk to my 16GB USB thumb drive, I got an error at 60% which seems to be a file checksum error (strangely, I found no error when I checked the disk, so it is not likely a bad sector, and I can view the video with MPC before and after that point, the video just stops when coming across that 60% point).
I tried using Project X to see if the file can be repaired, but as expected, there is an error once the software reads the file at 60%. So my thought is to split the file into 2 separate parts, Part 1 before the 60% mark and Part 2 starts after the 60%, simply using byte-by-byte read-write, hence skipping the problem part.
Part 1 works ok, and Part 2 doesn't because the header is missing. But is it possible to fix Part 2 and use some software to add the header back? People said Project X is powerful, but I don't know if it can solve my problem (and if so, how). Any guidance is welcomed. Thanks!
Edit: I used ffmpeg to check and get this error report:
Full report on http://pastebin.com/yU6Y36Yw
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] no frame!
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] no frame!
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] no frame!
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period
[h264 @ 000000000042c480] SPS unavailable in decode_picture_timing
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] non-existing PPS 0 referenced
[h264 @ 000000000042c480] decode_slice_header error
[h264 @ 000000000042c480] no frame!
[mpegts @ 00000000004f8fe0] start time for stream 4 is not set in estimate_timin
gs_from_pts
[mpegts @ 00000000004f8fe0] start time for stream 5 is not set in estimate_timin
gs_from_pts
[mpegts @ 00000000004f8fe0] start time for stream 6 is not set in estimate_timin
gs_from_pts
[mpegts @ 00000000004f8fe0] PES packet size mismatch
    Last message repeated 3 times
Input #0, mpegts, from 'L:\HBPVR\TVClip\20170127.ts':
  Duration: 01:47:03.36, start: 0.083867, bitrate: 10069 kb/s
  Program 137
    Stream #0:0[0x30]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
`Stream #0:1[0x40]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s`
`Stream #0:2[0x41]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s`
`Stream #0:3[0x42]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s`
`Stream #0:4[0x50](CHI): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)`
`Stream #0:5[0x51](ENG): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)`
`Stream #0:6[0x52](CHS): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)`

Output #0, mpegts, to 'L:\HBPVR\TVClip\20170127h.ts':
Metadata:
encoder         : Lavf57.66.101
Stream #0:0: Video: mpeg2video (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9]
, q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc
Metadata:
encoder         : Lavc57.77.100 mpeg2video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
Metadata:
encoder         : Lavc57.77.100 mp2
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
Stream #0:3 -> #0:1 (ac3 (native) -> mp2 (native))
Press [q] to stop, [?] for help
[h264 @ 00000000022f9f20] co located POCs unavailable
Last message repeated 1 times
[h264 @ 00000000022fa8c0] mmco: unref short failure
frame=   40 fps=0.0 q=31.0 size=     651kB time=00:00:01.96 bitrate=2720.2kbits/
frame=   93 fps= 92 q=31.0 size=    1198kB time=00:00:04.08 bitrate=2406.4kbits/
frame=  136 fps= 90 q=31.0 size=    1554kB time=00:00:05.80 bitrate=2195.1kbits/
frame=  185 fps= 92 q=31.0 size=    1991kB time=00:00:07.76 bitrate=2102.1kbits/
[mpegts @ 00000000004f8fe0] PES packet size mismatch
[h264 @ 00000000022fad80] error while decoding MB 118 48, bytestream -72
[h264 @ 00000000022fad80] concealing 2331 DC, 2331 AC, 2331 MV errors in I frame
[ac3 @ 00000000022f6f00] incomplete frame
frame=  221 fps= 11 q=31.0 size=    2409kB time=00:00:09.20 bitrate=2145.2kbits/
L:\HBPVR\TVClip\20170127.ts: Permission denied
Last message repeated 6 times
frame=  227 fps= 11 q=31.0 Lsize=    2550kB time=00:00:09.48 bitrate=2203.5kbits
/s dup=0 drop=1 speed=0.46x
video:1917kB audio:408kB subtitle:0kB other streams:0kB global headers:0kB muxin
g overhead: 9.644997%

Try with ffmpeg on the full file. First ffmpeg -i in.ts -c copy out.ts. Else, ffmpeg -err_detect ignore_err -i in.ts -c copy out.ts

@Mulvya I tried both commands, and both returned the error: [mpegts  at 000000000043a960] PES packet size mismatch
frame=111064 fps=1000 q=-1.0 size= 4625636kB time=01:03:29.35 bitrate=9947.4kbit
L:\HBPVR\TVClip\20170127.ts: Permission denied

Try ffmpeg -err_detect ignore_err -ss 3800 -t 120 -i in.ts out.ts -report and post the report file generated.

Paste the full report into your Q as code.

Full report, please. Use pastebin or similar if it's too big.

@Mulvya Added the link for the full report. Strangely using the latter command you provided, the detection stops at Frame 227, but using the former command, the detection stops at the error point which is around 1 hr 03 min.

In the latest command, ffmpeg is starting at 1h3m20s and stopping at roughly the same point as the first command. Now, some trial and error is needed. Run my last command, but experiment with the ss value till you get a playable output. Start with 3809 and increase it.

@Mulvya I have found a way to work around it, just using the dd command in linux to split files and skip the problem part. Thanks!

I used the Windows version of the Linux command 'dd' to solve the above problem. Using the strategy stated in the question, I split the file into 2 parts, the first part up to 60%, the second part from 60% after the problem bytes until the end. The 2 resulting files can be read, without any need to add extra headers.
The previous attempt (I wrote a program to split the files into 2) failed, just because my compiler seems not supporting files larger than 2GB using fseek().

A lot of players have problems with file sizes over 2GB. Set file limits in your record program if this is s common problem.

Hi there. It appears you've found a solution. Just let you know that, since no answer received any up vote or being accepted, this post was bumped to home page. Just tick the answer and it will be marked as accepted.

I had success using Roadkil's Unstoppable Copier to copy a corrupted file from a DVD (DVD was badly damaged) some years ago: https://www.roadkil.net/program.php?ProgramID=29
It at least gave me "complete" files, that I was then able to feed into other software to extract the still readable sections of video.

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

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


text:
After Effects - Particular Rendering
I'm not really doing video production as living, just for fun. So my knowledge is very limited.
In the Trapcode Particular I'm creating a particles with simple 3D emitter:

Now, I only want particles to come from the top of the icon, so what I did is using Linear Wipe to cut off the emitter source to hide those bottom particles:

Now, my question is does After Effects actually render and process those hidden particles ? Or he is smart enough to know it will never be visible and he skips them ?
Edit:
Forgot to mention that the Linear Wipe is actually on the Particles Effect.
I also have it on the Emitter source, but for some reason it generates particles ignoring the Linear Wipe on the Emitter Source. (The Linear Wipe of the Emiiter Source is on a pre-composed of the icon)
Edit 2:
I actually went inside the Pre-composed emitter source, did a Mask Subtract and the I think that it should of solve my rendering issue ?
So, to sum up my questions, does the issue I described actually happens ? and does my solution with the mask solved it ?

I think you have answered your own question, but let me try to answer it from the perspective of a programmer (not one who wrote After Effects, but one who has written a lot of programs and seen a lot of source code).
After Effects (or any other compositing program) operates on layers.  Layers can be combined, masked, or used as inputs to transformations or operations.
The layer that contains your icon doesn't know about any processes or effects that come after it.  If you apply a particle emitter to that layer, particles will be emitted regardless of whatever masks come later.  Some particles may be masked by later layers/operations, but none of that affects what particles may be emitted due to the shape/color of your icon.
When you compose your icon with a mask, and then apply the emitter to that result, then of course the emitter is starting with the masked pattern.
Which is correct?  It depends what you want.  If you want to show lots of particles being obscured by a mask, the first is what you want.  If you want to show an alternative shape emitting particles, the second is what you want.

I think the options I tried and the solution I came with, it is probably also because I'm coming from a programmer background, like the great answer you gave. I was able to guess what could happen from the AE source code. AE is a complex program, and where it comes to effects. Especially Particular it could be very expensive for the AE to try and calculate on each particle if it as a FOV of rendering, if it not being hidden by a different layer/effects, if it not being hidden by a different composition, it includes checking for the alpha channel for each of them to understand if the part of th

... if the part of the layer on-top is actually transparent and the particle can be visible, much more complicated where things are 3D rather than just 2D layers. And much much more, and actually. just rendering the particle could be much more effective. So I came with the 2nd solution because I thought it from the computing process rather than what is looks like. Linear wipe on the particles or emitter is the same for us to see or the final results. but it is really different when it comes to performance.


text:
Show cams of the multicam sequence simultaneously in Adobe Premiere
I’ve got a multicam sequence and I spent a lot of time on it cutting out lots of material.
Now I decided to show two cams simultaneously for a while.
But how to do this? Can anybody help?

Hum… I think, I should flatten the footage and move it to another track.

You don't say what video editing software you are using, but assuming it's either Adobe's Premiere Pro, Davinci Resolve, or FinalCut Pro X, the general answer is the same.  Multicam is a convenience for you as an editor to use a special viewer in your NLE to view (and cut) multiple camera angles at the same time.  To output two cameras simultaneously, you need to have two video layers visible at the same time, one for each angle.  If you zoom and pan one video layer so that it occupies the left side of your output and you zoom and pan the other video layer so that it occupies the right side of your output, you can show two cameras at the same time.
Another way to show two video camera views at the same time is picture-in-picture.  In this case, one layer can be full-sized and a second layer, placed on top, can be zoomed and panned to wherever you want the picture-in-picture image to be (usually lower right).
It doesn't really matter whether the video layer source is an active mulicam or a flattened multicam (which resolves to a simple video layer).  What matters a lot is that you have scaled and located the video footage so that both layers are visible at the same time.

I said it in tags. )


text:
openload.cc How can I extract encoding settings of videos?
My customer needs streaming service for his IP cameras and he ask me about same output quality as videos in openload.cc but I can´t simulate similar quality.I tried several encoding combination but nothing works fine.
My client needs reduce quality/size with good visibility in output I ask my client about choice which online service has good visibility for him and he choose openload.cc
Sample is here 480p (sorry about warez but I can´t find no warez content on openload
So I need find encoding settings now.
I try to save file and then use mediainfo but mediainfo did not detect full encoding settings (like CRF, one or two encoding pass, specific video bitrate - mediainfo detect only range of bitrate...)
I use ffmpeg as encoder so now I need to know which settings I need to use for same output quality as in 480p sample.
Thank you for help me.

Does the output from the IP camera look good or bad? Because if it already looks bad before you do anything with it then there is nothing you can do to improve the quality. What did you try? You should show your ffmpeg command and the complete console output.

Original video from cameras is good quality but Xvid codec is used so I use ffmpeg for live transcoding to AVC because Xvid can´t be streamed.

clarification:
AVC can use less bitrate with good visibility - for example:
Original IP camera video (Xvid) 40 minutes -> about 350MB
Openload video 480p (AVC) 40 minutes -> about 180MB

Assuming it has been encoded with x264, download the file and run:
strings input | grep x264

It may output encoding information such as:
x264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 -
http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0
analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16
chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4
threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0
direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40
intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00

Do not copy and paste the displayed options and values–instead use the appropriate preset. Using the info above it is safe to assume the default settings were used (equivalent of using -preset medium -crf 23).
I'm assuming you're running Linux since you did not specify. If you're using Windows then mediainfo will likely also provide the same info if it is there.

The OP says, mediainfo did not detect full encoding settings (like CRF,..., so I'm guessing that the SEI was removed, if it was encoded with x264.

@Mulvya I read that but completely forgot it when writing the answer. The question is almost too broad to suggest much else; some short and easy to download samples could be helpful.


text:
Create cuts automatically by audio wave form in Premiere Pro CC
I always cut my videos of the trips I'm doing. And I noticed that it is often the same that I cut out the parts where nothing is said and keep only the parts where somebody is talking.
Is there a plugin or a way in Premiere Pro CC to automatically create the cuts in a sequence where the audio changes from a lower to a higher value than a certain threshold?

Not that I've heard of, however, you could add Dynamics / Compression to your audio track and essentially compress out the low gain sections.
On your Audio Mixer Window, drop down the the filter section at top for the track all your audio resides on.
You will want to add Compression, not Expansion. Add some Gain MarkUp, 5-10 dB. Check Limiter, set to -2 dB.  Then adjust the ratio/gate/threshold so that the compressor will do as follows:
Add 5-10 dB of Gain to the entire track; depending on your source, you'll need to adjust that by levels/ear.
The gate/ratio will then if set correctly, only allow anything "Above" "X dB" to pass through the threshhold.
Loud sounds will be MarkUped as well, however, the compressor will not overmodulate if you adjust correctly and use the Limiter.
So if your video is nothing but low "breeze" noise, it will be cut to zero. Audio will need to "pass" the threshhold, and the attack setting will adjust how fast it allows passable audio to become audible and how fast it closes the gate after the audio falls below threshhold.
It sounds more complicated than it really is. If you follow the steps, play with the settings, you'll get it.
The filter is called DYNAMICS


text:
ffmpeg: add 3 seconds of black to video head and tail
Let's say I have a video, which can have any dimensions or codec (e.g. mp4), and I want to add 3 seconds of black frames to its head.
I have seen other variants to this question which pertain to adding a single frame, and also answers which specify the width and height of the video. However the video can be of any width and height and I don't want to change those values. Just add the black. In a separate command, I'd also like to add the seconds of black to the tail.
There should be no audio in the black section - the black should just be concatenated to the front and end. Also, I'd like to avoid re-encoding the video if possible, and copy the result to a new file.
Any help would be appreciated.

Is audio present? And do you want to skip re-encoding the main video?

@Mulvya thanks for your input. I've updated my question.

@MattC  You can delete the above comment now. This will need multiple commands, unless you re-encode. Is that ok?

@Mulvya yes multiple commands is good. Thanks again.

The basic method to join videos without re-encoding is to use the concat demuxer. This device requires that the files being joined share certain properties, like codec, framerate, video dimensions, timebase..etc
First step is to create the blank segment, which may be used both at the head and tail.
ffmpeg -i fullvideo.mp4 -vf trim=0:3,geq=0:128:128 -af atrim=0:3,volume=0 -video_track_timescale 600 3sec.mp4

Have to do one bookkeeping step for the full video. If not done, the combined video will likely run at the wrong speed.
ffmpeg -i fullvideo.mp4 -c copy -video_track_timescale 600 full600.mp4

Next, create a text file.
file 3sec.mp4
file full600.mp4
file 3sec.mp4

Then run
ffmpeg -f concat -i list.txt -c copy merged.mp4

My first step assumes that the video stream has the most common pixel format yuv420p. Which should be fine as this is the only pixel format supported by web players and smartphone cameras, consumer camcorders..etc. If it's not, the geq filter may fail.
I also assume, tacitly, that the full video does not use more reference frames than produced by preset medium of x264. It's a safe assumption for 95% of videos.
Finally, I assume the full video has AAC-LC as its audio codec. Expected to be true of most phone/cam/web videos.

Where does the 600 come from? Is it possible to look that up from my current input without reencoding the entire video?

The 600 is the timescale used. It's the tbn value for the video stream. Yes, you can use the existing timescale but the other inputs have to match.

Do you know why I'm getting the error muxing overhead: unknown at the last step?


text:
Screen Capture in ffmpeg with jerky movement
I'm using ffmpeg to capture a portion of my screen, save it as a movie file, and stream it to a Youtube live event.
The result is a jerky movement. The log has some issues I'm not able to understand and solve. I did a lot of different try, but with no result.
This is the actual Command line I use:
"C:\\mbiWebTV\\programs\\ffmpeg\\bin_x86\\ffmpeg.exe"
-thread_queue_size 512 -report -re -rtbufsize 2000M -f dshow
-i "audio=Missaggio stereo (Realtek High Definition Audio)"
-f dshow
-i "video=screen-capture-recorder" -filter:v "crop=713:379:018:043"
-s 848x480 -video_size 848x480 -vcodec libx264 -preset ultrafast
-maxrate 6000 -bufsize 2000M -pix_fmt yuv420p -g 60 -acodec libmp3lame
-b:a 128k -ac 2 -ar 44100
-f flv rtmp://a.rtmp.youtube.com/live2/xxxx-xyyv-0rrm-f9g2
-filter:v "crop=713:379:018:043"
"c:\\mbiWebTV\\Capture\\Capture_20170225_165829.mkv"

I could send the complete log file.
This is the error messages that frequently occurs:

[dshow @ 049a4240] real-time buffer [screen-capture-recorder] [video
  input] too full or near too full (545% of size: 3041280 [rtbufsize
  parameter])! frame dropped!

The rtbufsize is only affecting the audio.
Try
ffmpeg.exe
-thread_queue_size 512 -report -rtbufsize 100M -f dshow -i "audio=Missaggio stereo (Realtek High Definition Audio)"
-rtbufsize 1000M -thread_queue_size 512 -video_size 848x480 -f dshow -i "video=screen-capture-recorder"
-vf "crop=713:379:18:43,scale=848:480,setsar=1"
-vcodec libx264 -preset ultrafast -maxrate 6M -bufsize 12M -pix_fmt yuv420p -g 60
-acodec libmp3lame -b:a 128k -ac 2 -ar 44100
-f flv rtmp://a.rtmp.youtube.com/live2/xxxx-xyyv-0rrm-f9g2
-filter:v "crop=713:379:18:43" "c:\mbiWebTV\Capture\Capture_20170225_165829.mkv"

I changed only the position of  -video_size 848x480 parameter and it worked very well.

The laptop I use is an Intel I7, now I made the same test on a different laptop (intel celeron) and after few second I get real-time buffer too full or near too full .

Output file #1 (c:\mbiWebTV\Capture\Capture_20170225_AAAAAA.mkv):
Output stream #1:0 (video): 222 frames encoded; 222 packets muxed (366088 bytes);
Output stream #1:1 (audio): 10680 frames encoded (683520 samples); 670 packets muxed (199011 bytes);
Total: 892 packets (565099 bytes) muxed
253 frames successfully decoded, 0 decoding errors
dshow passing through packet of type video size  8392758 timestamp

dshow passing through packet of type video size  8392758 timestamp 11976436850000 orig timestamp 11976436850000 graph timestamp 11976436850000 diff 0 screen-capture-recorder
[dshow @ 04472460] real-time buffer [screen-capture-recorder] [video input] too full or near too full (86% of size: 1000000000 [rtbufsize parameter])! frame dropped!
dshow passing through packet of type video size  8392758 timestamp 11976437520000 orig timestamp 11976437520000 graph timestamp 11976437520000 diff 0 screen-capture-recorder

You'll have to increase the rtbufsize.just before the video (provided you have enough ram).


text:
1080p videos encoded in H264 are not playing in Safari
I'm doing HTTP live streaming of 1080p video encoded in H264 with Main profile level 4.1.
However Safari is unable to play the video. I can only hear the audio.
The streaming is working fine with Chrome and Firefox.
When I try to download the video segment in .ts format, QuickTime player is unable to play while VLC player is playing.
I'm assuming that something is wrong with the video encoding. The same video is doing fine with Baseline @3.0 in 720p resolution. What could be the issue?

Show mediainfo readout of file. Use View -> Text mode.

Link to mediainfo readout file: https://drive.google.com/file/d/0Bx7SpoNBrww7YlB5ZTVqRTNIUEU/view?usp=sharing

Why does your "standard" say PAL when your video is supposed to be progressive?

Fixed the issue. Transcoding the video to progressive worked.


text:
Adobe AE with Element3D to work with Intel Graphics
I use Element3D most of the time when I edit videos, however, there's a problem.
This Adobe After Effects Plugin works with NVIDIA GeForce Palit 210 1GB but I didn't use the graphics card because it performs too slow / let's say not capable for 1920×1080 resolution but for 1280×720 only.
At the moment, I'm using my motherboard's/processor's built-in graphics card/display/driver, but it happens that I can't use the Element3D because it says that it can't initialize the OpenGL. I'd check my processor graphic specs and I find it capable though of OpenGL 4.4. My question is, How am I able to make Element3D run with my graphic preference/spec/settings. (See Specs and Error Messages below)
My PC Specs:

Main Storage: 256GB Crucial SSD
Secondary Storage: 500GB Hitachi HDD
Processor: Intel Core-i3-6100 @ 3.70Ghz (6th Gen)
Memory: 8GB (7.44 Usable)
OS: Windows 7 Professional 64-bit
Graphics: Intel HD Graphics 530, 2GB (Excellent in games and video editing, even at 1080p, it's just that Element3D Don't Work)

Error Messages:
First, when dragging the effect to the timeline:

Doing it again, and opening its dialog box / control panel or whatever you call it (after clicking ok on this picture, it makes my Adobe AE Not responsive and I'll just close it)

You should check VideoCoPilot's website in regards to system requirements.
Based off first glance; your system is not cut out for working with Element3D in AE.
AE alone is going to strain your system. At the very least you're going to want to run E3D in AE on a i7 processor setup (preferably XEON); as many cores as possible, as AE can multi-thread; and not rely on an onboard graphics card.
I run E3D on a dual E5-2697 v2 (48 Cores HT), with 128 GB Ram; and a Titan Black GPU and I still wish it could be more responsive and faster.
At the VERY least; you're going to need to bump up to 32 GB ram; recommend 64; and a much better processor.
Your OS and system services are going to tie up 1.5 GB of your 8 GB ram; and AE alone will hog another 3-4 GB with no plugins running. It's my opinion you simply don't have the power to run this config on your system.

All works fine even it's just that. It is just that the E3D dont work with Intel HD Graphics. I just wish there's a workaround for it. I even use it with Twitch, Optical Flares and whole set of Red Giant plugins.

You can't!
See supported GPU list here on Videocopilot website:
http://www.videocopilot.net/docs/element/installation_and_compatibility/specifications/


text:
Imported video getting out-of-sync audio in Adobe Premiere
I have an MKV video with a few out-of-sync points caused, probably, by a 3rd-party program, used to remove some commercials from it directly from the MKV.
So watched the video several times in VLC manually adjusting the delay while taking notes of the different amounts needed.
Then I started the slicing proccess, but first, because Premiere is "cocky" and don't handle MKV files directly, I converted it to an MP4 with FFmpeg:
ffmpeg -i /path/to/video.mkv -c:v copy -c:a copy /path/to/save/video.mp4

After slicing all pieces needed and creating Subclips from them, I exported them all, manually instead of using Adobe Media Encore, with the exact same settings.
However, analyzing them with MediaInfo, although most of the files where in CBR, a few were in VBR.
I ignored this and applied the delays, individually, with FFMPEG again:
ffmpeg.exe -i "/path/to/slice.mp4" -itsoffset 0.05 -i "/path/to/slice.mp4" \
           -map 0:v -map 1:a -c:v copy -c:a copy "/path/to/sliced.mp4"

(Being 0.05 an advancing of +50ms)
Since I already used FFmpeg to join files in past, for commodity, I used it again to concatenate the modified files:
ffmpeg -f concat -i list.txt -c:v copy -c:a copy "video.mp4"

(Being list.txt a list of each adjusted file, one per line)
Some of the cuts occurred during action scenes and when joined with concat it's pretty noticeable a "click" where two of the clips were concatenated. Other than that the result was perfectly synced.
But those "clicks" were annoying me so much that I imported this file into Premiere again and added a centered Constant Power Audio Effect at the junction of the two clips to get rid of them.
At first, I didn't notice and rendered this faded audio file. But when watching it on VLC, going straight to the first junction, it was completely out-of-sync-again.
Then I watched it on Premiere and found the problem in there.
I've searched for a solution and one of them suggested me to use Handbrake to convert it from VBR to CBR, but didn't show how <_<
The other suggested to rename the file changing the .MP4 extension to .MOV to counteract an apparent bug in Premiere Importer. This didn't work for me, perhaps because I'm using the CC version and the "tutorial" was with the Pro version (if there was indeed a bug, it might've be fixed between versions).
And now I don't know what to do because the meticulously adjusted clip segments can't be fine tuned in Premiere because it is undoing all this hard work.

Pardon if I didn't catch all the details, but you have a video with out-of-sync audio? Load it in Premiere, perform all the audio sync adjustments. Don't touch the video. Export the audio only. Make sure your render region corresponds to the video track length. Mux the rendered audio with the original video in ffmpeg.

At first I opted to re-sync with FFMPEG because I already did that easily in past and because I didn't find a way in Premiere to adjust the audio by milliseconds. There were seven segments that needed to be adjusted by tiny amounts, from -200ms to -500ms

200ms to 500ms corresponds to 5-15 video frames. Premiere must allow you that.

It sounds like your source media went through quite a lot of different operations, which makes it difficult to say what exactly has upset the audio/video sync.
I would start by trying to isolate the problem: repeat the process on a smaller scale (just one cut/edit, instead of the whole thing) and verify the output at each stage. That will help you understand where exactly things have gone wrong. Then, you could edit your question and present us with an isolated example of an operation that affects the sync. That should make it easy to resolve the problem.


text:
Clips appear "zoomed" in program monitor (Premiere Pro)
This is frustrating the crap out of me.  I'm putting 1920×1080 clips into a 1920×1080 sequence.  There are also some 2560×1440 clips in it, and those actually display correctly, but the 1080p clips are zoomed in the program monitor.  Before this zoom problem, there were bars on the top and bottom.

These are my sequence settings.  I know the frame rate is different from the source clips but that shouldn't be causing this issue?

When I drag a clip to the new item button and it makes a sequence, that clip works the way I want it to.  But the settings on that new sequence are the same as what I've got already.  (Also I feel like there must be some easy solution that I'm overlooking, so sorry if this is a noob question.)
Thanks!

Please add video-file properties

Right click on the clip you placed in your sequence and select 'Set to Frame size' and your clip will automatically be resized to fit the size of the current sequence.
You may also wish to reset the magnification of the Program Monitor by right clicking on the clip shown in the monitor and selecting 'Magnification > Fit'.

You can adjust the scale of an individual clip in the effects controls tab under transform. If you have a lot of clips like this I’d recommend copying the first clip with the proper scale, selecting all the problem clips, and using “paste attributes” selecting transform as the attribute.

Go to effects on top right corner > scroll to effects again > transform > auto reframe and drag to all effected clips.


text:
Video File Navigation
Is there any way to provide navigation in a video file like a DVD or Blu-Ray?
I know that QuickTime supports Chapter Markers, but the codecs you can use with QuickTime result in very large files. As far as I know, you can't use H.264 with QuickTime (for example).
I create a lot of training videos and I need a way to provide a way to navigate though complex material.
So I am looking for 2 things:

Reasonable file size (like H.264).
Content navigation.

Your assumption about quicktime is incorrect. You can indeed use h.264, the quicktime container is pretty much synonymous with the mp4 container.

MKV/MP4 container support chapters too, it also supports h264 and almost any other codec. MP4 container based on MOV container, so you can try to include h264 in MOV too.

Can you elaborate a bit on how to add the chapters so the OP and others have some place to start?

Yes I did initially use h264 with the .mov container, and it will work 9in that the encoding will proceed, but was informed by someone who knows way more than I do that h264 and .mov don't play well together and putting h264 in a .mov container affects quality and is a no-no for professional work. My experience so far confirms this. Also these files mostly go to Windows machines for distribution and I don't really want to give the clients quicktime files.

@clarkland Just rename "mov" files to "mp4" and your clients will be happy. If you can patch 4 bytes in header, after 8th byte to "mp42" no one can distinguish from the mp4. Files "mov" and "mp4" almost SAME files and have SAME structure. It can't affect quality in any way. Only one case, when it can affect quality, it's broken software. I don't have mac, so I don't know how common mac software works. Just render same clip in both containers and compare quality. It must be same.

On a mac, subler is likely the easiest tool to use to add chapters, https://subler.org
I would make a H.264 MP4 file as your output (it will be the most broadly compatible format to use), and use subler to add the chapters to that.
Note that not all devices will support the chapters for playback, most common players (VLC, iTunes, etc) will be fine, but various TVs and other devices won't necessarily understand the chapter marks. Not much you can do about it, just be aware that this will happen.
Also try to keep your files under 4GB, lots of things you plug a USB into will only support FAT32, if your files go >4GB, you'll be making them unplayable to various devices.


text:
How to detect whether a video is shaky
I need to stabilize a video only when the video is shaky.
I have successfully stabilized a video using FFmpeg, and I do not need to stabilize all the videos, I only need to stabilize the videos which appear shaky (not stable).
Is there any way I can detect that?

ffmpeg does not have a built in function to do this. You're basically needing to write an algorithm that will analyze pixels frame by frame.

Try ffmpeg's deshake filter. It scans the full frame (or a portion of your choosing) and detects shake based on a number of adjustable variables. If the video isn't shaking, it doesn't change the content. You can run the default settings with:
ffmpeg -i [input] -vf deshake [output]
Great little demo here. It's a combination detection and repair tool, no need to separately identify videos then reprocess.

You can cut the part you want to stabillize, you can count the seconds you want to stabillize, then you stabillize it, cropping may appear. You need to edit, whether you want to scale and enlarge all video parts or other editing ways based on what you want.

He's looking for a way to have the computer automatically detect whether or not a video is shaky.  He knows how to stabilize it.

I think you're looking for a way to automatically detect shaky footage.
You can kind of do this in After Effects, assuming that there are consistently trackable points in the background of your footage.
Import your footage into after effects.
Set up a couple of motion tracking points
Analyse motion tracking across your footage
open the twirly controls on your layer until you find the Confidence value.
Examine the confidence values over time.  When it drops dramatically, your footage is shaking.
This could be automated further by using an expression to highlight where the footage is shaky, or by exporting the confidence keyframes into a spreadsheet alongside the video timings.
I suspect there's a better tool for doing things like this (maybe inside ffmpeg or DaVinci resolve?) but I don't know...

You can use any Video Editing Software e.g Adobe Premier Pro, you can see frame by frame, if the frames contained Double-lined, Shaky Motion-blur frames, then Stablize it as you say. You can use Sharpen on Mask Layers on top of Video to see, because you can see shaky after Sharpen. Or you can see the shaky by mute your audio, and Make it Slow Motion for while, remember to change it back to normal speed.
In fact that you have to find where's shaky by your own manually. Because this year still haven't come out Auto-Detect Shaky Video Plugin or Software. But, it is already has Plugin for perfect shaky detection & Stablize Plugin here. You can find more Perfect plugin for you video editing software.
Only a Programmer, can let Python Script in software help them auto-detect it. Here's Script But, the video will broke if you use that scripting.
The best option to avoid Shaky Video is Buy a Video Stablizer, it is a tool for stable video.


text:
What player do you use?
After my experience with FFmpeg created content: different player, different results.
So what player do you use to look at you footage?
Does someone know a player where you can check current frame meta information (PTS, frame number, pict type)?
manu

I was a rusted on MPC (and more recently its derivatives MPC-HC and MPC-BE) fan until recently when the MPC devs flagged that it would not be continued. So I started looking to see what else was out there.
While the MPCs are still very capable players I've increasingly been using MPV, another mplayer-derived open-source project.

It has a fairly minimal UI (which IMHO is a good thing),
it is GPU-rendered and seems to be pretty resource light–on my machine we've been watching 6K camera footage in ProRes without problems.
It's easily configureable, has useful features such as colour management and HDR,
plays most codecs and formats that I throw at it without problems
It's cross platform, so if you swap between PC, OSX and Linux you can use it on all of them.

Another player that is useful to know is djv-view. This comes with some very useful tools such as histograms, RAM-caching for smooth playback and jog-shuttling and so on. It doesn't have audio so it's nto a general purpose media player, but it's a real winner for playing image sequences that would struggle to play smoothly otherwise–as long as you have the RAM for it. This is also cross-platform, available for PC, OSX and a linux package manager near you.

i am looking for features like showing PTS, DTS, Frametype, Framenumber, Jumping from I-Frame to I-Frame
is this possible with one of those?

Not sure. They're both free, have a try and see.

Different media players give different results not because of encoding software, but because of their own implementation of decoding functions or selection of the installed codecs.
IMHO the best players for serious work are MPC (MPC-HC) and VLC.


text:
Problem setting different framerates with FFmpeg map option
I am facing a problem to set video streams framerates with FFmpeg when using the map option.
Here is what I want to do:
Given an input video file of 60 fps, I want to generate an output file containing two video streams: one with 60 fps (as the source) and the other with 30 fps (half the source's framerate).
I executed this command:
ffmpeg \
  -i input_60fps.mov \
  -map 0:v \
  -map 0:v \
  -crf:v:0 23
  -c:v:0 libx264 \
  -s:v:0 640x360 \
  -vf:v:0 fps=fps=30/1 \
  -crf:v:1 23 \
  -c:v:1 libx264 \
  -s:v:1 1920x1080 \
  -vf:v:1 fps=fps=60/1 \
  -f mp4 \
  out.mp4

This gave me the wanted output file but with streams of 60 fps!!
Am I missing something? I did many tests, I am wondering if FFmpeg has a problem to set different framerates when using the -map option!!
Waiting for your help! Thank you …

-vf does not accept stream specifiers. You can use e.g. -filter:v:1 for that.
However, you need not use the fps filter at all; output -r will do.
ffmpeg -i input_60fps.mov -map 0:v -map 0:v -c:v libx264 -crf 23 -s:v:0 640x360 -r:v:0 30 -s:v:1 1920x1080 -f mp4 out.mp4


text:
Overlay an Image onto a resized video. FFMPEG

I have an image which is a frame of 1024×1024 resolution which is half empty or transparent... I have various number of videos of different resolutions and I want to scale them to the empty space width and height(might be 1024×512) by keeping the aspect ratio of the video unchanged and I want to add padding for the empty space.
Whenever I'm trying to overlay the image over the video, the output video is in the resolution same as the input video's because of which half of the frame (input image) is getting cut in the output video.
I need help... I want the output video to have the resolution of the input image not of the input video's. It should more or less look like PIP. Can I do that on FFmpeg??

What is the size of the window area?

I'm not sure actually ... But consider it around width~1024 and height=512..So almost 1024*512. Like height is half the image size and width is almost the same.

I'll assume the window area is 1004x512. You can adjust the command below after getting the exact values.
ffmpeg -i video -i frame -filter_complex
       "[0]scale=1004x512:force_original_aspect_ratio=decrease,
           pad=1024:1024:10+(1004-iw)/2:10+(512-ih)/2[vid];
        [vid][1]overlay"  output

The 10 in the pad expressions represent the border thickness.


text:
FFmpeg concat creating time jumps
I am creating timelapse from PNG single frames.
Using the first and last frame as stills I create a header and a trailer with a text and a fade filter. In the end I use concat to put all parts together. What I see happen is that in the final video there is a jump between the end of the main body and the trailer. It seems as if the concat process has cut away some frames (at the end) from the main body. That makes the transition from the main body to the trailer look very bad.
What do I have to do to fix this?
Header
------
/home/tools/bin/ffmpeg -loop 1 -i Timelapse_1080/IMG_7255.png -c:v libx264 -vf drawtext="fontsize=60:fontcolor=yellow:fontfile=/usr/share/fonts/truetype/freefont/FreeSans.ttf:textfile=./Scripts/header_text.txt:x=(w-text_w)/2:y=(h-text_h-line_h)/2" -t 5 -pix_fmt yuv420p  -crf 16 -r 24 -y ./Video/header_txt.mp4
/home/tools/bin/ffmpeg -i ./Video/header_txt.mp4 -vf fade=in:0:48 -crf 16 -r 24 -y ./Video/header_txt_fade.mp4

Timlapse body
------------------
/home/tools/bin/ffmpeg -start_number 7255 -i Timelapse_1080/IMG_%04d.png -pix_fmt yuv420p  -crf 16 -r 24 -y ./Video/body.mp4

Trailer
--------
/home/tools/bin/ffmpeg -loop 1 -i Timelapse_1080/IMG_7490.png -c:v libx264 -t 6 -pix_fmt yuv420p -crf 16 -r 24 -y ./Video/trailer.mp4
/home/tools/bin/ffmpeg -i ./Video/trailer.mp4 -vf fade=out:20:60 -crf 16 -y ./Video/trailer_fade.mp4

Concat all together
-------------------
/home/tools/bin/ffmpeg -safe 0 -f concat -i ./scripts/ffmpeg_concat_all.txt -c copy -y ./Video/Timelapse_crf16_24fps.mp4

There's no need to work with individual files; you can put everything into one ffmpeg command. This is also much faster and will result in better quality.
Define your three inputs (intro image, outro image, and the image sequence), then create individual filters to draw the text, trim the intro/outro clips, and run the fade filters. Finally concat everything into one stream.
I have omitted some specific text options and image file names for the sake of brevity.
ffmpeg \
    -y \
    -loop 1 -framerate 24 -t 5 -i intro.png \
    -loop 1 -framerate 24 -t 5 -i outro.png \
    -start_number 1 -framerate 1 -i frame-%04d.png \
    -filter_complex " \
    [0:v] \
        drawtext=fontsize=500:fontcolor=white:text=foo:x=(w-text_w)/2:y=(h-text_h-line_h)/2,
        fade=in:0:48 \
    [intro]; \
    [1:v] \
        drawtext=fontsize=500:fontcolor=white:text=foo:x=(w-text_w)/2:y=(h-text_h-line_h)/2,
        fade=out:20:60 \
    [outro]; \
    [intro][2:v][outro] \
        concat=n=3:v=1:a=0
    [outv] \
    " \
    -map "[outv]" -c:v libx264 -pix_fmt yuv420p -crf 16 out.mp4

The -t 5 sets the duration of the intro/outro directly.
You can replace the input -framerate parameters with the desired frame rates of the intro and outro, and also change it in order to set the slideshow speed. That is, if you want one image every second, use 1, if you want one every two seconds, use 0.5, etc.

Can just use -loop 1 -framerate 24 -t 5 -i intro.png instead of fps/trim filters.


text:
Format and codec for a video with 5760×1080
For an art installation I need to project on 3 projectors (1920×1080).
My playback setup is: 1 PC with Windows 7, SSD, NVIDIA GeForce GTX 980 and 3 projectors (1920×1080).
The video I need to project has a width of 3 x 1920 = 5760 and a height of 1080.
The editing is done with Premier Pro CC 2018 (version 12.1) under Windows 10.
What video format and what codec should I use for the final export from Premier Pro

to allow the oversized width,
to have a good quality for a large screen projection,
so that it is not too heavy for the system?

For playback the best codec is unarguably h.264 (AKA MPEG-4 Part 10, or MPEG-4 AVC, or just plain 'mp4'). H.264 in an mp4 container allows for small files with good visual quality, the ability to tune the settings to achieve tradeoffs between size, compatibilty and quality, and almost universal playability with modern devices.
In the Premiere export window choose H.264 as the format. There are numerous presets available, but most won't be relevant because of the unusual dimensions of your video. The ones you should be looking at are the ones called Match Source-[...] bitrate. Depending on the playback machine you should try the High bitrate first. Adaptive High Bitrate will give you a lower file size by increasing the compression (= lowering the quality) in parts of the video that don't need it, but for local playback this is not really an advantage.
The Match Source bit means that the encode will be done at the same frame size as your sequence.

If you are having trouble playing back the mp4 you might want to look at the profile in the Video tab of the encoding settings. Simply put, this determines how comlex the task of de-encoding the file is. For lower-powered or older machines use the Main profile, but if your playback machine can support it use High Profile.

High10 lets you use 10-bit encoding. For a final playback file this is usually unnecessary, unless you're using a 10-bit monitor (if you don't know then you're almost certainly using an 8-bit monitor) it won't make any perceivable difference, and will limit the compatibilty for playback.

or just plain 'mp4' --> let's not contribute to confusion between codecs and containers.

@stib Thanks. I tried what you suggest but the width does not match the sequence setting (5760). It is set to 4096. When I try to set it manually I cannot go over 4096. How to get the right width of 5760?

Oh yeah, Premiere uses a H264 encoder which only allows frame sizes within permissible limits of the highest level. Although the standard now goes upto 6.2, it went upto 5.2 at the time of development. You'll need to export using some other codec and then use ffmpeg/Handbrake..etc to transcode to H264. @stib will have a better idea which codecs in Premiere allow 4K+ output.

That's annoying. Hmm, If you're on a mac use prores 422, on Windows use goPro Cineform or Avid DNxHR. I can't remember which of these are already installed with premiere, and I can't guarantee that Premiere will let you encode at your desire size, so have a play. Then use ffmpeg or handbrake to do the conversion. If all else fails use uncompressed and delete after your done.


text:
How to apply different filters to different parts of a video using AviSynth?
I have a video file and I want to post-process it using AviSynth. Different parts of the movie require different filters to be used (noise reduction etc.). How can one use different filters for different parts of the input video?
What I once did is to trim the video into segments, apply different filters on them and then concatenate the segments back together. Something like this:
a = clip.Trim(0, 100).RemoveNoise("high")
b = clip.Trim(101, 200).RemoveNoise("low")
clip = a + b

Is there any other way to do this? I am asking, because the more segments you create, the more cumbersome the script becomes.
I've read that AviSynth+ supports arrays. So one might create an array with the frame indices and then build the final clip using a loop. Something like this:
original = last
segments = [ \
    [ 0,  100, "high"], \
    [101, 200, "low"] \
]
clip = BlankClip()
for (i = 0; i < segments.Size; ++i)
{
    clip += original.Trim(segments[i][0], segments[i][1]).RemoveNoise(segments[i][2])
}

This way one could create an array, holding the segments. But, it seems to me that despite this post here, AviSynth+ does not support arrays at the moment.

This can be done using the filter ClipClop. Here is an example script from the docs of the filter:
Avisource("D:\avs\test.avi")
ORG=Last

V1 = FFT3DFilter(Plane=0,Sigma=1.6)     # Light Luma
V2 = FFT3DFilter(Plane=0,Sigma=2.0)     # Med   Luma
V3 = FFT3DFilter(Plane=0,Sigma=4.0)     # High  Luma
V4 = FFT3DFilter(Plane=3,Sigma=1.6)     # Light Chroma
V5 = FFT3DFilter(Plane=3,Sigma=2.0)     # Med   Chroma
V6 = FFT3DFilter(Plane=3,Sigma=4.0)     # High  Chroma
V7 = FFT3DFilter(Plane=4,Sigma=1.6)     # Light Luma+Chroma
V8 = FFT3DFilter(Plane=4,Sigma=2.0)     # Med   Luma+Chroma
V9 = FFT3DFilter(Plane=4,Sigma=4.0)     # High  Luma+Chroma
V10= FlipHorizontal()                   # Flip-H
V11= FlipVertical()                     # Flip-V
V12= Invert()                           # Invert

NickNames ="""  # Psuedonyms for clips (clip index number)
    L0   = 1    # Light Luma
    L1   = 2    # Med   Luma
    L2   = 3    # High  Luma
    C0   = 4    # Light Chroma
    C1   = 5    # Med   Chroma
    C2   = 6    # High  Chroma
    LC0  = 7    # Light Luma + Chroma
    LC1  = 8    # Med   Luma + Chroma
    LC2  = 9    # High  Luma + Chroma
    FH   = 10   # Flip-H
    FV   = 11   # Flip-V
    INV  = 12   # Invert
"""

SCMD="""          # Clip editing commands in string, can also use commands in file
    C0  0,99      # Light Chroma frames @ 0 -> 99
    L0  100,-200  # Light Luma frames @ 100, 200 frames ie frames 100->299
    INV 300,399   # Invert 300->399
    L0  400,499   # Light Luma frames 400->499
    FH  500,599   # Flip-H 500->599
    LC2 600,699   # High Luma + Chroma
    C1  800       # Med Chroma, Single frame
    1   900,999   # Light Luma, We used the clip number instead of a NickName
    FV  1000,1099 # Flip-V
    LC1 2000,0    # Med   Luma + Chroma, 2000 -> lastframe
"""

SHOW=True

ClipClop(ORG,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,scmd=SCMD,nickname=NickNames,show=SHOW)

How to do it:

You define different versions of the original clip (V1 - V12) using your desired filters.
You can assign nicknames to those versions.
You define the segments using the scmd parameter of the filter. Here you can define which frame ranges of the original clip should be replaced by which nicknamed versions.

You definitely need AVSLib (the extension library for AviSynth — very old but very stable library) with very nice documentation, as you may see by clicking my link.
It has many-many useful features — in your case arrays of clips and functions for manipulating them, of course.
(Downloaded .zip file / .exe installer includes the same HTML documentation in an off-line form.)

Now, after some period of time, there are versions of AviSynth+ 3.6+, which support arrays.
So you may still use the script from your answer, although with some fixes, mostly in your syntax (you used C/C++ syntax ;-)):
original = Last
segments = [ \
    [ 0,  100, "high"], \
    [101, 200, "low" ]  \
]
clip = original.Trim(0, -1)             # a "base" 1-frame clip - see note 1
for (i = 0, segments.ArraySize-1, 1)    # syntax different from C/C++ - see notes 2, 3
{
    clip = clip + original.Trim(segments[i,0], segments[i,1]).RemoveNoise(segments[i,2])
}
clip = clip.Trim(1, 0)                  # remove a “base” 1-frame clip

Notes:

Instead of your BlankClip()
(which is a pitch-black 10 seconds RGB32 clip, 640×480, 24 fps, 16 bit 44100 Hz mono)
I "borrowed" the first frame of your original clip as a "base" clip:
clip = original.Trim(0, -1)

(0-frame clips are not allowed.)

Syntax for for block is different from C/C++:

commas (,) instead of semicolons (;),
the 2nd “parameter” is not a condition, but simply the upper limit,
the 3nd “parameter” is not a repeatedly computed expression, but simply the step.
(It may be omitted – the default step is 1).

The correct name of the function is not Size(), but ArraySize():
segments.ArraySize               # or segments.ArraySize()

There is no += assignment operator in AviSynth, so I changed your
clip += original.Trim(...)...

to
clip = clip + original.Trim(...)...

Instead of using indexes in the form segments[i][k] (which is OK), I used a shorter form segments[i,k].


text:
How to combine so many ffmpeg filters in 1?
I don't even know if it's possible, but if anybody could help me would be really great! :)
So first of all I resize my video with this command:
CODE №1
ffmpeg -i input.mp4 -c:v libx264 -crf 20 -crf 16 -vf scale=750:1334 output.avi

Then I add Gif overlay with chroma key to it like that:
CODE №2
ffmpeg -i input.avi -ignore_loop 0 -i watermark.gif -filter_complex "[1:v]colorkey=0x54FF5F:0.1:0.2[ckout];[0:v][ckout]overlay=x=705:y=25:shortest=1[out]" -map "[out]" output.avi

And then 2 more overlays:
CODE №3
ffmpeg -i input.avi -i arrow.png -i Dots.png -filter_complex "overlay=x=310:y=1230,overlay=x=705:y=25" output.avi

And for the last part, I concatenate vid that I've made with another one like this:
CODE №4
ffmpeg -i "concat:vid1.avi|input.avi" -c copy output.avi

Would be really great if anybody could help me to show few examples on how to merge all those scripts in 1 :) Or at least №3 and №3. Thank you in advance!

Use
ffmpeg -i input.mp4 -ignore_loop 0 -i watermark.gif -i arrow.png -i Dots.png -filter_complex "[0]scale=750:1334,setsar=1[v];[1]colorkey=0x54FF5F:0.1:0.2[ckout];[v][ckout]overlay=x=705:y=25:shortest=1[gif];[gif][2]overlay=x=310:y=1230[arw];[arw][3]overlay=x=705:y=25" -c:v libx264 -crf 20 -crf 16 output.avi

You should do the concat separately.

Thank you! Everything works fine :) Hope it will also help somebody else! :)

@ArtemDerzky, why “Thank you!”, but not voting up and accept this helpful answer?


text:
FFmpeg for m2t and Sony Bravia - not working
-f mp4 -c:v libx264 -preset veryslow -tune grain -profile:v high422 -flags +ildct+ilme

I am preparing video to be streamed (DLNA) from my NAS to an older Sony Bravia. I have successfully created playable m2t files (1080i) with VideoStudio (AVC, high@L4, Cabac, h264, vbr max 20 Mbps, 25 fps, interlaced). Interlaced is important because it seems the TV cannot handle 1080p from NAS or USB.
I have some old family video in prores/mov that VideoStudio does not accept as input, so I am trying to convert that to something acceptable to the TV using FFmpeg.

I haven't found a way to create m2t files with FFmpeg.
The TV is supposedly capable of handling MP4, but regardless of the settings tried — and I have tried dozens that all plays well on VLC (including BD compatible, PSP profiles and other) the TV just says 'not playable'

Anyone has ideas for any of the two routes?
Searching the internet I have learned that the Sony Bravia is known for being very picky, but I am sure someone has found the key...? (other than those at pavtube, who claims to have a commercial tool, that does the trick)
FFprobe of working m2t file:
Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 384 kb/s

Properties of working m2t by MediaTab:
===================== General =====================
Id                          : 0 (0x0)
Complete name               : D:\ThisWorks.m2t
Format                      : BDAV
Format info                 : Blu-ray Video
File size                   : 2.21 GB
Duration (ms)               : 21mn 10s
Overall bit rate mode       : Variable
Overall bit rate            : 14.9 Mbps
Maximum Overall bit rate    : 25.5 Mbps

===================== Video =====================
Id                          : 4113 (0x1011)
Menu ID                     : 1 (0x1)
Format                      : AVC
Format info                 : Advanced Video Codec
Formatprofile               : High@L4
Formatsettings, CABAC       : Yes
Formatsettings, ReFrames    : 2 frames
Formatsettings, GOP         : N=1
Codec Id                    : 27
Duration (ms)               : 21mn 10s
Bit rate mode               : Variable
Bit rate                    : 13.9 Mbps
Maximum bit rate            : 20.0 Mbps
Width                       : 1 920 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 16:9
Frame rate                  : 25.000 fps
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Interlaced
Scan type, store method     : Separated fields
Scan order                  : Top Field First
Bits/(Pixel*Frame)          : 0.269
Stream size                 : 2.06 GB (93%)

===================== Audio =====================
Id                          : 4352 (0x1100)
Menu ID                     : 1 (0x1)
Format                      : AC-3
Format info                 : Audio Coding 3
Mode extension              : CM (complete main)
Formatsettings, Endianness  : Big
Codec Id                    : 129
Duration (ms)               : 21mn 10s
Bit rate mode               : Constant
Bit rate                    : 384 Kbps
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 48.0 KHz
Frame rate                  : 31.250 fps (1536 spf)
Compression mode            : Lossy
Stream size                 : 58.2 MB (3%)

Share the log of ffmpeg -i file.m2t from one of the working VideoStudio files.

Thanks! Would this be what you are looking for?Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 384 kb/s

Additional info re working m2t file added to original post following suggestion from Gyan. Thanks.

Try
ffmpeg -i in -vf format=yuv420p,setsar=1 -g 25 -c:v libx264 -tune grain -profile:v high -refs 2 -x264opts bluray-compat=1:fake-interlaced=1:nalhrd=vbr:aud=1 -maxrate 20M -bufsize 20M -c:a ac3 -ac 2 out.ts

FFmpeg can't replicate Scan type, store method     : Separated fields but it may not matter.

Initially had to add a hyphen to x264opts nalhrd to test the setting :). Unfortunately it did not work. Generated file still "not playable". Noticed the output was progressive, so removed "fake". Unfortunately still not playable. The generated output has a tbr of 25 where the working has 50 - don't know if that's the problem.

`
order:
Working m2t
Gyan's proposal
...and without 'fake-'
Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),      yuv420p(top first),   1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:0[0x100 ]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:0[0x100]:  Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first),   1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc

`

Output is meant to be progressive but flagged as interlaced, hence the fake

Thx, but regardless of the output being fake-interleced or interlaced the Bravia refuses to play it :(   Any chance of making the output show a tbr of 50?

Add -r 50 -vsync vfr

Thx, but with that tbr remained unchanged, while fps increased to 50 and tbc to 100.

Share a small sample of your input.

Sure - is there a way to do that?

Eureka!
After many late nights and a lot of searching I managed to create a ffmpeg setup that creates an interlaced 1080i which my old (2009) Sony Bravia can stream from my NAS. This is the command line:
ffmpeg -y -i in.mov -c:v libx264 -pix_fmt yuv420p -level 4.0 -refs 1 ^
-x264opts b-pyramid=0:bluray-compat=1:interlaced=1:nal-hrd=vbr:aud=1 -maxrate 20M -bufsize 30M ^
-c:a ac3 -b:a 384k -f mpegts out.m2ts

I think one of the critical elements was setting the right level. The TV can handle -refs 1 and 2.
I cannot say that I understand the full depth of all settings and options, and any improvement suggestions are more than welcome!
The m2ts generated by ffmpeg has a tbr of 25:
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s

...while the original "working m2t file" had a tbr of 50. Don't know what it means, and at least it doesn't seem to be making a difference
The input is a 1080i dnxhd from Davinci Resolve (unfortunately DR has very few options for delivering interlaced output).


text:
Time lapse video with motion blur
Based on some of my videos I would like to make time-lapse videos with motion blur. My inspiration is this YouTube video:
Time-lapse with motion blur from video with Avidemux, AviSynth and VirtualDub   (starting at 6:42)
In the video the man uses VirtualDub with
AviSource("path")
Merge(selectEven(), SelectOdd())
Merge(selectEven(), SelectOdd())
Merge(selectEven(), SelectOdd())
Merge(selectEven(), SelectOdd())
AssumeFPS(30)

My source video has 60fps. Based on the tips given here I tried:
ffmpeg -i IN.MOV \
  -vf "tblend=average,framestep=2,tblend=average,framestep=2,setpts=0.25*PTS" \
  -r 60 -an OUT.MOV

Unfortunately my results are not similar, not so good as in the video. Difficult to say where the different is: the time-lapse effect is missing a bit, the motion blur is “different”? I am sorry, I cannot explain.
Maybe some of you have a tip how to switch die VirtualDub approach to FFmpeg regardless of my poor explanation?
Thanks in advance!
astefan

Can you share a sample of your source?

I think there is something missing. The guy here in this video is joining files in this program amd programing in this... he cant remember how he got the "Right" codec... Smells fishy. You need to get some good tools ro get good looking finished product. At the very least find an old version of adobe pr even the Free version of AVID...

I have no idea how your video looks, and why it looks different. And I have no idea on what settings you can put to your script. Sorry about that.
What I want to mention, (which is a bit long for just a comment) is that the amount of blur you see on the video greatly depends on how many frames you are compressing on one "time-lapsed" frame.
Take a look at this closeup of the video you posted. You can clearly see that the motion blur is added on the top of a lot of frames merged.

So, there is a chance that the other video has a different number of frames, or was shot at a different framerate, therefore when compressed, they have more frames to work with.


text:
FFmpeg Media Source Extension Examples and Adaptive VOD and Live Streaming
I have a quick questions. Has anybody examples or links for the use of FFmpeg with the Media Source Extension for pure JavaScript adaptive VOD-, or Live-Streaming? I mean really pure not HLS or DASH.
I prefer the chunkless, so say inline-container-segmenting:). So that i have a full files like so:

video_1080p_5000k.webm
video_720p_5000k.webm
video_480p_5000k.webm
audio_128k.opus
audio_256k.opus
and so on ...

What I search are JavaScript snippets and FFmpeg examples for a pure mse-js-adaptive-vod-player;).
Thx
Edit: A deeper explain why i not use DASH or HLS? I try to understand the deeper functions that JavaScript chunk the Videos on the fly, to prevent and memory low error and make a very simple and basic adaptive streaming.
I can load small Videos and Music files into a blob/string. Cool thing but when I try to use the chunking functions I have many problems with some things. That is why I search compact FFmpeg encoder params and JavaScript examples preferably links to sites with that preferably for all free codecs that I can use.

Chunkless and Adaptive is a contradiction. You can concatenate chunks, and request with a byte range however. Both HLS and DASH support that mode.

Hello, okay my question ist then how can i made video files with concatenate chunks with ffmpeg and how can i use this with javascript/mse/video-tag or knows anybody a site with examples. But i mean a pure JavaScript/MSE-Solution without HLS or DASH. Why HLS is not free and Dash is the answer but i specially want to use MSE without ready standards. I know No Dash without MSE and when MSE why not Dash;), but i'm intrested in the pure MSE-Technology with an ffmpeg/purejavascript solution:). Pure Adaptive Streaming:).

What you are saying doesn't make much sense. first of all HLS is not "free" in what sense? if your talking about mpeg2 patents, they have all expired. It is no less free that DASH. "pure" MSE/JS is just fmp4. the same fmp4 used by DASH, and optionally by HLS. DASH just adds an XML manifest file, and HLS an m3u8 manifest file.

Hello, thx for the infos but one objection to fMP4, when i us ogg/webm as Container it is no fMP4, HLS is the one that is not codec agnostic and Dash is, i know. This is why i have asked this Question. I search ffmpeg params which i can encoded every av-codec to use in dash with the right codec params and why i search examples or good links to sites that explain pure MSE/JS? One small thing ist the Overhead against dash-xml and javascript to use it (dash.js is very big), another thing is doing by learning and understandig mse:). But you are right in deep the answer on my questions cbe use dash

DASH is codec agnostic in theory, but in reality browsers only support AVC and VP9 and a very few HEVC. HLS supports AVC and HEVC. So preactilly, the only difference is VP9.

Just because you use “DASH like”segments (which are also HLS like, and CMAF like) doesn’t mean you need dash.js. You can make your own manifest and js.

Hello, yes cool but how i make my own manifest and the javascript? Do you know any goog sites or a code-example for the mse? It wil be great.

tell you how to make your own manifest? Just put a list of video segments into a text file. Just look and an m3u8 to see an example. Or just make the segment names predictable and don’t use a manifest. As for code W3c or MDN good.

This are all not the problems, the problems are that i need code examples or links. Dash and Hls are not the problem, too. The problem is that i can not generate webm-video-files that the mse accepted. Some videos from the web functioned or are not functioned and this is an encoder-problem. And i search help for encoding. I cannot wrong decoded webm put in an manifest, w the core of mse says. oh you are coder but you don't has aknowledgment from encoding an video fme. When i can encode correctly one-file-webm or an multiplebitratevidandaudoi, but i want to chunk with js to mse and don't use pr


text:
Read error while copying VOB files from DVD drive to hard disk
I have old DVDs containing personal (family) recordings.
I want to copy the DVD files to PC, add menu and titles to these files using standard Video editor and share/stream video files.
The windows copy function or video programs hang after copying about 20% of files on DVD. Apparently, there are scratches on DVD that causes an error and the program keeps re-trying for a long time.
Are there any commands / Windows utilities / programs that will ignore errors and continue to copy/display as much as possible?
Thanks and regards.

Although the content you're trying to get off the video, this is not really a video production question. You might be better off asking on Super User, you're more likely to get people with expertise on dealing with the problem there.

Have you tried using a conversion program like handbrake or MakeMKV this will read the disc and produce a format you can use in an NLE (to a degree of course)

Thanks, @stib. Should I delete the question from here?

See the methods at https://superuser.com/q/508679/114058

Thanks, @Gyan. The link provides good details and options to resolves the issue

cleaning the disks with some soft microfiber clothes may sometimes work. Try DVD decryptor but extract to a folder instead of extracting to iso (this is a feature in the software). This should get you as much files as possible.

I could tell you in Linux (ddrescue), but for Windows, I'd start out looking at apps that get data from broken disk drives. Something that will skip over sectors it can't read.


text:
Comparing FFprobe to Wave Agent Beta
Wav Agent outputs the following when I drag the same file in, so the data has to be in the file somewhere, and I just don't know how to look for it:

WavAgent: StartTC: 13:09:21:18

Now, FFmpeg with the following arguments creates the following :
ffprobe -i "_Audio Test_CRO_01.wav" -print_format json -show_streams -show_format

ffprobe version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
{
Input #0, wav, from '_Audio Test_CRO_01.wav':
  Metadata:
    encoded_by      : Pro Tools
    originator_reference: JTFyPBDM2GpaaaGk
    date            : 2018-02-01
    creation_time   : 13:28:24
    time_reference  : 2273356800
  Duration: 00:00:48.22, bitrate: 1197 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    "streams": [
        {
            "index": 0,
            "codec_name": "pcm_s24le",
            "codec_long_name": "PCM signed 24-bit little-endian",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "[1][0][0][0]",
            "codec_tag": "0x0001",
            "sample_fmt": "s32",
            "sample_rate": "48000",
            "channels": 1,
            "bits_per_sample": 24,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "duration_ts": 2314530,
            "duration": "48.219375",
            "bit_rate": "1152000",
            "bits_per_raw_sample": "24",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        }
    ],
    "format": {
        "filename": "_Audio Test_CRO_01.wav",
        "nb_streams": 1,
        "nb_programs": 0,
        "format_name": "wav",
        "format_long_name": "WAV / WAVE (Waveform Audio)",
        "duration": "48.219375",
        "size": "7215254",
        "bit_rate": "1197071",
        "probe_score": 99,
        "tags": {
            "encoded_by": "Pro Tools",
            "originator_reference": "JTFyPBDM2GpaaaGk",
            "date": "2018-02-01",
            "creation_time": "13:28:24",
            "time_reference": "2273356800"
        }
    }
}

Is time_reference a clue? I have calculated that from Jan 1 1970, but that's not accurate. I'd like to know how I can get the start frame of timecode from this WAV file.

Ok I think I figured it out "time_reference": "2273356800" isn't epoch time, it's samples since midnight. So that worked out at 48khz to 13:09:21:18
time_reference is a really horrible way of labeling that :O
Also this is assuming 30 fps, so I'll have to look and see where I can grab that from. Maybe there's more metadata to dig through.... ugh...


text:
Audiovisualiser not visible
The code below runs a perfect red audiovisualizer when run on a “black” colored background. But when used with any other colored jpg image the visualizer just doesn't show up. What's missing?
ffmpeg -y -i music.mp3 -loop 1 -i black.jpg -filter_complex \
   "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p,format=yuv420p[v];[1:v][v]overlay=0:200[outv]" \
   -map "[outv]" -pix_fmt yuv420p -map 0:a -c:v libx264 -c:a copy -shortest output_bg.mp4

ffmpeg -i music.mp3 -loop 1 -i image.jpg -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p[v];[1:v][v]overlay=(W-w)/2:(H-h)/2:format=auto,format=yuv420p[outv]" -map "[outv]" -map 0:a -c:v libx264 -c:a copy -shortest -movflags +faststart output.mp4

Remove the format filter after showwaves.
Use format=auto in the overlay filter.
Do all of the filtering within the filtergraph, so remove -pix_fmt and replace it with the format filter.

If you want image.jpg to fit within a specific size such as 1280x720:
ffmpeg -i music.mp3 -loop 1 -i image.jpg -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p[fg];[1:v]scale=1280:720:force_original_aspect_ratio=increase,crop=1280:720,setsar=1[bg];[bg][fg]overlay=(W-w)/2:(H-h)/2:format=auto,format=yuv420p[outv]" -map "[outv]" -map 0:a -c:v libx264 -c:a copy -shortest -movflags +faststart output.mp4

tested your script but the issue still persists.On closer inspection ,the visualizer is there ,it is just getting pushed to the bottom of the page(Some spikes in the frequency could be seen at the page bottom ).How could the visualizer  be bought to the center?.

@starzar Updated answer. It will now center the overlay. The second example will resize images to fit within 1280x720 without needing to pre-process with ImageMagick.

thanks for script .There is a padding (default black) under the visualiser (in the original script ),how could one change the color of this padding ?I tried adding option  "overlay :colors= Blue" but received an error= "Option 'colors' not found"

@starzar Show a screenshot so I can see what you are describing.

Scale does matter while creating ffmpeg videos with images.
In the above case, some background images were really small (eg 512 x 210 etc).
On doing a batch size conversion  of all the background images (using Imagemagick)to 1280x720 (same as render size) the above code works fine


text:
Automatic video stop on SDCX class 10 card
I' ve been recording clips with a Canon 80D and a Lexxar Profesional x633 SDXC card 64 GB class 10, 95 MB/s max read speed. Video format was MOV at 1080p, 25 fps.
I never had a problem for almost a year with 80D and two years using this Lexxar SD card. But yesterday I just took my cam, (which was off and cool) tried to film, immediately saw the low recording speed bar adviser, and video stopped automatically. Same happened once and again.
Is my card is losing performance due to intense use? Or might the issue be related to used storage (around 75% of SD total was filled, mostly with cr2 raw photo files and JPEGs, at moment of filming).
I don't know if it makes any difference, but battery charge was at its half. Video stopped just some seconds after start, so file size issues are out of debate.

You could try a new card. Could be the issue. My guess it's the camera and the heatsink on the sensor.
Try a different card first to see if that solves it. Card's can go bad. But with the Canon line (and all DSLR cameras really) do have issues with overheating- especially as they age.
If a new card doesnt fix it, you can try to service the camera, perhaps it just needs a good blow out/dusting of the heatsink.
Canon, Sony, Nikon, most models have had some sort of issue at higher resolution video/frame rates with heat issues, and as the cameras age the cameras don't behave as well as when they were new.

I tried an old heavily used, and empty 32GB Class 10 Sony SD Card, and had no troubles. So, it might it be a chance that problems are originated on low card's free space?

No, low card space shouldn't affect it. Get a new card.

I formatted it, tried again, filming at highest iso noise possible (i guess that will lead to heavier file size) and had no trouble.


text:
ffmpeg thread_queue_size warning: What does this mean?
*Edit: changing the render to -preset veryfast will no longer display the warning message. I also noticed that the video itself for the versions where the warning displayed had the last few minutes cutoff on both the audio and the video. I'm quite lost as to why this is.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thread message queue blocking; consider raising the thread_queue_size option
  (current value: 8)

I'm trying to find information on this warning message and what it means. The information I found online is indicating that not increasing my thread_queue_size can create artifacts and sync issues..? However the postings are many years old, and I'm unsure if they are true or still apply etc. They also apply towards screencasting specifically, which I am not knowingly doing.
The command I use that prompts this message is as follows:
ffmpeg -framerate 500/21 -start_number 1518 -i %d.png -i audio.ogg -c:a copy -vf "scale=3840:-1" -c:v libx265 -preset fast -crf 19 -pix_fmt yuv422p10le output.ts

So basically I'm turning thousands upon thousands of 1080p png into a 10 bit 4k h.265 .ts video. Whether I use a preset or not, or do audio separately, the warning still displays.
While I'm doing my command ffmpeg uses 90%-100% of my cpu and 80%-90% of my ram. I want to know if my render is suffering in some way by ignoring the warning message. The stuff I read online was concerning. For the sake of argument I'll link the info I found, just note the language is nsfw.
I will add that my content is just over 30 minutes long. Also I noticed that after rendering it out and lining it up with the original content in my Video editor, that there is a slight audio echo. Meaning the audio does not sync 100% correctly as it should. It's irrelevant for my video in the grand scheme, but I'd like to know if its related in any way as the linked info suggests. I'd also like to know what I can/should do to address the warning, if anything.
s speed = 0.117x
using preset fast
I came across information in my search that said speed needs to be 1.0 or faster...? I don't know if that was related to a specific situation in the post read, or if there's something I never knew about happening here. Almost all my renders occur under 1.0x speed unless I'm rewrapping/copying streams.

The "Thread message queue blocking" message is an indicator that your computer cannot keep up with encoding in real-time. It's recommending the "thread_queue_size" parameter because it thinks you want to process data in real-time (based on your command). By setting "thread_queue_size" to a higher value, you are increasing the buffer size for packets which are waiting to be encoded. If you exceed the packet buffer size (i.e., buffer gets full), ffmpeg will start to drop packets to keep up in real-time; increasing the buffer will hopefully allow your computer to process the packets before it has to drop them... But that won't work if you eventually run out of memory or exceed the new buffer size anyway since you are processing in less than real-time (less than 1.0x speed).
With your command, the reason ffmpeg is trying to process in realtime is because you are using -framerate 500/21 as an input instead of your desired output fps. So basically, ffmpeg is trying to encode 500/21 worth of images per second, which your computer can't keep up with when using the fast preset. Using -preset veryfast lowers the output quality, and your computer can apparently keep up with that, but I doubt that's what you want...
Since you really don't need to process in real-time (you're using a file-based source and not something live), you should use -r for the output instead of using framerate on the input.
ffmpeg -start_number 1518 -i %d.png -i audio.ogg -c:a copy -vf "scale=3840:-1" -c:v libx265 -preset fast -crf 19 -pix_fmt yuv422p10le -r 500/21  output.ts

So basically, ffmpeg is trying to encode 500/21 worth of images per second --> no, ffmpeg offers no contract on encoding speed; it will attempt to encode as fast as possible, but the input rate has nothing to do with it.

@Sparkyish Thanks for the answer, I need clarification on a few things though: "Using -preset veryfast lowers the output quality", when you say output quality I don't understand. The speed of the encode, when there is no error message, has nothing to do with the video/audio quality generated right? It should only influence filesize shouldn't it?

@Gyan Sorry I'm not fully understanding yet. Based on your comment are you disputing the entirety of Sparkyish's claim? Or just the way one section was worded? If ffmpeg offers no 'contract' on encoding speed and the input rate is irrelevant, doesn't that means -framerate as an input isn't the problem? If so, what is the problem in that case? Again, it's me not fully understanding what was being said I request a bit more clarification if possible.

All -framerate does is set timestamps for the input frames. And has no other effect. When multiple -i inputs are provided, FFmpeg reads each input in a separate thread and buffers packets till requested from further down the pipeline. When the input packets aren't dequeued fast enough and the queue is full, ffmpeg can't deposit new packets from the input into the queue so it has to wait and the warning is printed. Speeding up video encoding (usually the most time-consuming part of the pipeline) speeds up packet consumption rate.

Sparkyish's answer doesn't appear to be correct, or at least not anymore. Not specifying the input frame rate still causes that warning to be thrown: > ffmpeg -i %06d.png -i eng1.flac -i .\eng2.flac -i sub.srt -map 0 -map 1 -map 2 -c:v libx265 -c:a copy -c:s copy -crf 21 -profile:v main -preset slow -pix_fmt yuv420p -vf "crop=2832:1712:504:206" -metadata:s:1 language=eng -metadata:s:2 language=eng -metadata:s:s language=eng -r 30000/1001 out.mkv
............
[image2 @ 00000227610b5a40] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
f

I first came across this message today when trying to pipe curl output (inside a while loop) as input to ffmpeg and then remux to mkv. The process was much more time-consuming than downloading all the files locally first and then concating and remuxing them with ffmpeg afterwards. I believe this message indicates how many bytes of the input file ffmpeg is trying to read at a time. In my case the message was

[mpegts @ 0x55c7f9fe7a00] Thread message queue blocking; consider raising the thread_queue_size option (current value: 1)

which would explain the delay in the process. After putting -thread_queue_size 4096 before the input, the message disappeared and the process was as fast as it should.


text:
Music Policies on Facebook: Using Copyright But Licensed Music
Is there any way to figure out which music is allowed on Facebook?
A year or two ago there was an announcement saying that you are now allowed to upload videos with copyrighted music on Facebook since they signed a deal with several companies.
However, there is no “YouTube Music Policies”-equivalent page on Facebook. Most sites mention that you can now use copyrighted music, but it doesn't explain whether you can use any music (which I doubt) you like. There's also a mention that Facebook will notify you once you uploaded a video that you have used a copyrighted music — by then it will be too late.
Oftentimes I edit my video around the music and I don't want to spend all my time on a video just to receive a copyright strike.
I Googled this multiple time to no avail.

I don't know whats allowed on Facebook but, to keep it safe use songs from Youtube audio library that are not copy right protected. At some songs you need to add the author and by others no. You can also use filters. Now i agree most of the songs wont fit your needs, but i have to say there are some great songs in there!

I do know the existence of free or even paid libraries out there. However, most of the songs are too simple to me to the extent that they sound cheap. Non-royalty free music generally sound better and more layered. There are some exceptions with new artists but it's difficult to cut through the noise. That's why I'm looking to use copyrighted songs if I can - especially if Facebook has already licensed it. It's just a shame that I could not seem to find a list of licensed music that I can use.

The answer should be in Facebook's terms of service, if they don't say anything, it's allowed. If it's forbidden this can only be limited to unlicensed work, everything else would be an illegal attack to artistic freedom. If Facebook wrongly awards you a copyright strike and your business suffers damage you should go to court.
Facebook's support is too dumb to understand even the simplest problems, you can't expect to solve such a problem by discussing.
I think Facebook is only good as one of your many marketing channels, you should never rely on Facebook in any way, and it should never be the primary location where you publish anything.