Live data from Hacker News

FFmpeg 4.4

ffmpeg.org

61–70 of 135 posts

Re: FFmpeg 4.4

#61

I think everyone was a txt file on their computer filled with FFmpeg commands. Care to share yours?

function grab-screen-lossless { ffmpeg -an -f x11grab -video_size 1920x1080 -framerate 60 -i :0.0 -c:v h264_nvenc -preset llhq -tune zerolatency -crf 0 -qp 0 "${1}" } function grab-screen { ffmpeg -an -f x11grab -video_size 1920x1080 -framerate 60 -i :0.0 -c:v h264_nvenc -preset llhq -tune zerolatency -qp 10 "${1}" } function vid_compress { ffmpeg -i "${1}" -codec:v libx264 -preset:v fast -pix_fmt yuv420p "${2}" }

Wow never realized ffmpeg could be used like this!

Unfortunately both these commands create a somewhat jerky video on my rx 550 on linux mint and drives CPU crazy (ryzen 3500).

I guess it's my underpowered graphics card, but any way to tweak your grab-screen-lossless for a smoother capture?

Re: FFmpeg 4.4

#62

> Rayman 2 APM muxer > LEGO Racers ALP (.tun & .pcm) muxer Maybe that just shows off my ignorance, but reading the changelogs (current and past), I never realized that ffmpeg contains so many "niche" features.

What you can actually do with these extensions?

Re: FFmpeg 4.4

#63

Shameless plug: While working with ffmpeg over the years, i always thought that FFmpeg should have a simple to use UI. I have recently started working on a desktop(electron) tool that wraps ffmpeg script in easy to use interface Here is a video showing the tool in action https://www.youtube.com/watch?v=qqqiK6YnJu8 https://auvinox.com

are you planning to show the ffmpeg command that will be used in the background, I would like to try it out.

Re: FFmpeg 4.4

#64
post #3

I am excited for AV1 stuff, included in the highlights: SVT-AV1 encoding and AV1 VAAPI decoding.

For a typical 1080p "linux iso" what filesize difference will there be between x265 and av1?

For some animated videos, the difference was quite impressive to me.

    AV1    100 MiB
    H.265  500 MiB
    H.264  1.5 GiB
At this point, the audio codecs and track count start making a difference, so this isn't really a fair comparison. And BTW, in terms of video quality in the files above, AV1 > H.265 > H.264.

In non-animated content, the difference is less impressive, but comes at about ~20% in favor of AV1 vs HEVC, in my subjective-and-not-rigorously-benchmarked opinion. But "video quality" is subjective anyway.

Re: FFmpeg 4.4

#65
post #55

Earlier quoted context omitted.

But what are the odds that obscure formats like this will be implemented (and maintained) without security holes? I vaguely remember an exploit where the GNOME file viewer would automatically preview samples of any audio file that (I think) gstreamer could recognise, and one of those formats was something like a NES audio format, whose implementation had some buffer overflows in it. Are there similar concerns with ff…

> But what are the odds that obscure formats like this will be implemented (and maintained) without security holes? Extremely high? I wrote a stand-alone commercial DSP app which seems to still be sold ten years later. There might be security issues, there probably are since it hasn't been recompiled in years as far as I know, but I'm certain they aren't in the DSP parts. DSP code involves large blocks of numbers whi…

The problem is that when you use ffmpeg, you generally delegate the task of figuring out "what the hell is this data" to it - you don't want to figure out yourself if something is MP3, MP3 in an AVI container, VP9 in MKV, ...

So when ffmpeg adds obscure formats that no one ever uses and are mostly toy implementations, the risk is always that someone at the top (say, your Electron app) feeds in user-supplied data, the 10 layers in between pass it along, until ffmpeg at the bottom goes "oh I know this one, it's a Digital Pictures SGA game"!

Now Chromium wisely disables most of this trap code in its copy of ffmpeg from even being compiled in the first place, but that's probably not the case for the ffmpeg copy on your operating system that you might use for some server-side processing task.

Re: FFmpeg 4.4

#66

I think everyone was a txt file on their computer filled with FFmpeg commands. Care to share yours?

I have one glorious:

    ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input.mp4 -vf "hwdownload,format=nv12,scale=(iw*sar)*max(1280/(iw*sar)\,720/ih):ih*max(1280/(iw*sar)\,720/ih), crop=1280:720, subtitles=input.srt:force_style='FontName='TiresiasScreenfont',Fontsize=32,Outline=2,MarginL=50,MarginV=30,Alignment=1',minterpolate=fps=60:mi_mode=blend" -c:v h264_nvenc -preset slow -b:v 8M -f matroska - | vlc -
What it does: Allows streaming content to Chrome Cast with my idea of subtitles through VLC.

For me I want subtitles with Tiresias screen font used in Finnish YLE 90s. (Aligned always to left second row, so that starting point is always the same. Center alignment is bad because you need to always re-adjust eyes to the position where the subtitles start, left alignment makes the first character always in same place.)

* `hwaccel cuvid -c:v h264_cuvid` * makes the hardware accelerated decoding (h264 only)

* `-vf` * video filter

* `hwdownload,format=nv12` * downloads the hardware accelerated frame to memory for the video filter (required by cuvid)

* `scale=(iwsar)max(1280/(iwsar)\,720/ih):ihmax(1280/(iw*sar)\,720/ih), crop=1280:720` * crops the video to 1280x720, (exteremely high impact on performance!) Use crop and resize cuvid below for better performance.

* `subtitles=input.srt:force_style='FontName='TiresiasScreenfont',Fontsize=32,Outline=2,MarginL=50,MarginV=30,Alignment=1'` * subtitles

* `-c:v h264_nvenc -preset slow -b:v 8M` * hardware accelerated encoding 8000 kb/s for 720p/60 (for 1080p use `16M`)

* `-f matroska * | vlc -` * output as matroska, pipe to VLC

* `minterpolate=fps=60:mi_mode=blend` * output 60 fps interpolate blending (this can cause problems, avoid sometimes)

Crop and resize with cuvid example:

* `-hwaccel cuvid -crop 0x0x200x200` - faster way to crop top x bottom x left x right

* `-hwaccel cuvid -resize 1200x300` - resize (forces the size)

Seek example:

Seek to 30 minutes (60*30 = 1800)

   ffmpeg -ss 1800 ... vf "hwdownload,format=nv12,setpts=PTS+1800/TB,subtitles='...',setpts=PTS-STARTPTS"`

Re: FFmpeg 4.4

#67
post #63

Shameless plug: While working with ffmpeg over the years, i always thought that FFmpeg should have a simple to use UI. I have recently started working on a desktop(electron) tool that wraps ffmpeg script in easy to use interface Here is a video showing the tool in action https://www.youtube.com/watch?v=qqqiK6YnJu8 https://auvinox.com

are you planning to show the ffmpeg command that will be used in the background, I would like to try it out.

it should be simple enough to show the command used. great idea thanks!

Re: FFmpeg 4.4

#69

I think everyone was a txt file on their computer filled with FFmpeg commands. Care to share yours?

I wonder if ffmpeg should have a scripting language and/or repl

Re: FFmpeg 4.4

#70

I think everyone was a txt file on their computer filled with FFmpeg commands. Care to share yours?

All I have that I'm not seeing elsewhere in the replies is:

ffmpeg -r 1 -loop 1 -i 1.png -i 1.wav -c:v libvpx -c:a libvorbis -b:a 64k -shortest out.webm (clearly this is old)

-max_muxing_queue_size 2048 (magically fixes some errors and microscopically increases quality, a no-brainer on machines with more than token amounts of RAM)

Post reply on HN