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 19 of 24 (359 items) « First ... < Previous 17 18 19 20 21 Next > ... Last »
Sort Posts: Previous Next
  • 03-31-2007 2:04 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    kingtone:

    re: dvr-ms to mpg

    I've got this working. My goal was to get to an mpg that would play in Windows Media Player with as minimal extra switches as possible.

    c:\mplayer7\mencoder -quiet -lavdopts threads=2 %1 -edl "%~dp1%~n1.edl" -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=704:-2,pp=lb -lavcopts vcodec=mpeg2video:threads=2 -ofps 30000/1001  -o "%~dp1%~n1.mpg"

     

    I'm just catching up here, nice work! 

  • 03-31-2007 4:20 PM In reply to

    • Hecks
    • Top 25 Contributor
    • Joined on 11-13-2006

    Re: Help testing MEncoder with DVR-MS support

    kingtone:

    scale=704:-2,pp=lb,harddup

    Are we still on this one?  It should be pp=lb,scale=704:-2 - deinterlacing before scaling.

    http://babgvant.com/forums/permalink/1941/3410/ShowThread.aspx#3410

    Also this: -edl "%~dp1%~n1.edl" should be written as this: -edl "%~dpn1.edl". 

    Generic profiles need to avoid such obvious errors.  It would be really helpful if the final set could be checked over by a mencoder dev, methinks.

    -Hecks

     

  • 03-31-2007 7:55 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Hecks:
    kingtone:

    scale=704:-2,pp=lb,harddup

    Are we still on this one?  It should be pp=lb,scale=704:-2 - deinterlacing before scaling.

    http://babgvant.com/forums/permalink/1941/3410/ShowThread.aspx#3410

    Also this: -edl "%~dp1%~n1.edl" should be written as this: -edl "%~dpn1.edl". 

    Generic profiles need to avoid such obvious errors.  It would be really helpful if the final set could be checked over by a mencoder dev, methinks.

    -Hecks

     

    Thanks Hecks. Somehow I missed this as I was concentrating on other things in this thread. I'll update my code. 

    Home Built Media Server | Windows 7 RC (x86) | HP MediaSmart Connect Extender | www.techlifeweb.com | @techlifeweb on Twitter
  • 03-31-2007 9:19 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    kingtone:

    re: dvr-ms to mpg

    I've got this working. My goal was to get to an mpg that would play in Windows Media Player with as minimal extra switches as possible.

    c:\mplayer7\mencoder -quiet -lavdopts threads=2 %1 -edl "%~dp1%~n1.edl" -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=704:-2,pp=lb -lavcopts vcodec=mpeg2video:threads=2 -ofps 30000/1001  -o "%~dp1%~n1.mpg"

    3 things:

    You have to put in the fps bit. Otherwise you get:
    [swscaler @ 00A5E0A0]SwScaler: 1920x1080 -> 704x396
    videocodec: libavcodec (704x396 fourcc=3267706d [mpg2])
    [mpeg2video @ 00A61020]MPEG1/2 does not support 23047/769 fps
    Could not open codec.
    FATAL: Cannot initialize video driver.

    second, the mpg is created but it probably isn't dvd compliant. That's what all the extra switches are for. Not really a huge deal in the sense that we could build 2 profiles, 1 for PAL > PALDVD and another for NTSC > NTSCDVD.

     It's all in the lavcopts options and, as Randy mentioned, this page is really helpful sorting it all out: http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html

    third: you might want to try scale=704:-2,pp=lb,harddup as I think the a/'v sync is better.

    Thank you to everyone for your work on this, I think this will be a nice addition.  I've made a code change so you won't have to specify the –ofps.  This will be a included in the next version coming soon.  However, I have one other idea.

    If we use the settings below, can we preserve the 5.1 sound in ATSC files?  Can someone look into this and see what happens?  Even though everything is being re-encoded, it should be really close to the original quality (except I’m not sure if the 5.1 sound will be preserved).

    mencoder -lavdopts threads=2 "input.dvr-ms" -vf pp=lb -oac lavc -ovc lavc -lavcopts vcodec=mpeg2video:vqscale=1:acodec=ac3:threads=2 -of mpeg -mpegopts format=dvd -ofps 30000/1001 -o "output.mpg"

    Thanks again for your help.  Having others figure out the best command line switches helps me to concentrate on improving the way Mencoder reads the dvr-ms format.

  • 03-31-2007 11:01 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    I've got a standard analog captured PAL recording which should have MPEG2 audio and video, which is not encoding properly.

    It appears it's detecting it as AC3 audio..

     

    The file is 2GB, so I don't particularly want to upload it..

    Here's the output of running it anyway - let me know what you want me to execute to tell you more about it.

     

    D:\Source\Mencoder-Beta\Scripts>D:\Source\Mencoder-Beta\mencoder.exe -lavdopts t
    hreads=2 "E:\dora\Dora the Explorer_Monkey Bars.dvr-ms" -passlogfile "D:\temp\la
    vcstats.log" -quiet -vfm ffmpeg -vf pp=lb,scale=704:-2:0 -af volnorm -oac mp3lam
    e -lameopts fast:preset=medium -ofps 25 -ovc lavc -lavcopts vcodec=mpeg4:vbitrat
    e=1200:autoaspect:turbo:threads=2:vpass=1 -ffourcc XVID -noodml -o NUL
    MEncoder dev-SVN-rUNKNOWN-3.4.5 (C) 2000-2006 MPlayer Team
    CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (Family: 15, Model: 2, Stepping: 9)
    CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
    Compiled with runtime CPU detection.
    success: format: 0  data: 0x0 - 0x8043e555
    ASF file format detected.

     

    PROBING AUDIO STREAM, mp2_score=1


    VIDEO:  [DVR ]  0x0  0bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
    [V] filefmt:6  fourcc:0x20525644  size:0x0  fps:25.00  ftime:=0.0400
    ==========================================================================
    Opening audio decoder: [liba52] AC3 decoding with liba52
    No accelerated IMDCT transform found

    Too many video packets in the buffer: (222 in 8452108 bytes).
    Maybe you are playing a non-interleaved stream/file or the codec failed?
    For AVI files, try to force non-interleaved mode with the -ni option.
    A52 sync failed
    ADecoder init failed :(
    ADecoder init failed :(
    Requested audio codec family [ac3] (afm=libac3) not available.
    Enable it at compilation.
    Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
    No accelerated IMDCT transform found

    Too many video packets in the buffer: (222 in 8452108 bytes).
    Maybe you are playing a non-interleaved stream/file or the codec failed?
    For AVI files, try to force non-interleaved mode with the -ni option.
    AC3/DTS sync failed
    ADecoder init failed :(
    ADecoder init failed :(
    Cannot find codec for audio format 0x2000.
    Read DOCS/HTML/en/codecs.html!
    ==========================================================================
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
    Opening video filter: [scale w=704 h=-2 interlaced=0]
    Opening video filter: [pp=lb]
    ==========================================================================
    Trying to force video codec driver family ffmpeg...
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
    ==========================================================================
    Forcing output FourCC to 44495658 [XVID].
    VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
    [PP] Using external postprocessing filter, max q = 6.
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
    SwScaler: reducing / aligning filtersize 6 -> 8
    SwScaler: reducing / aligning filtersize 6 -> 8
    SwScaler: reducing / aligning filtersize 6 -> 5
    SwScaler: reducing / aligning filtersize 6 -> 5
    [swscaler @ 00A5E0A0]SwScaler: BICUBIC scaler, from yuv420p to yuv420p using MMX
    2
    [swscaler @ 00A5E0A0]SwScaler: using 8-tap MMX scaler for horizontal luminance s
    caling
    [swscaler @ 00A5E0A0]SwScaler: using 8-tap MMX scaler for horizontal chrominance
     scaling
    [swscaler @ 00A5E0A0]SwScaler: using n-tap MMX scaler for vertical scaling (YV12
     like)
    [swscaler @ 00A5E0A0]SwScaler: 720x576 -> 704x528
    videocodec: libavcodec (704x528 fourcc=44495658 [XVID])
    Writing header...
    ODML: vprp aspect is 4:3.
    Writing header...
    ODML: vprp aspect is 4:3.
    Writing header...
    ODML: vprp aspect is 4:3.

    Too many audio packets in the buffer: (4096 in 8257536 bytes).
    Maybe you are playing a non-interleaved stream/file or the codec failed?
    For AVI files, try to force non-interleaved mode with the -ni option.

    Flushing video frames.
    Writing index...
    Writing header...
    ODML: vprp aspect is 4:3.

    Video stream: 1223.916 kbit/s  (152989 B/s)  size: 27672731 bytes  180.880 secs
     4523 frames

    D:\Source\Mencoder-Beta\Scripts>date /t
    Sun 01/04/2007

    D:\Source\Mencoder-Beta\Scripts>time /t
    03:59 PM

    D:\Source\Mencoder-Beta\Scripts>D:\Source\Mencoder-Beta\mencoder.exe -lavdopts t
    hreads=2 "E:\dora\Dora the Explorer_Monkey Bars.dvr-ms" -passlogfile "D:\temp\la
    vcstats.log" -quiet -sws 2 -vfm ffmpeg -vf pp=lb,scale=704:-2:0 -af volnorm -oac
     mp3lame -lameopts fast:preset=medium -ofps 25 -ovc lavc -lavcopts vcodec=mpeg4:
    mbd=2:v4mv:mv0:vbitrate=1200:autoaspect:threads=2:vpass=2 -ffourcc XVID -noodml
    -o "D:\encoded\Dora the Explorer_Monkey Bars.avi"
    MEncoder dev-SVN-rUNKNOWN-3.4.5 (C) 2000-2006 MPlayer Team
    CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (Family: 15, Model: 2, Stepping: 9)
    CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
    Compiled with runtime CPU detection.
    success: format: 0  data: 0x0 - 0x8043e555
    ASF file format detected.

     

    PROBING AUDIO STREAM, mp2_score=1


    VIDEO:  [DVR ]  0x0  0bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
    [V] filefmt:6  fourcc:0x20525644  size:0x0  fps:25.00  ftime:=0.0400
    ==========================================================================
    Opening audio decoder: [liba52] AC3 decoding with liba52
    No accelerated IMDCT transform found

    Too many video packets in the buffer: (222 in 8452108 bytes).
    Maybe you are playing a non-interleaved stream/file or the codec failed?
    For AVI files, try to force non-interleaved mode with the -ni option.
    A52 sync failed
    ADecoder init failed :(
    ADecoder init failed :(
    Requested audio codec family [ac3] (afm=libac3) not available.
    Enable it at compilation.
    Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
    No accelerated IMDCT transform found

    Too many video packets in the buffer: (222 in 8452108 bytes).
    Maybe you are playing a non-interleaved stream/file or the codec failed?
    For AVI files, try to force non-interleaved mode with the -ni option.
    AC3/DTS sync failed
    ADecoder init failed :(
    ADecoder init failed :(
    Cannot find codec for audio format 0x2000.
    Read DOCS/HTML/en/codecs.html!
    ==========================================================================
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
    Opening video filter: [scale w=704 h=-2 interlaced=0]
    Opening video filter: [pp=lb]
    ==========================================================================
    Trying to force video codec driver family ffmpeg...
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
    ==========================================================================
    Forcing output FourCC to 44495658 [XVID].
    VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
    [PP] Using external postprocessing filter, max q = 6.
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
    SwScaler: reducing / aligning filtersize 6 -> 8
    SwScaler: reducing / aligning filtersize 6 -> 8
    SwScaler: reducing / aligning filtersize 6 -> 5
    SwScaler: reducing / aligning filtersize 6 -> 5
    [swscaler @ 00A5E0A0]SwScaler: BICUBIC scaler, from yuv420p to yuv420p using MMX
    2
    [swscaler @ 00A5E0A0]SwScaler: using 8-tap MMX scaler for horizontal luminance s
    caling
    [swscaler @ 00A5E0A0]SwScaler: using 8-tap MMX scaler for horizontal chrominance
     scaling
    [swscaler @ 00A5E0A0]SwScaler: using n-tap MMX scaler for vertical scaling (YV12
     like)
    [swscaler @ 00A5E0A0]SwScaler: 720x576 -> 704x528
    videocodec: libavcodec (704x528 fourcc=44495658 [XVID])
    [VE_LAVC] High quality encoding selected (non-realtime)!
    Writing header...
    ODML: vprp aspect is 4:3.
    Writing header...
    ODML: vprp aspect is 4:3.
    Writing header...
    ODML: vprp aspect is 4:3.

  • 03-31-2007 11:04 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    For the record, I'm finding the use of pp=lb deinterlacing results in a fairly ugly blending of frames which shows ghosting on movement..

     

    I'll try pp=md again and see if it's better..

  • 04-01-2007 1:45 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    jelwood:

    Thank you to everyone for your work on this, I think this will be a nice addition.  I've made a code change so you won't have to specify the –ofps.  This will be a included in the next version coming soon.  However, I have one other idea.

    If we use the settings below, can we preserve the 5.1 sound in ATSC files?  Can someone look into this and see what happens?  Even though everything is being re-encoded, it should be really close to the original quality (except I’m not sure if the 5.1 sound will be preserved).

    mencoder -lavdopts threads=2 "input.dvr-ms" -vf pp=lb -oac lavc -ovc lavc -lavcopts vcodec=mpeg2video:vqscale=1:acodec=ac3:threads=2 -of mpeg -mpegopts format=dvd -ofps 30000/1001 -o "output.mpg"

    Thanks again for your help.  Having others figure out the best command line switches helps me to concentrate on improving the way Mencoder reads the dvr-ms format.

    According to the help file you have to throw and additional switch (-channels 6) before -oac for 5.1 channel sound.

    -channels 6 -oac lavc 
    I don't have time to try it out at the moment
    Home Built Media Server | Windows 7 RC (x86) | HP MediaSmart Connect Extender | www.techlifeweb.com | @techlifeweb on Twitter
  • 04-01-2007 5:37 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    auldar:
    I've got a standard analog captured PAL recording which should have MPEG2 audio and video, which is not encoding properly.

    It appears it's detecting it as AC3 audio..

     

    The file is 2GB, so I don't particularly want to upload it..

    This is the first file I've seen that fails the audio detection.  Can you try using DVREdit to make a smaller clip and then post the smaller clip to www.megaupload.com?  Of course, once you create the smaller clip please test it against Mencoder to make sure it still fails the audio detection.

  • 04-01-2007 8:00 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    jelwood, thanks for your work!  The demuxing issues that I was having appear to be solved.  I've also added the harddup tag and no longer have any duplicate frames being skipped warning while encoding. That has given me perfect audio synch for very long files and may have resolved my non-active -edl issue when using the mencoder demuxer.  The application of harddup also resolved the warning when I applied the de-interlacing before scaling. Here's my lastest setting for a high quality, computer archive intended,16:9 copping and ecoding of NTSC SD:
    -quiet -lavdopts threads=2 -edl "%InputFileEDL%" "%InputFile%" -vf crop=704:352:6:62,pp=lb,scale=704:400,harddup -fps 29.97 -ofps 29.97 -ovc x264 -x264encopts crf=23:threads=2:subq=5:8x8dct:me=hex:frameref=3:bframes=3:b_pyramid:weight_b -oac mp3lame -lameopts abr:br=192 -ffourcc H264 -o "%OutputFile%"
  • 04-01-2007 11:40 AM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Way back on post 3072 I noted that I uploaded the current profile and batch file that I use. I just modified the batch file included with all the lessons learned since then (e.g., deinterlace then scale).

     Everyone has their own favorite switches to get the video to do what they need. This is just a basic profile that works for me and lets me play my xvid files on my Divx-playing dvd player.

     

    Home Built Media Server | Windows 7 RC (x86) | HP MediaSmart Connect Extender | www.techlifeweb.com | @techlifeweb on Twitter
  • 04-01-2007 8:29 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    jelwood:
    auldar:
    I've got a standard analog captured PAL recording which should have MPEG2 audio and video, which is not encoding properly.

    It appears it's detecting it as AC3 audio..

     

    The file is 2GB, so I don't particularly want to upload it..

    This is the first file I've seen that fails the audio detection.  Can you try using DVREdit to make a smaller clip and then post the smaller clip to www.megaupload.com?  Of course, once you create the smaller clip please test it against Mencoder to make sure it still fails the audio detection.

    Don't worry about creating the clip for me.  I'm going to be posting a new version.  Please try it and let me know if it improves things for you.

  • 04-01-2007 8:31 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Keystone:
    jelwood, thanks for your work!  The demuxing issues that I was having appear to be solved.  I've also added the harddup tag and no longer have any duplicate frames being skipped warning while encoding. That has given me perfect audio synch for very long files and may have resolved my non-active -edl issue when using the mencoder demuxer.  The application of harddup also resolved the warning when I applied the de-interlacing before scaling. Here's my lastest setting for a high quality, computer archive intended,16:9 copping and ecoding of NTSC SD:
    -quiet -lavdopts threads=2 -edl "%InputFileEDL%" "%InputFile%" -vf crop=704:352:6:62,pp=lb,scale=704:400,harddup -fps 29.97 -ofps 29.97 -ovc x264 -x264encopts crf=23:threads=2:subq=5:8x8dct:me=hex:frameref=3:bframes=3:b_pyramid:weight_b -oac mp3lame -lameopts abr:br=192 -ffourcc H264 -o "%OutputFile%"

    Keystone, I noticed that you are setting both the input and output fps.  Are you having issues with the fps?

  • 04-01-2007 8:49 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    http://babgvant.com/files/folders/misc/entry3412.aspx

    Above is the link to the latest version of Mencoder.

    Changes in Version 8:

    1)     Win32API and MinGW runtime have been updated (and off_t patched) to increase stability.

    2)     Default Encoding Profile added.  Please look over the profiles and let me know if you see any issues.  Also, if anyone would be willing to create a 2-pass Xvid and WMV profile I would greatly appreciate it.  Profiles are located in : “.\mplayer\Mencoder.conf” Use the command lines below to use Default Profiles

    a.     mencoder "input.dvr-ms" -profile Xvid-fast -o "output.avi"

    b.    mencoder "input.dvr-ms" -profile Xvid-Good -o "output.avi"

    c.     mencoder "input.dvr-ms" -profile WMV-Good -o "output.wmv"

    d.    mencoder "input.dvr-ms" -profile MPG-Good -o "output.mpg"

    e.     mencoder "input.dvr-ms" -profile X264-MP3-Good -o "output.avi"

    If you modify the default profiles (or create your own), please make sure you pay attention to the line: “#DtbExtension=avi”.  Babgvant is working on a GUI and integrating Mencoder into Dtb.  If you wish to use his new action then you will need this special line so Dtb knows the file extension.

    3)     Thanks to kingtone and randyharris, we now have a profile for MPG conversion with Mencoder.  One word of warning: For now, this process involves re-encoding the video and audio, so it may not be as fast as other MPG conversion processes.  I’m working on something now that I hope will improve this in the future.

    4)     A change was made to the MPG output FPS to help Item #3 above.  You won’t have to set the –ofps for MPG conversions.

    5)     Slight modifications were made to the fps calculations (trying to improve AV sync a little more).

    6)     Arkay modified the code and gave us a new message level within Mencoder.  The advantage of this new message level is you can now “log” all the encoding messages (and the % complete) from Dtb.  So, when calling Mencoder from Dtb you now have two options.

    a.     “–quiet” – this will suppress the output

    b.    “-msglevel mencoder=6” – this will give enhanced messaging that Dtb can log.

    7)     We now have a whole new way of detecting the audio type.  I learned a few things working on the ffmpeg code, so I took the code we wrote for ffmpeg and back ported it to the MPlayer demuxer.  It should improve the accuracy of the audio detection.

    8)     Thank you to Keystone for providing the information used in the H.264 and MP3 profile.

    9)     Thank you to Hecks for providing the deinterlacing switches used in all the profiles.

    A few notes and status items…

    1)     Kingtone and randyharris, I changed your MPG profile to output MPG using the ffmpeg muxer.  In my testing I had trouble with the MPlayer muxer when there were errors in the video stream.  I looked in the source and the ffmpeg muxer has some error checking.  I tried it on all my test samples that have corruption and it muxed them just fine.  If you see different results please let me know, however, in my limited testing it looks like the ffmpeg muxer is going to work a little better.

    2)     The ffmpeg development continues.  Every day it gets better…  Hopefully we will have a prototype ready in a few weeks.  It’s really nice to see MPG conversion without re-encoding working - as well as h.264 with AAC (finally…).  Now we just have to clean up some AV sync issues we are having and I think we’ll be ready for the first prototype.

  • 04-01-2007 9:40 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Extra big thanks to you Jelwood for pioneering all of this!
  • 04-01-2007 10:59 PM In reply to

    Re: Help testing MEncoder with DVR-MS support

    Indeed! Loving your work jelwood and John :)

     

     

    This new version looks good - I was trying to encode a capture with some corrupt frames with version 6, and it bombed out badly such that I had to use VideoReDo to strip the DVRMS container and encode that.

    After I saw this new version, I had another go at the original dvr-ms, and it worked fine this time.

    Once this one completes, I'll have another look at the file who's audio was incorrectly detected as AC3.

    I really like the profiles, however I'm puzzled why the default vertical res. is 320.. Shouldn't you have a special set of profiles for low res encodes? My preference would be to use as little scale reduction as possible as the default profiles, and have some low res profiles for handheld/portable recordings..

    I'm currently using: -vf pp=md,scale=704:-2:0

     

Page 19 of 24 (359 items) « First ... < Previous 17 18 19 20 21 Next > ... Last »
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems