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 > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th November 2008, 19:56   #1  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
MONOGRAM x264 Encoder

Hello,

after making a set of audio encoders I’ve been trying to focus on video a little bit. Here’s the first tryout of a libx264 based encoder filter. Full source code can be found in the local SVN repository. The encoder filter is released just like the x264 library as GNU GPL.

Features:

* accepts YV12 input frames
* constant QP and average bitrate rate control modes (only 1-pass encoding so far)
* built with support for multiple CPU cores
* easy-to-use presets for encoder options
* support for B-frames - PTS and DTS information can be read by the downstream filter using a custom IMediaSampleEx interface (see source code for more info)

From my initial tests the filter worked quite nicely although I suspect there might be some small memory leaks which showed up after running the debug version of the filter for a few hours. If you find something please do let me know.

Source : mm_x264_1.0.1.0_src.zip (1.7 MB)

Binary : mm_x264_1.0.1.0_bin.zip (341 KB)

Enjoy,

Igor
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:00   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Where is CRF mode ???
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:02   #3  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
In the todo list
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:06   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by RadScorpion View Post
In the todo list
Nice. Leaving the best mode out, would be a bad idea

I just gave your filter a first attempt, but as soon as I try to run the graph, it crashes on me:



Did I use it in the wrong way?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:09   #5  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Hm. I don't think you did. Can you try it without the MKV muxer ?
e.g. FFDShow -> x264 Enc -> FFDshow -> Video Renderer.
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:16   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Sorry, I get the same problem:

__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:18   #7  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Hmm... Could you give me some more info about the file (width, height .... ) or your CPU ?
Have you tried on a different file ?
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:22   #8  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by RadScorpion View Post
Hmm... Could you give me some more info about the file (width, height .... ) or your CPU ?
Video is 1680x944, a downscaled version of the "Crowdrun" sample. For system details see "My specs" in my signature, please.

Quote:
Originally Posted by RadScorpion View Post
Have you tried on a different file ?
Not yet, but I will do later...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:28   #9  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Your system is basically identical to mine. Would it be possible for you to upload the file for me somewhere ?
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:32   #10  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Here you go:
http://www.mediafire.com/?sharekey=a...db6fb9a8902bda

Also tried a 640x480 Xvid clip, no luck either:

__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:37   #11  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Could you try this build ?

http://blog.monogram.sk/janos/temp/mmx264.ax

I've disabled all SSE stuff.
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:41   #12  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by RadScorpion View Post
Could you try this build ?

http://blog.monogram.sk/janos/temp/mmx264.ax

I've disabled all SSE stuff.
Same crash message


Here is the debugger output:
Code:
[New thread 2064.0x1068]
[New thread 2064.0x804]
[New thread 2064.0x1320]

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 2064.0x1320]
0x02da9555 in mmx264!DllCanUnloadNow ()
   from C:\Downloads\mm_x264_1.0.1.0_bin\mmx264.ax
(gdb) bt
#0  0x02da9555 in mmx264!DllCanUnloadNow ()
   from C:\Downloads\mm_x264_1.0.1.0_bin\mmx264.ax
#1  0x02fa7a50 in ?? ()
#2  0x00000009 in ?? ()
#3  0x00000000 in ?? ()
Build obviously has no debugging symbols...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 27th November 2008 at 20:45.
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:46   #13  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Are you using any special configuration ? Or just the default one that came with the filter. Somehow I can't think of the right spot where the crash could happen :-\
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:47   #14  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by RadScorpion View Post
Are you using any special configuration ? Or just the default one that came with the filter. Somehow I can't think of the right spot where the crash could happen :-\
I messed with the settings indeed. I will try defaults now...


[EDIT]

Yup, with default settings it won't crash. Now I need to find the setting that causes the crash


[EDIT²]

As soon as I switch to "CQ" mode and run the graph it will crash!
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 27th November 2008 at 20:57.
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:47   #15  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Do you think you could run a debug build of the filter ?
RadScorpion is offline   Reply With Quote
Old 27th November 2008, 20:53   #16  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by RadScorpion View Post
Do you think you could run a debug build of the filter ?
If you give me one, then yes
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th November 2008, 20:56   #17  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Quote:
Originally Posted by LoRd_MuldeR View Post
As soon as I switch to "CQ" mode and run the graph it will crash!
Awesome. So perhaps I'm doing something wrong when configuring the encoder. Looks like I have to read the x264 source more carefully. Thanks for the help.
RadScorpion is offline   Reply With Quote
Old 29th December 2008, 13:24   #18  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Hello,

after a little struggle with mingw I’m happy to announce a new version of the x264 wrapper filter with these changes:

* libx264 built with mingw
* memory leaks fixed
* CRF support

hopefully this filter should not crash randomly

Please do some testing and report if anything goes wrong.

Source : mm_x264_1.0.2.0_src.zip (1.5 MB)

Binary : mm_x264_1.0.2.0_bin.zip (444 KB)

Enjoy,

Igor
RadScorpion is offline   Reply With Quote
Old 29th December 2008, 16:32   #19  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
got completely unwatchable video output.

graph:


settings:
Sharktooth is offline   Reply With Quote
Old 29th December 2008, 16:55   #20  |  Link
RadScorpion
Registered User
 
Join Date: Jul 2003
Location: Bratislava, Slovakia
Posts: 147
Did you set the settings before or after connecting to the muxer?
Btw. for the moment try not to use B-Frames - timestamp issues in DShow and so far I'm not sure how it works with muxers like Haali's.
RadScorpion is offline   Reply With Quote
Reply

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 12:30.


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