• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions How to encode for direct play?

     
    • 0 Vote(s) - 0 Average

    How to encode for direct play?

    How to encode for direct play?
    raulo1985
    Offline

    Member

    Posts: 76
    Threads: 14
    Joined: 2024 Jul
    Reputation: 2
    Country:Chile
    #2
    10 hours ago (This post was last modified: 6 hours ago by raulo1985. Edited 10 times in total.)
    (2025-11-28, 12:01 AM)lmorgan Wrote: I want to encode my videos so that it will use direct play on most devices. However I am having mixed results no matter what I do. I encode the video before hand with ffmpeg and then add it to the server. 50% of the time the videos will not direct play on Chrome. Ideally I would like to it to work on Web/Android/Roku without transcoding. 

    Also, I would love to use av1, does it work on Roku? It says so in the docs, but I have heard otherwise.

    Basically I just need to know what encoding 'settings' to use to make sure that it usually direct plays. I have been beating my head against the walls with this for weeks now.

    The ffmpeg command I have been using is below for reference:

       ffmpeg \
           -hide_banner \
           -loglevel quiet \
           -y \
           -i "$input" \
           -map 0 \
           -c:v libx264 \
           -preset slow \
           -maxrate 8M \
           -bufsize 16M \
           -crf 18 \
           -tag:v avc1 \
           -c:a aac \
           -ac 2 \
           -b:a 192k \
           -profile:v baseline \
           -pix_fmt yuv420p \
           -level 3.1 \
           -c:s mov_text \
           -movflags +faststart \
           "${base}_new.mp4"


    Any help solving this issue would be greatly appreciated.

    Your issue happens only with Chrome? Or also with the other clients you mentioned? Are you having the same issue with JMP or other browsers?
    And anyway, what's the reason the server tells you why it's transcoding when it happens? A codec incompatibility? Resolution? Higher bitrate than the one set at server or client? It should tell you why it decided to transcode.

    Anyway, here's my to-go command line to transcode the movies that I feel could be problematic (mkv container, h264 10 bits, higher bitrate than my setup can handle, etc). If the file is h264 or hevc, mp4 container, with aac or ac3 as audio and "standard" encoding settings, with acceptable bitrate, I usually leave them as they are. And I also usually use only the most important commands, for example I don't set the level and let ffmpeg choose the best option.

    Most compatible files:

    Code:
    ffmpeg -i input.mkv -c:v libx264 -pix_fmt yuv420p -profile:v high -crf 21 -preset slow -c:a aac -b:a 320k -hide_banner output.mp4

    When I want 10 bit files (long encoding times, better quality and better compression than h264):

    Code:
    ffmpeg -i input.mkv -c:v libx265 -pix_fmt yuv420p10le -profile:v main10 -crf 23 -preset slow -c:a aac -b:a 320k -hide_banner output.mp4

    You have to check that the output file's bitrate and resolution is not higher than your allowed values in your settings, or it's going to get transcoded anyway.

    PS: you can add a -ac 2 command for downmixing to stereo when there's compatibility issues with multichannel audio.
    « Next Oldest | Next Newest »

    Users browsing this thread:


    Messages In This Thread
    How to encode for direct play? - by lmorgan - 2025-11-28, 12:01 AM
    RE: How to encode for direct play? - by raulo1985 - 10 hours ago

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode