VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member
    Join Date
    Dec 2012
    Location
    Australia
    Search Comp PM
    Hi
    Just joined to ask a question regarding some video encoding I'm currently doing. I've been using x264 to encode music videos from TV, previously using the --preset veryslow setting. Recently I decided to change to either medium or slow, however playback of those files seems a bit choppy and jerky. I've researched different settings (bitrates, --tune fastdecode option, hardware decoding) but it never seemed to get any better. While playing with the hardware decoding options of the LAV codec, I noticed that the active decoder was always displaying inactive, so I tried some different things to to make it actually change that status. One of the things I tried was changing the file extension, which is where I'm looking for some input.

    Here's the media info from one of the files I've encoded, using --preset medium --crf 25 --tff and a crop filter.
    Code:
    General
    Complete name                            : Q:\Music Videos\NewClips\VideoClips\MusicVideos\Aaliyah - Try Again.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 35.7 MiB
    Duration                                 : 3mn 39s
    Overall bit rate                         : 1 366 Kbps
    Writing application                      : Lavf54.37.100
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L3.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 3mn 39s
    Bit rate                                 : 1 175 Kbps
    Width                                    : 512 pixels
    Height                                   : 560 pixels
    Display aspect ratio                     : 4:3
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : MBAFF
    Bits/(Pixel*Frame)                       : 0.164
    Stream size                              : 30.7 MiB (86%)
    Writing library                          : x264 core 128 r2216 198a7ea
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=tff / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    
    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 3mn 39s
    Bit rate mode                            : Constant
    Bit rate                                 : 187 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 4.87 MiB (14%)
    
    Menu
    This video plays mostly ok, but the motion isn't smooth. It seems to stutter a bit in panning shots and doesn't look fluid. Audio plays without any problem and CPU usage during playback is very low.

    However, if I do nothing more than change the file extension from .mp4 to .mpg, the video plays fine. Picture and audio quality are exactly the same as far as I can tell, but the motion is smooth and fluid. I'm not sure I understand why just changing that would make a difference. I suspect that the different extension is triggering a different codec for playback (currently I'm using Shark007 V3.9.3), but I would have thought that the decoder would be selected based on the internal reference on the video stream, rather than the file extension.

    I use x264 to produce the video file, and NeroAACEnc for the audio, then FFMpeg to mux them into an MP4 file (using -vcodec copy -acodec copy). Changing this to MPG (or Mpeg) produces files that don't play, as I found that the mpeg container can't contain avc video. Using WMP for playback, and I'm not interested in using an alternative player as that wouldn't suit my needs

    Is my best option to make the files as I've been doing and rename them?
    Could I use a better container format for the final files (mkv)?
    Is this a case where the PC is struggling to decode the files?
    Are there other encoder options I can use to make playback better (using --tune fastdecode implements --no-cabac --no-deblocking --no-weightb --weightp 0)
    Are there better decoders available that will do a better job?
    Any other thoughts?

    Simon
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    You can try disable the WMP built in decoder for mp4 / h264 first. Use preferred filter tweaker.

    And this must be a software player issue. How does the mp4 work in VLC (it has built in decoders)? Just to compare with WMP.
    Quote Quote  
  3. Member
    Join Date
    Mar 2011
    Location
    Nova Scotia, Canada
    Search Comp PM
    I totally agree with baldrick ... well, he's pretty reliable ... another player would definitely "suit your needs". I'd install both vlc and smplayer. I use the latter for my default video player. If I can't play a file with either of those there's probably something wrong with it.

    While I'm not anti Microsoft per se like a lot of linux users, their media software is awful. The only times I've used wmp in years is by accident, in a new install where I forgot to change the file association.

    Also, my policy with Nero for years is that nothing with that name is going anywhere near my hard drive.
    Quote Quote  
  4. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    Why do people make things so difficult? What's wrong with something simple like WinFF and it's presets?
    Click image for larger version

Name:	winff.jpg
Views:	1216
Size:	42.3 KB
ID:	15416
    Quote Quote  
  5. Originally Posted by Hoser Rob View Post
    Also, my policy with Nero for years is that nothing with that name is going anywhere near my hard drive.
    You can use NeroAACEnc , no problem with that.
    Quote Quote  
  6. Banned
    Join Date
    Oct 2004
    Location
    Freedonia
    Search Comp PM
    Originally Posted by _Al_ View Post
    Originally Posted by Hoser Rob View Post
    Also, my policy with Nero for years is that nothing with that name is going anywhere near my hard drive.
    You can use NeroAACEnc , no problem with that.
    Yes. There are some other things Nero is fine for too.
    1) Burning data discs.
    2) Burning audio CDs.
    3) Making hybrid discs like VCD/Audio CD hybrids or VCD/data CD hybrids.
    Quote Quote  
  7. Member
    Join Date
    Dec 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by Baldrick View Post
    You can try disable the WMP built in decoder for mp4 / h264 first. Use preferred filter tweaker.

    And this must be a software player issue. How does the mp4 work in VLC (it has built in decoders)? Just to compare with WMP.
    Thanks I'll give the tweak tool a go, and failing that will install VLC to see how it performs there

    Originally Posted by Hoser Rob
    I totally agree with baldrick ... well, he's pretty reliable ... another player would definitely "suit your needs".
    I have two problems. Firstly, I do a bit of personal software programming and use the media controls provided in Microsoft Visual Studio, so I do need them to play with the standard Microsoft controls. Secondly, the reality is I'm not actually a very good programmer (more of a hack job ), so even if another player can be implemented into my project, I'm not sure I'd have the skills to get it working.

    Originally Posted by Hoser Rob
    Also, my policy with Nero for years is that nothing with that name is going anywhere near my hard drive.
    In that case, what do you recommend for audio? A different AAC encoder or something different completely?
    Quote Quote  
  8. Member
    Join Date
    Dec 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by hech54 View Post
    Why do people make things so difficult? What's wrong with something simple like (quoted picture removed) and it's presets?
    Image
    [Attachment 15416 - Click to enlarge]
    I use FFMpeg in a batch file as I generally convert upwards of 10 files at a time (often more). When I was using the original veryslow setting, each music video would take around 30 mins to process on my old hardware, so I needed it to run unattended overnight.

    I might also try specifying the output of ffmpeg using -f mp4 and using mpg in the file name. That might work too.
    Quote Quote  
  9. Banned
    Join Date
    Nov 2005
    Location
    United States
    Search Comp PM
    am i the only one that finds it odd that media info reports the resolution as 512x560 with a DAR of 4:3?
    Quote Quote  
  10. Member
    Join Date
    Dec 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by deadrats View Post
    am i the only one that finds it odd that media info reports the resolution as 512x560 with a DAR of 4:3?
    This is the media info for the source file, which is a recording from a digital broadcast and the individual clip extracted using VideoRedo Plus using default settings (I think, haven't looked at settings for VideoRedo for a long time so I'm not sure if I changed any)

    Code:
    General
    Complete name                            : Q:\Music Videos\NewClips\VideoClips\MPEG Store\Aaliyah - Try Again.mpg
    Format                                   : MPEG-PS
    File size                                : 134 MiB
    Duration                                 : 3mn 39s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 5 131 Kbps
    
    Video
    ID                                       : 224 (0xE0)
    Format                                   : MPEG Video
    Format version                           : Version 2
    Format profile                           : Main@Main
    Format settings, BVOP                    : Yes
    Format settings, Matrix                  : Custom
    Format settings, GOP                     : Variable
    Duration                                 : 3mn 39s
    Bit rate mode                            : Variable
    Bit rate                                 : 4 773 Kbps
    Maximum bit rate                         : 10 000 Kbps
    Width                                    : 720 pixels
    Height                                   : 576 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 25.000 fps
    Standard                                 : PAL
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Interlaced
    Scan order                               : Top Field First
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.460
    Stream size                              : 125 MiB (93%)
    
    Audio
    ID                                       : 192 (0xC0)
    Format                                   : MPEG Audio
    Format version                           : Version 1
    Format profile                           : Layer 2
    Duration                                 : 3mn 38s
    Bit rate mode                            : Constant
    Bit rate                                 : 256 Kbps
    Channel(s)                               : 2 channels
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 6.68 MiB (5%)
    I use the crop filter of x264 to crop out any black letterbox regions, or remove yukky bits from the older 80's videos, which accounts for the change in frame size. I don't specify anything regarding DAR though. Should I be doing something about that? All the clips I've done display at the correct aspect ration when viewed on the monitor or on an extended display to a flat panel.
    Quote Quote  
  11. Originally Posted by strudo76 View Post
    as I found that the mpeg container can't contain avc video.
    mpeg2-program stream? Yes it can contain AVC video

    whether or not WMP has the splitters and filters to play it is another story...



    This video plays mostly ok, but the motion isn't smooth. It seems to stutter a bit in panning shots and doesn't look fluid. Audio plays without any problem and CPU usage during playback is very low.

    However, if I do nothing more than change the file extension from .mp4 to .mpg, the video plays fine. Picture and audio quality are exactly the same as far as I can tell, but the motion is smooth and fluid. I'm not sure I understand why just changing that would make a difference. I suspect that the different extension is triggering a different codec for playback (currently I'm using Shark007 V3.9.3), but I would have thought that the decoder would be selected based on the internal reference on the video stream, rather than the file extension.
    I'm guessing renaming the extension to .mpg in your case enables automatic deinterlacing in WMP
    Quote Quote  
  12. Member
    Join Date
    Dec 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by strudo76 View Post
    as I found that the mpeg container can't contain avc video.
    mpeg2-program stream? Yes it can contain AVC video
    I was going by the wiki container comparison page that says no for mpeg video files, but does say it can be contained in a PS. I don't really understand the difference between and mpeg video file, a program stream or a transport stream, so I guess that's where I got it wrong.

    Originally Posted by poisondeathray View Post
    I'm guessing renaming the extension to .mpg in your case enables automatic deinterlacing in WMP
    I've done some playing with the tweak tool. At first I didn't see any improvement when changing the preferred codec for H.264 or MP4V, regardless of which setting I tried. Under MS Codec Tweaks, it said that Media Foundation was disabled (32 & 64 bits), however selecting the option to disable Media Foundation for .mp4 in the Media Foundation options fixed the problem (and also displayed the LAV system tray icons while playing, something that was not happening before for the mp4 files)

    As some further research, I uninstalled the Shark007 codec pack completely. Now the mp4 file still plays the same as it was before (badly), and the mpg file doesn't play at all. (edit: this is when mp4 files are still set to use the WMF)

    So I guess that the mp4 uses the Media Foundation unless explicitly told not to, and mpg files do not use the Media Foundation at all. By changing the extension to mpg it was using the LAV codec when available.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!