in

andy vt's tools & blog

Automating lazy

Help testing MEncoder with DVR-MS support

Last post 10-08-2007 2:44 PM by onlydarksets. 358 replies.
Page 4 of 24 (359 items) « First ... < Previous 2 3 4 5 6 Next > ... Last »
Sort Posts: Previous Next
  • 03-04-2007 2:49 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Including the eld tag, it's nearly perfect for me!
    • 4:3 ASPECT:  -demuxer 35 -lavdopts threads=2 "%InputFile%" -quiet -vf crop=704:470:10:5,scale=640:480,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"
    • 16:9 ASPECT:  -demuxer 35 -lavdopts threads=2 "%InputFile%" -quiet -vf crop=704:352:10:64,scale=704:396,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"
    • WITH THE EDL TAG:   -demuxer 35 -lavdopts threads=2 -edl "R:\Recorded TV\show.edl" "%InputFile%" -quiet -vf crop=704:470:10:5,scale=640:480,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"
    A dumb question that I must have overlooked... In Dtb what is the variable for the inputfile minus its extention?  This would be to assign the show's edl file.
    The ecoding on a 2.54 GHz dual core Opteron is a rather consistent ~37 fps.
    Problem:
    • It appears to be only encoding as a single thread app -- CPU use does not achieve above 50%
    Thank you for the hard work!
  • 03-04-2007 5:46 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Keystone:
    Including the eld tag, it's nearly perfect for me!
    • 4:3 ASPECT:  -demuxer 35 -lavdopts threads=2 "%InputFile%" -quiet -vf crop=704:470:10:5,scale=640:480,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"
    • 16:9 ASPECT:  -demuxer 35 -lavdopts threads=2 "%InputFile%" -quiet -vf crop=704:352:10:64,scale=704:396,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"
    • WITH THE EDL TAG:   -demuxer 35 -lavdopts threads=2 -edl "R:\Recorded TV\show.edl" "%InputFile%" -quiet -vf crop=704:470:10:5,scale=640:480,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"
    A dumb question that I must have overlooked... In Dtb what is the variable for the inputfile minus its extention?  This would be to assign the show's edl file.
    The ecoding on a 2.54 GHz dual core Opteron is a rather consistent ~37 fps.
    Problem:
    • It appears to be only encoding as a single thread app -- CPU use does not achieve above 50%
    Thank you for the hard work!

    Sorry I didn’t make it clear, but please don’t use the –demuxer 35 option with the latest version.  The latest dvr-ms work has been done with the MPlayer demuxer (just don’t specify any –demuxer option and the MPlayer demuxer will be used).

    Also, please try “-xvidencopts fixed_quant=4:threads=2”.  I’m not sure it will make a huge difference, but without using two threads to encode the video, I can guarantee the bottleneck will be the encoder.  The main body of Mencoder (the piece the passes the video from the decoder to the encoder) is single threaded, so there is a “built-in” bottleneck with it.  That’s why I said I wasn’t completely happy with the thread support, but I did make some improvements with the threads in this version.  I’m going to keep working on it.

     

  • 03-04-2007 5:52 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    scs32:
    With the latest version I seem to get "not a valid win32 app"

    Wow, I’m not sure what problem you are having.  Please make sure your batch file can find the path to the Mencoder.exe.  Also, please make sure the cygwin1.dll is in the same directory as Mencoder.exe.

    If those ideas don’t work, can you post the command line you are using, and what version of Windows you are running this on?  I haven't done any testing on Vista 64bit, so this may be a problem with a 64bit OS (however, that's just a guess - I'll really need more information).

     

  • 03-04-2007 10:07 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Thanks jelwood, all is fine with the demuxer option removed, but there is no change in the CPU usage with -xvidencopts ...threads=2 option:
    • mencoder -lavdopts threads=2 -edl "R:\Recorded TV\show.edl" "%InputputFile%" -quiet -vf crop=704:352:10:64,scale=704:396,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"
  • 03-04-2007 11:51 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Keystone:
    Thanks jelwood, all is fine with the demuxer option removed, but there is no change in the CPU usage with -xvidencopts ...threads=2 option:
    • mencoder -lavdopts threads=2 -edl "R:\Recorded TV\show.edl" "%InputputFile%" -quiet -vf crop=704:352:10:64,scale=704:396,pp=lb -ofps 29.97 -ovc xvid -xvidencopts fixed_quant=4 -oac mp3lame -lameopts abr:br=128 -o "%OutputFile%"

    Keystone, can you try using the encoding switches below (obviously, you can use whatever filter/scale switches you'd like).  It still won't be able to use 100% of your CPU.  However, I started looking at the multi thread support of the encoders and noticed that the Xvid and lame libraries don't have multi thread support.  The ffmpeg libraries do, so the switches below use the ffmpeg libraries for xvid and mp3 encoding.

    mencoder -lavdopts threads=2 "input file.dvr-ms" -vf expand=:::::4/3,scale=320:240 -ofps 29.97 -ovc lavc -oac lavc -lavcopts vcodec=xvid:vqscale=4:threads=2:acodec=mp3:abitrate=128 -ffourcc XVID -o "output file.avi"

     Like I said, this won't completly solve your problem, but it should use both of your processors better.  I still think the video filters, and inner workings of Mencoder are going to be the bottleneck since they are single threaded, but I want to make sure the encoders arn't causing any issues as well.  Let me know if you see a speed improvement using the ffmpeg libraries for encoding.

  • 03-04-2007 3:10 PM In reply to

    • scs32
    • Top 500 Contributor
    • Joined on 03-04-2007
    • Posts 5

    Re: Help testing MEncoder with DVR-MS support

    So I have no idea what was going on, but I unzipped it again and it seems to be working now (well kinda).  Too odd...

    That said it isn't exactly "working." 

     Below is the beginning of the output.  What's the best way to get you the file?  I tried megaupload, but I never got the confirmation for my account.  I could do a trackerless torrent (utorrent style).  However, I've never found those to be too reliable.  If you've got a good place to announce, let me know.

    Cheers,
    Steve

     MEncoder dev-SVN-r22409-3.4.4 (C) 2000-2006 MPlayer Team
    CPU: Intel(R) Pentium(R) 4 CPU 3.73GHz (Family: 15, Model: 4, Stepping: 3)
    CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
    Compiled with runtime CPU detection.
    success: format: 0  data: 0x0 - 0x41085db
    ASF file format detected.
    VIDEO:  [DVR ]  0x0  0bpp  0.000 fps    0.0 kbps ( 0.0 kbyte/s)
    [V] filefmt:6  fourcc:0x20525644  size:0x0  fps: 0.00  ftime:=166833.0000
    ==========================================================================
    Opening audio decoder: [liba52] AC3 decoding with liba52
    Using SSE optimized IMDCT transform
    Using MMX optimized resampler
    AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
    Selected audio codec: [a52] afm: liba52 (AC3-liba52)
    ==========================================================================
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
    Opening video filter: [scale w=320 h=240]
    Opening video filter: [expand aspect=4/3]
    Expand: -1 x -1, -1 ; -1, osd: 0, aspect: 1.333333, round: 1
    ==========================================================================
    Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
    Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
    ==========================================================================
    Forcing output FourCC to 44495658 [XVID].
    Pos:   0.0s      4f ( 1%)  0.00fps Trem:   0min   0mb  A-V:-0.005 [0:0]
    1 duplicate frame(s)!
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
    eader.
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
    eader.
    Pos:   0.0s      6f ( 1%)  0.00fps Trem:   0min   0mb  A-V:-0.008 [0:0]
    1 duplicate frame(s)!
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
    eader.
    Pos:   0.1s      8f ( 2%)  0.00fps Trem:   0min   0mb  A-V:-0.012 [0:0]
    1 duplicate frame(s)!
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
    eader.
    VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
    SwScaler: reducing / aligning filtersize 17 -> 16
    SwScaler: reducing / aligning filtersize 17 -> 16
    SwScaler: reducing / aligning filtersize 17 -> 16
    SwScaler: reducing / aligning filtersize 17 -> 16
    [swscaler @ 0xa9ed50]SwScaler: BICUBIC scaler, from yuv420p to yuv420p using MMX
    2
    [swscaler @ 0xa9ed50]SwScaler: using n-tap MMX scaler for horizontal luminance s
    caling
    [swscaler @ 0xa9ed50]SwScaler: using n-tap MMX scaler for horizontal chrominance
     scaling
    [swscaler @ 0xa9ed50]SwScaler: using n-tap MMX scaler for vertical scaling (YV12
     like)
    [swscaler @ 0xa9ed50]SwScaler: 1280x960 -> 320x240
    videocodec: libavcodec (320x240 fourcc=44495658 [XVID])
    [VE_LAVC] Using constant qscale = 4.000000 (VBR).

    1 duplicate frame(s)!
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
    eader.
    Full DR not possible, trying SLICES instead!min   0mb  A-V:-0.017 [0:0]
    New_Face failed. Maybe the font path is wrong.n   0mb  A-V:-0.018 [0:0]
    Please supply the text font file (~/.mplayer/subfont.ttf).
    subtitle font: load_sub_face failed.
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
    eader.

    1 duplicate frame(s)!
    Pos:   0.3s     15f ( 2%)  0.00fps Trem:   0min   1mb  A-V:-0.023 [0:0]
    Skipping frame!
    Pos:   0.3s     19f ( 2%)  0.00fps Trem:   0min   0mb  A-V:-0.030 [0:0]
    Skipping frame!
    Pos:   0.4s     21f ( 3%)  0.00fps Trem:   0min   0mb  A-V:-0.033 [0:0]
    Skipping frame!
    Pos:   0.5s     27f ( 3%)  0.00fps Trem:   0min   1mb  A-V:-0.010 [0:0]
    Skipping frame!
    Pos:   0.6s     31f ( 3%)  0.00fps Trem:   0min   1mb  A-V:-0.017 [0:127]
    Skipping frame!
    Pos:   0.6s     32f ( 3%)  0.00fps Trem:   0min   1mb  A-V:-0.018 [0:127]
    Flushing video frames.
    Writing index...
    Writing header...
    ODML: Aspect information not (yet?) available or unspecified, not writing vprp h
    eader.

    Video stream:  243.794 kbit/s  (30474 B/s)  size: 17286 bytes  0.567 secs  32 fr
    ames

    Audio stream:  128.000 kbit/s  (15999 B/s)  size: 17280 bytes  1.080 secs

     

  • 03-04-2007 3:58 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    scs32:

    So I have no idea what was going on, but I unzipped it again and it seems to be working now (well kinda).  Too odd...

    That said it isn't exactly "working." 

     Below is the beginning of the output.  What's the best way to get you the file?  I tried megaupload, but I never got the confirmation for my account.  I could do a trackerless torrent (utorrent style).  However, I've never found those to be too reliable.  If you've got a good place to announce, let me know.

    Cheers,
    Steve

     MEncoder dev-SVN-r22409-3.4.4 (C) 2000-2006 MPlayer Team
    CPU: Intel(R) Pentium(R) 4 CPU 3.73GHz (Family: 15, Model: 4, Stepping: 3)
    CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
    Compiled with runtime CPU detection.
    success: format: 0  data: 0x0 - 0x41085db
    ASF file format detected.
    VIDEO:  [DVR ]  0x0  0bpp  0.000 fps    0.0 kbps ( 0.0 kbyte/s)
    [V] filefmt:6  fourcc:0x20525644  size:0x0  fps: 0.00  ftime:=166833.0000

    It looks like it didn't detect anything in this file - I've never seen this before.  Could you post the command line you were using, plus what version of Windows you are running?

    You can use megaupload without registering.  Just upload the file and after it's uploaded the link will appear in the top right corner of the web page.

  • 03-04-2007 4:47 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Keystone:
    A dumb question that I must have overlooked... In Dtb what is the variable for the inputfile minus its extention?  This would be to assign the show's edl file.
    There isn't one, but you can easily create it by creating a new Context with the following values:
    SourceContext: InputFile
    TargetContext: [CONTEXT NAME HERE]
    FindRegex: C:\\Recorded TV\\([^\\]+)dvr-ms\z
    ReplaceRegex: $1
    Just be sure to replace "C:\\Recorded TV\\" with the actual path to your recorded TV files.  Personally, I just overwrite the OutputFile Context, since I don't ever need it.  Whatever you choose, the new context will contain just the filename without the extension.
  • 03-04-2007 4:47 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Keystone:
    A dumb question that I must have overlooked... In Dtb what is the variable for the inputfile minus its extention?  This would be to assign the show's edl file.
    There isn't one, but you can easily create it by creating a new Context with the following values:
    SourceContext: InputFile
    TargetContext: [CONTEXT NAME HERE]
    FindRegex: C:\\Recorded TV\\([^\\]+)dvr-ms\z
    ReplaceRegex: $1
    Just be sure to replace "C:\\Recorded TV\\" with the actual path to your recorded TV files.  Personally, I just overwrite the OutputFile Context, since I don't ever need it.  Whatever you choose, the new context will contain just the filename without the extension.
  • 03-04-2007 5:30 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    • jelwood, I just tried using your encoding switches for the ffmpeg libraries but on 3 different files I returned with the identical encoding times and CPU usage again averaging at 50%.
    • onlydarkside, setting up another Context will help out a lot and avoid resorting to a called batch file run via DirMon2. Dtb is cleaner and easier to set the process priority.
  • 03-04-2007 5:43 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Here (http://www.megaupload.com/?d=UF4230I1) is a link to the latest version of Mencoder with dvr-ms support (this is version 4). 

    Edit: the above version is bad, please don't use.

    New things in this version are:

    1)     I removed the dependency on cygwin1.dll.

    2)     I made another tweak to the threads (I got a slight performance boost).  It doesn’t look like we are going to get 100% usage on multi processor systems right now.  We have multi thread support reading the file and decoding the MPEG-2.  We also have multi-thread support in the Xvid encoder as long as you use the ffmpeg encoder (see command line below).  However, the MPlayer filters are all single threaded.  Because of this we are sending the data from one “fat pipe” to the other “fat pipe” through a straw (a small straw).  This would be a MAJOR project to change.  Maybe one day I’ll try it (but not today).

    3)     This version supports both H.264 and AAC.  I don’t own an iPod, so I have no idea if this will play in that device.  However, I did test the playback on my PC and I know it does encode in H.264 and AAC.  I just don’t know all the “tweaks” necessary for the iPod hardware.

    Here are the command lines I’ve used for testing.

    Xvid/MP3:

    mencoder -lavdopts threads=2 "input.dvr-ms" -vf expand=:::::4/3,scale=320:240 -ofps 29.97 -ovc lavc -lavcopts vcodec=xvid:vqscale=4:threads=2 -ffourcc XVID -oac mp3lame -lameopts abr:br=128 -o "output.avi"

    H.264/AAC:

    mencoder -lavdopts threads=2 "input.dvr-ms" -vf expand=:::::4/3,scale=320:240 -ofps 29.97 -ovc x264 -x264encopts crf=4:threads=2 -oac faac -faacopts br=128 -o "output.avi"

    Below are a few things I have to work on.  If anyone would like to help with #3, #4, and #5 it would be appreciated (it will give me more time to work on #1 and #2).

    1)     We will continue to work on the source code so the MPlayer developers will accept it in the SVN.

    2)     I’m also going to work on adding dvr-ms support to ffmpeg.  I took a quick look at the ffmpeg source code and it looks like all of ffmpeg is multi threaded so we may have better luck using it with multiple processors.

    3)     I’d like to create some “standard” profiles that we can distribute.  If anyone has a profile file they would like to share, please post it.  I'd like to have a file that has many different options of working profiles that people can select.

    4)     I’m going to make a Dtb profile so it will be easier to use this with Dtb.

    5)     Documentation on using this with Dtb (not calling a batch file will be necessary)…

  • 03-04-2007 6:17 PM In reply to

    • scs32
    • Top 500 Contributor
    • Joined on 03-04-2007
    • Posts 5

    Re: Help testing MEncoder with DVR-MS support

    jelwood:

    It looks like it didn't detect anything in this file - I've never seen this before.  Could you post the command line you were using, plus what version of Windows you are running?

    You can use megaupload without registering.  Just upload the file and after it's uploaded the link will appear in the top right corner of the web page.

     I was using the commandline you recommended a few entries up.  The operating system is Vista.  It should also be noted that this is a) HD b) the result of HDHR.

     Cheers,

    Steve

     

    p.s. I'll upload the link when it's done.

  • 03-04-2007 6:50 PM In reply to

    • scs32
    • Top 500 Contributor
    • Joined on 03-04-2007
    • Posts 5

    Re: Help testing MEncoder with DVR-MS support

  • 03-04-2007 7:03 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    jelwood:

    2)     I’m also going to work on adding dvr-ms support to ffmpeg.  I took a quick look at the ffmpeg source code and it looks like all of ffmpeg is multi threaded so we may have better luck using it with multiple processors.

     

    I was under the impression that dvr-ms support already exists in ffmpeg.  I know it's not in the version available on the ffmpeg website, but isn't it just a matter of compiling the binaries?

    http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2005-August/000846.html

    EDIT: Looks like I was wrong:

    http://forum.doom9.org/showthread.php?t=79204&page=2

  • 03-04-2007 7:44 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    sorry onlydarksets, where may I add/change a Dtb Context?
Page 4 of 24 (359 items) « First ... < Previous 2 3 4 5 6 Next > ... Last »
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems