Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th October 2020, 08:12   #1  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
ffmpeg command to pipe a mkv/mp4 file into x265 in realtime as a yuv

[for windows add .exe to ffmpeg and x265, ffmpeg.exe x265.exe]
(i do not have windows to test these, i replaced it with debian linux)


8bit input--\/
Code:
ffmpeg -i "input.file" -f yuv4mpegpipe - | x265 --y4m - -o "outputfile.265"


10bit input--\/
Code:
ffmpeg -i "input.file" -f yuv4mpegpipe -strict -1 - | x265 --y4m - -o "outputfile.265"
(use -strict -1 or else y4m will want to interpret the input as 8-bit 420)



12bit input--\/
Code:
ffmpeg -i "input.file" -f -pix_fmt yuv420p12le yuv4mpegpipe -strict -1 - | x265 --y4m - -o "outputfile.265"


ffmpeg can automatically detect pixel format from input file. so -pix_fmt "pixel format (yuv420p etc)" input option isn't needed unless input is rawvideo... but if needed use -pix_fmt with a choosen pixel format from below...

other inputs/pix_fmt--\/

yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p gbrp yuv420p10le yuv422p10le yuv444p10le gbrp10le yuv420p12le yuv422p12le yuv444p12le gbrp12le gray gray10le gray12le

(use with -strict 1 to force/allow choosen pix_fmt)
-
-
-
for a list of x265 {not ffmpeg} supported pixel formats use command below
Code:
ffmpeg -h encoder=libx265 2>/dev/null | grep pixel
{for ffmpeg see selurs post}

-

-------------------------------------------
-------------------------------------------
-------------------------------------------
thanks to excellentswordfight for info.
Quote:
Originally Posted by excellentswordfight View Post
Code:
"ffmpeg.exe" -i "input" -f yuv4mpegpipe -strict -1 - | "x265.exe"
In some scenarios you will need to change the format before piping (-pix_fmt)

Last edited by H2sixty; 14th October 2020 at 01:55. Reason: some corrections made thx to selur, in {} brackets or next to. + removed unneeded info to topic
H2sixty is offline   Reply With Quote
Old 6th October 2020, 08:24   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Quote:
ffmpeg can automatically detect pixel format from input file. so -pix_fmt "pixel format (yuv420p etc)" input option isn't needed unless input is rawvideo...
.. or you want/need a color conversion

Quote:
ffmpeg -h encoder=libx265 2>/dev/null | grep pixel
that lists the pixel formats supported by libx265 not the pixel formats supported by ffmpeg to get those use:
Code:
ffmpeg -pix_fmts
Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 6th October 2020, 08:51   #3  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
got this from https://gist.github.com/tayvano/6e2d...e25035478a3a50
to clarify the -strict command.
its not very clear, doesn't give the numbers...

Code:
    -strict       ED.VA… how strictly to follow the standards (from INT_MIN to INT_MAX) (default 0)
     very         ED.V…. strictly conform to a older more strict version of the spec or reference software
     strict       ED.V…. strictly conform to all the things in the spec no matter what the consequences
     normal       ED.V….
     unofficial   ED.V…. allow unofficial extensions
     experimental ED.V…. allow non-standardized experimental things
H2sixty is offline   Reply With Quote
Old 6th October 2020, 08:56   #4  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
thank you Selur. i wanted to gather up the info on piping in one place.

Last edited by H2sixty; 6th October 2020 at 09:02.
H2sixty is offline   Reply With Quote
Old 6th October 2020, 09:36   #5  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Quote:
Originally Posted by H2sixty View Post
just to be sure here's a reference to the ffmpeg source:
Code:
 2531     /**
 2532      * strictly follow the standard (MPEG4, ...).
 2533      * - encoding: Set by user.
 2534      * - decoding: Set by user.
 2535      * Setting this to STRICT or higher means the encoder and decoder will
 2536      * generally do stupid things, whereas setting it to unofficial or lower
 2537      * will mean the encoder might produce output that is not supported by all
 2538      * spec-compliant decoders. Decoders don't differentiate between normal,
 2539      * unofficial and experimental (that is, they always try to decode things
 2540      * when they can) unless they are explicitly asked to behave stupidly
 2541      * (=strictly conform to the specs)
 2542      */
 2543     int strict_std_compliance;
 2544 #define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
 2545 #define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
 2546 #define FF_COMPLIANCE_NORMAL        0
 2547 #define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
 2548 #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
source: https://ffmpeg.org/doxygen/2.7/libav...8h_source.html

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

Tags
ffmpeg, linux, x265, y4m, yuv

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.