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 > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th April 2020, 13:50   #1  |  Link
F1nkster
Registered User
 
Join Date: Sep 2011
Location: King of Prussia, PA
Posts: 16
cfenc - command line Cineform encoder

Not sure what the interest level may be, but thought I would at least make it known that I wrote a command line Cineform encoder for Linux. Mac is also supported, but the main purpose and value is Linux, for which no native Cineform encoder has been available up to now.

You can find it here (with full details, please visit the site before asking questions). It's free/OSS of course.

https://github.com/marksfink/cfenc

If you have interest, feedback, questions, feel free to ask!
F1nkster is offline   Reply With Quote
Old 5th April 2020, 14:22   #2  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 692
It is difficult to say whether there will be interest in the topic.
Coronavirus free volunteering cut out.
From what was written on the forum: Cineform is old codec, no longer updated, based on old jpeg2000 and dpx. We already have HTjpeg2000. Will Cineform be competitive with JPEG XS?
Jamaika is offline   Reply With Quote
Old 5th April 2020, 14:55   #3  |  Link
F1nkster
Registered User
 
Join Date: Sep 2011
Location: King of Prussia, PA
Posts: 16
There will always be new, better codecs coming along so it is not so much about debating the technical merits of each. It's more about workflows and how well codecs fit into them. And many people use Cineform from what I gather on forums even if it's not the newest, sexiest thing.

In any case, I expect the interest level to be modest certainly but not non-existent. We'll see. In any case, I used some of my Covid-19 stay-at-home time to write it and it's useful to me! I can now remove wine from my system.
F1nkster is offline   Reply With Quote
Old 5th April 2020, 15:15   #4  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,043
Quote:
Originally Posted by F1nkster View Post
command line Cineform encoder


Hope the MABS team will add support for it Very-Soon™.
filler56789 is offline   Reply With Quote
Old 6th April 2020, 08:49   #5  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 692
For geeks under windows cfenc. UNTESTED
https://www.sendspace.com/file/qv6rj4
Jamaika is offline   Reply With Quote
Old 6th April 2020, 10:15   #6  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,496
It's always surprising how little effort it would actually take a company to support Linux, if they just cared. Thanks! I imagine it wouldn't take much more to support something like GStreamer, either.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 7th April 2020, 01:27   #7  |  Link
F1nkster
Registered User
 
Join Date: Sep 2011
Location: King of Prussia, PA
Posts: 16
I agree. If an amateur weekend programmer like myself can write it, a pro could do it in their sleep!

Now, I am loathe to get into a "this codec is better than that codec" discussion, but Jamaika got me looking at JPEG XS. It sounds really cool, however...I don't see any publicly available implementation or SDK for it. Looks like it has to be licensed, which is perfectly fair and reasonable. Unfortunately that does me no good. I work on GoPro footage (which got me into Cineform to begin with) and now I use Cineform for everything else. But it's all personal stuff. And I like Cineform over DNXHD and Prores because I get significantly smaller file sizes at similar quality settings. That's the long and short of it for me.
F1nkster is offline   Reply With Quote
Old 7th April 2020, 05:44   #8  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,043
Quote:
Originally Posted by Jamaika View Post
For geeks under windows cfenc. UNTESTED
https://www.sendspace.com/file/qv6rj4
1) for the binary.

2) OK, the source-code could be compiled, but in the real world of Windows it doesn't work :–/

Code:
=> cfenc -i input.avi C:\DISCIMGS\cftest001.avi
cfenc version 0.0 -- Cineform encoder/transcoder
libavformat    58. 42.100
libavcodec     58. 77.101
libavutil      56. 42.102
libswscale      5.  6.101
libCFHDCodec   10.  0.  2

Failed to open 'input.avi':
Protocol not found
FWIW: "input.avi" is a 1-minute Xvid clip @ 640x480 @ 29.97 fps.
filler56789 is offline   Reply With Quote
Old 7th April 2020, 06:21   #9  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 692
Quote:
Originally Posted by F1nkster View Post
Now, I am loathe to get into a "this codec is better than that codec" discussion, but Jamaika got me looking at JPEG XS. It sounds really cool, however...I don't see any publicly available implementation or SDK for it. Looks like it has to be licensed, which is perfectly fair and reasonable. Unfortunately that does me no good. I work on GoPro footage (which got me into Cineform to begin with) and now I use Cineform for everything else. But it's all personal stuff. And I like Cineform over DNXHD and Prores because I get significantly smaller file sizes at similar quality settings. That's the long and short of it for me.
For me, cineform is better than mjpeg2000. Plays movies much smoother. However, as cineform was robbed and had cracks, so it was abandoned technologically and has been added as free on github.
It annoys me that there is no HDR BT2020 option although the codec is for 10 / 12bit movies. I don't know how 4K support, in older versions of Sony Vegas did not want to work. Let's say good quality, if you choose high is average.

PS JPEG XS was about to appear this Christmas.

Quote:
Originally Posted by filler56789 View Post
2) OK, the source-code could be compiled, but in the real world of Windows it doesn't work :–/
I'm sorry as amateur:
After four hours, but only where something screwed up?
I don't know. Does cineform work? I never compiled it with GCC
https://github.com/gopro/cineform-sd...093973722c8d4d
Config setting for amateur in libav is torment.

Code:
static const AVCodec * const codec_list[] = {
    &ff_rawvideo_encoder,
    &ff_rawvideo_decoder,
    &ff_cinepak_encoder,
    &ff_cinepak_decoder,
    NULL };
Code:
static const AVBitStreamFilter *bitstream_filters[] = {
    NULL };
Code:
static const AVCodecParser * const parser_list[] = {
    NULL };
Code:
static const AVInputFormat * const demuxer_list[] = {
    &ff_avi_demuxer,
    &ff_cine_demuxer,
    &ff_mov_demuxer,
    &ff_rawvideo_demuxer,
    NULL };
Code:
static const AVOutputFormat * const muxer_list[] = {
    &ff_avi_muxer,
    &ff_mov_muxer,
    &ff_rawvideo_muxer,
    NULL };
Code:
static const URLProtocol * const url_protocols[] = {
    &ff_md5_protocol,
    NULL };
I add libav witf ffmpeg. It annoys me that config and internal.h doesn't attach all options to libav files
#define HAVE_FAST_CLZ 1
#define HAVE_ERF 1
#define HAVE_FCNTL 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_GMTIME_R 0
#define HAVE_HYPOT 1
#define HAVE_LOCALTIME_R 0
#define HAVE_NANOSLEEP 0
#define HAVE_SYSCTL 0
#define HAVE_PTHREADS 1
#define HAVE_PRAGMA_DEPRECATED 0
#define CONFIG_MOV_MUXER 1
#define CONFIG_RAWVIDEO_MUXER 1

Last edited by Jamaika; 7th April 2020 at 07:12.
Jamaika is offline   Reply With Quote
Old 7th April 2020, 16:19   #10  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 747
cfenc-20200405-0f80fbd-win64
HolyWu is offline   Reply With Quote
Old 7th April 2020, 18:55   #11  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,043
Quote:
Originally Posted by HolyWu View Post
This one works!

filler56789 is offline   Reply With Quote
Old 7th April 2020, 20:54   #12  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,464
Quote:
Originally Posted by Jamaika View Post
For me, cineform is better than mjpeg2000. Plays movies much smoother. However, as cineform was robbed and had cracks, so it was abandoned technologically and has been added as free on github.
It annoys me that there is no HDR BT2020 option although the codec is for 10 / 12bit movies. I don't know how 4K support, in older versions of Sony Vegas did not want to work. Let's say good quality, if you choose high is average.

PS JPEG XS was about to appear this Christmas.
Cineform is simple and this is its power. It's many times faster than Jpeg2000, which without good code is still so problematic (and good code costs big money).
Cineform was 10 years ahead its time. There are still so many features around Cineform workflows which are ahead of current time (eg. use of heavy/dynamic metadata )
It's more than codec and only fact that David had no support from big company stopped it to be mainstream.

No idea what you mean by 4K? It supports "any" resolution. I tested up to 32K if I remember well. Only annoying bit which should be removed I need of mod 16 (horizontally).
HDR? Nothing more than any other video. 12bit is there so HDR is not a problem for Cineform. You even have a RAW mode.

Last edited by kolak; 7th April 2020 at 20:57.
kolak is offline   Reply With Quote
Old 7th April 2020, 22:07   #13  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 692
Thx HolyWu, I failed to compile under gcc.
Library & codec: https://www.sendspace.com/file/3qr77g

Hmm. Perhaps the developers have improved something for 4K. I know one thing, to have 12bit you need to have a professional editor and handling of mov containers. For avi there is only 8bit. The codec is 15 years or more and editors haven't had the pressure to add Cineform to 10 / 12bit movies.
Color space in Sony Vegas for 8bit movies are distorted. So I prefer to use RGB uncompresed than Cineform.

Last edited by Jamaika; 8th April 2020 at 07:14.
Jamaika is offline   Reply With Quote
Old 7th April 2020, 22:44   #14  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,464
There is no problem with 10bit if you use low level integration (not crapy VFW or directshow). Stay away form those "technologies" and you are fine.
All what you mentioned has nothing to do with codec itself and its "age".
Other than this- AVI is poor and old container.
kolak is offline   Reply With Quote
Old 8th April 2020, 07:28   #15  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,124
@HolyWu – might be interesting to get it supported in the media-autobuild suite, I hope you can give some advices.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 26th April 2020, 19:22   #16  |  Link
F1nkster
Registered User
 
Join Date: Sep 2011
Location: King of Prussia, PA
Posts: 16
Alpha channel support

I found it was very easy to add, so I created a branch called "alpha" on the Github repo for an update that supports alpha channels.

I will merge it into the master branch once I get confirmation from at least one person that it works correctly. I did some basic testing and believe it is good.

This is in response to an issue opened in the Github repo, so at least one person cares about it! .

It works very simply: if the input video has an alpha channel then it automatically encodes to RGBA. No command-line option for it. I was surprised to find that the Cineform SDK does not support YUVA, which is why we encode to RGBA and don't bother with a command line option.
F1nkster is offline   Reply With Quote
Old 27th April 2020, 05:45   #17  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 692
Thanks and for that. I won't check because I can't compile properly under Windows. Point for you.
Jamaika is offline   Reply With Quote
Old 28th June 2020, 19:21   #18  |  Link
urik
Registered User
 
Join Date: Oct 2019
Posts: 1
Thanks for making this! Dunno about assembling but I used build from this reply above.

I've tried using VirtualDub2 for this before (its commandline version, vdub), but the logistics of using that were so much "jumping through hoops", and then with last version it stopped working altogether.
Whereas cfenc is pretty much like FFMpeg, straight to the point. Shame FFmpeg won't implement it.
urik is offline   Reply With Quote
Old 28th June 2020, 20:56   #19  |  Link
richardpl
Registered User
 
Join Date: Jan 2012
Posts: 131
Quote:
Originally Posted by urik View Post
Whereas cfenc is pretty much like FFMpeg, straight to the point. Shame FFmpeg won't implement it.
I heard you donated for cineform encoder in FFmpeg.
richardpl is offline   Reply With Quote
Old 4th July 2020, 14:14   #20  |  Link
F1nkster
Registered User
 
Join Date: Sep 2011
Location: King of Prussia, PA
Posts: 16
@urik, I previously used VirtualDub2 also. Over the past year, I migrated to Linux and so I wanted a Cineform encoder that is compiled for Linux vs running under Wine.

The Windows build is also posted on the Github repo under Releases.

I have since added a branch to the repo called "alpha" that adds alpha channel support. I'm waiting for folks to test it before I merge it to master.

As for ffmpeg, I waited for years for someone to add Cineform encoding to it, but found a post where someone said that they won't do it because Cineform is written for x86 only and ffmpeg supports other architectures, which begs the question why not at least include Cineform encoding for x86 and simply exclude it for others? In any case, rather than argue and probably lose, I wrote cfenc.
F1nkster is offline   Reply With Quote
Reply

Tags
cineform, encoder, ffmpeg, linux

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 10:24.


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