Coder Social home page Coder Social logo

Switch to H.265 codec about fvid HOT 9 CLOSED

alfredosequeida avatar alfredosequeida commented on August 21, 2024
Switch to H.265 codec

from fvid.

Comments (9)

Theelx avatar Theelx commented on August 21, 2024 1

Update: Just encoded one of my test images, 580KB, with libx265 and the resulting file.mp4 about 31MB, compared to 123MB with libx264rgb.

Update 2: Apparently I accidentally made it lossy, so I passed a lossless option, and now it's 63MB. Still better though, and it only takes 15 seconds to encode.

Update 3: WOW. Apparently, since libx265 isn't rgb, each pixel is a simple integer rather than a tuple of 3 integers, so we can massively simplify the decoding process. Decoding the pixels is now over 3x faster than it was in pure Python, and the speedups are probably almost as large in Cython.

from fvid.

Theelx avatar Theelx commented on August 21, 2024 1

Do you mind if I merge zfec error correction and a flag for using H265 into master? (I did the H265 flag yesterday)

from fvid.

Theelx avatar Theelx commented on August 21, 2024 1

Sounds good.

from fvid.

Theelx avatar Theelx commented on August 21, 2024

References:
https://www.videoconverterfactory.com/tips/h265vsh264.html
https://trac.ffmpeg.org/wiki/Encode/H.265
https://support.google.com/youtube/troubleshooter/2888402

from fvid.

AlfredoSequeida avatar AlfredoSequeida commented on August 21, 2024

Oh wow, this is cool! I'm not very experienced with video codecs, so I didn't even know there was a better option. I think this is a good idea. What happens if the program was to "try h265 first and default back to libx264rbg"? Does FFmpeg fail and quit by default when libx264rbg fails?

from fvid.

Theelx avatar Theelx commented on August 21, 2024

So yeah, ffmpeg would fail when it tries to decode a file with the wrong mime type. I'm not totally sure how to catch that fail, but I'm confident it could be done.

Edit: Fun fact: There's actually a newer, even better format called H.266, or VCC, but it was only standardized in July 2020, so not enough implementations yet for ffmpeg to use it.

from fvid.

AlfredoSequeida avatar AlfredoSequeida commented on August 21, 2024

Yesterday I was working on a project using a program called mediainfo to view file metadata on Linux. Looking up their project, it looks like it also supports mac and windows and we could use it to view video data like a codec and therefore make fvid support virtually any codec by reading that info prior to decoding. I'm willing to bet that ffprobe can do the same thing. If I get some time today I could look into that, but anyone else that is curious can try it too.

from fvid.

Theelx avatar Theelx commented on August 21, 2024

@AlfredoSequeida That's a possibility. I think it'd be better to just add an option for a user to be able to specify the codec they want that ffmpeg supports though.

from fvid.

AlfredoSequeida avatar AlfredoSequeida commented on August 21, 2024

@Theelgirl I'm definitely ok with the H265 flag and I think that zfec should be good too (good job on that by the way). My only concern about zfec is that with the current zip issue, which I haven't had time to look at, I haven't seen a successful decode form a compressed vid (like from YouTube). So we just have to remember to fix that before pushing out the next version to PyPI.

from fvid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.