Live data from Hacker News

FFmpeg 6.0

ffmpeg.org

191–200 of 210 posts

Re: FFmpeg 6.0

#191
post #130

I love ffmpeg, a single command of `ffmpeg -ss 01:15:42 -to 01:16:00 -i example.mp4 -c copy output.mp4` will let you create a video clip at a certain point in time from a larger video without decoding/encoding it. I wrote a blog post and made a demo video the other day going over using this feature at: https://nickjanetakis.com/blog/create-video-clips-with-ffmpe...

i understand that this is the fastest way to extract frames, but it is limited by key frame availability in the original file (i.e.) you can only start the output from a keyframe. in this case, it is important to be aware that the times you specify may not be extracted exactly. it will be off by a few frames based on keyframe availability. the only way to extract exact frames is to re-encode. :)

Fundamentally (ignoring ffmpeg incantations), I think there are four options:

1. re-encode the whole thing

2. re-encode just the first GOP

3. start a bit early or late

4. include the full first GOP but use an edit list to instruct the player to skip to the timestamp of interest

Re: FFmpeg 6.0

#192
post #22

If you want to know a bit more about what is important in this major release, you can watch my presentation about FFmpeg 6.0 at Fosdem: https://fosdem.org/2023/schedule/event/om_vlc/ (Video + Slides) It’s a bit less dry than the changelog, notably for the evolutions of the APIs. What’s also important is the changes about the release schedule that we’ve been pushing with the community. Major version every year at the…

> 200k LoC of handwritten ASM!

He's not the hero we deserve, but he's the hero we need.

I'm sure you get this a lot, but thank you so much for your sacrifice!

Re: FFmpeg 6.0

#194

Earlier quoted context omitted.

At a prior job we pinned to 4.2.3 because after that version an internal change massively impacted high frame rates. With a 1080p mp4 file on disk, and that disc being an ssd, version 4.2.3 delivers 700-800 frames per second, while all the versions after that 4.2.3 release - no other app or library changes - that same file may reach 300 fps. I spent some time trying to find the cause of that 50% cut in efficiency, bu…

You are referring to (re)encoding a file?

Just playback.

Re: FFmpeg 6.0

#195

Earlier quoted context omitted.

Fabrice is superhuman for sure, but in 20 years the urban legend will go like ... Fabrice Bellard once read all of TAOCP in 20 minutes before being absorbed into his own AI and is now ascended in the ethereal ethernet silently fixing bugs in your code. Blessed be the bits.

Blessed be His bits. Amen.

May the port open

Re: FFmpeg 6.0

#196
post #130

I love ffmpeg, a single command of `ffmpeg -ss 01:15:42 -to 01:16:00 -i example.mp4 -c copy output.mp4` will let you create a video clip at a certain point in time from a larger video without decoding/encoding it. I wrote a blog post and made a demo video the other day going over using this feature at: https://nickjanetakis.com/blog/create-video-clips-with-ffmpe...

i understand that this is the fastest way to extract frames, but it is limited by key frame availability in the original file (i.e.) you can only start the output from a keyframe. in this case, it is important to be aware that the times you specify may not be extracted exactly. it will be off by a few frames based on keyframe availability. the only way to extract exact frames is to re-encode. :)

This is true. Do you have a use case where being off by a few frames might be a deal breaker?

Personally I've created dozens of clips using this method and it always turns out ok. It gives you about ~1 second precision on where you want to make your cuts. After I create the clips I can play things back normally, complete with an ability to seek to specific points successfully.

Re: FFmpeg 6.0

#197
post #183

Do any of you know if this has Dolby AC-4 support? Ticket 8349 [1] has been open for years to add this, but it's not there yet. This would be very nice so we can watch ATSC 3.0 OTA broadcasts via FFmpeg-based things like Plex. (Currently if one uses something like a SiliconDust HDHomeRun, viewing an ATSC 3.0 stream requires using their app/player, which uses a SiliconDust cloud service to do the decoding. It'd be rea…

I was hoping for that too, but it doesn't look like it

After some more digging, I'm realizing the same. Fingers crossed soon.

Re: FFmpeg 6.0

#198
post #196

Earlier quoted context omitted.

i understand that this is the fastest way to extract frames, but it is limited by key frame availability in the original file (i.e.) you can only start the output from a keyframe. in this case, it is important to be aware that the times you specify may not be extracted exactly. it will be off by a few frames based on keyframe availability. the only way to extract exact frames is to re-encode. :)

This is true. Do you have a use case where being off by a few frames might be a deal breaker? Personally I've created dozens of clips using this method and it always turns out ok. It gives you about ~1 second precision on where you want to make your cuts. After I create the clips I can play things back normally, complete with an ability to seek to specific points successfully.

yeah it probably doesn't matter in practice. you may run into some audio sync issues.

but the ~1 second precision that you see is by accident where the source file happens to have a keyframe every 1 second. that may not be the case always. :)

Re: FFmpeg 6.0

#199

Earlier quoted context omitted.

i understand that this is the fastest way to extract frames, but it is limited by key frame availability in the original file (i.e.) you can only start the output from a keyframe. in this case, it is important to be aware that the times you specify may not be extracted exactly. it will be off by a few frames based on keyframe availability. the only way to extract exact frames is to re-encode. :)

Fundamentally (ignoring ffmpeg incantations), I think there are four options: 1. re-encode the whole thing 2. re-encode just the first GOP 3. start a bit early or late 4. include the full first GOP but use an edit list to instruct the player to skip to the timestamp of interest

yeah these are pretty much the options. i believe the ffmpeg command that OP suggested would do option 3.

Re: FFmpeg 6.0

#200
post #196

Earlier quoted context omitted.

i understand that this is the fastest way to extract frames, but it is limited by key frame availability in the original file (i.e.) you can only start the output from a keyframe. in this case, it is important to be aware that the times you specify may not be extracted exactly. it will be off by a few frames based on keyframe availability. the only way to extract exact frames is to re-encode. :)

This is true. Do you have a use case where being off by a few frames might be a deal breaker? Personally I've created dozens of clips using this method and it always turns out ok. It gives you about ~1 second precision on where you want to make your cuts. After I create the clips I can play things back normally, complete with an ability to seek to specific points successfully.

>> Do you have a use case where being off by a few frames might be a deal breaker?

Yes, in action recognition tasks (machine learning), e.g., if you have a large video with temporal annotations (start/end times where an action occurs) you may want to extract clips to sense-check the annotations. Being exact is important.

Post reply on HN