VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 42
Thread
  1. Hi guys,

    I have no experience with video as such and English is not my first language, so please bear with me. I am filming sports games with a camcorder (can not remember the brand) and the settings on the camera is preset to prevent the multiple users from messing things up for the next one who use it. The files come in .mts format.

    I have always converted to .wmv and have been happy with it, but now I need to convert to .mp4 since some features in the program I use for analysis are not available unless I use .mp4.

    My problem is the following. I have used a preset recommended by the analysis program in GOM video converter, but I still feel that the output is far from the quality I get from the original .mts files or the files I usually convert to .wmv. It runs smoother most of all, but also I feel that the general quality is better. The output file was around 1,3 gb and since I am looking for the best quality and not really caring about the size of the output file I looked at the preset and tried to improve quality. I cranked up bitrate from 2 to the maximum of 10 and I checked boxes under “Video effects” such as, deblock more, smoothen more and sharpen more. The output file was no nearly 4 gb and I expected great things. Here is the thing. I can not see the difference between the two .mp4 files I have created (with the original preset and my own) if my life depended on it. Maybe the one I created runs a bit smoother, but it is still far from the quality from the original .mts (despite it being substantially more space consuming).

    What can I do to improve quality, or is .mp4 just “worse”? Please help me!
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    I would start with vidcoder. Use the high profile preset. Under Settings->Video can you adjust the constant quality setting, lower it for better quality but bigger file size.

    okey: Try remux first. See Cornucopias reply. I thought you wanted to shrink it first.
    Last edited by Baldrick; 15th Feb 2015 at 13:29.
    Quote Quote  
  3. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    You should not be "converting" at all, if possible. Ever. Most peoples' and apps' interpretation of "conversion" is to re-encode. But you don't necessarily need to re-encode.

    MTS is a container (Mpeg Transport Stream).
    MP4 is a container (Mpeg 4 File format).

    Your upping of the bitrate, noise reducion, etc. is barely offsetting the loss you are incurring from re-encoding. But for those containers (and their most common contents: AVC video streams and AC3 or AAC or MP2 audio streams), ALL you need to do is "change the container". This is known as "re-multiplexing" or re-muxing. A number of apps can remux from MTS to MP4. Doing so will maintain the originals' quality.

    Me, I'd probably use ffmpeg. Here is a batch script that converts all mts files in a directory to mp4:
    Code:
    for %%a in ("*.mts") do ffmpeg -i "%%a" -vcodec copy -acodec copy "%%~na.mp4"
    pause
    Scott

    ...This of course assumes that you are not needing to do any modification of the content...
    Quote Quote  
  4. Thank you very much for your help.

    Which one do I need to download?


    32-bit Downloads


    64-bit Downloads



    Download FFmpeg git-2a72b16 32-bit Static

    Previous FFmpeg 32-bit Static Versions


    Download FFmpeg git-2a72b16 64-bit Static

    Previous FFmpeg 64-bit Static Versions



    Download FFmpeg git-2a72b16 32-bit Shared

    Previous FFmpeg 32-bit Shared Versions


    Download FFmpeg git-2a72b16 64-bit Shared

    Previous FFmpeg 64-bit Shared Versions



    Download FFmpeg git-2a72b16 32-bit Dev

    Previous FFmpeg 32-bit Dev Versions


    Download FFmpeg git-2a72b16 64-bit Dev

    Previous FFmpeg 64-bit Dev Versions



    And can the program merge files or do I have to do that through another program?
    Quote Quote  
  5. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Use the 32bit static version.

    And you can read https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg how to run the batch command. Use Cornucopias batch code.
    Quote Quote  
  6. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Note that certain stream codecs may not be acceptable in all containers. For example, the LPCM audio stream cannot be muxed into the MP4 container by most muxers, so if you have one of those stream types, you need to try other options.

    If in doubt, use MediaInfo to tell you what the contents are.

    Scott
    Quote Quote  
  7. I used the program and it seemed to work!

    But the quality is not exactly the same. The image matches the quality of the original, but the smoothness is not nearly as good. It almost seems laggy. Watching the files back to back makes this very obvious. Any idea why this is?

    Also it did not merge the original files. What do you recomend for doing that without "converting" it?
    Last edited by Miti; 15th Feb 2015 at 14:55.
    Quote Quote  
  8. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Your playback could be choppy because you probably copied AC-3 audio, which is not expected in an MP4 container (they usually use AAC). By "merge," do you mean combine files in sequence into one big file? If so, you can do it with FFmpeg's concat demuxer.
    Quote Quote  
  9. Ok thank you. So how can I do it with the right audio?

    Yes that is exactly what I mean.
    Quote Quote  
  10. Originally Posted by Miti View Post
    I used the program and it seemed to work!

    But the quality is not exactly the same.

    I think .mts is better that .mp4
    Hope this help.
    https://www.youtube.com/watch?v=u0J-ANZlyqM
    https://www.youtube.com/watch?v=ukyTLOybi3I
    Quote Quote  
  11. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Post the full details from your mts. Open in mediainfo, view->text. Or mediainfoxp.
    Quote Quote  
  12. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Originally Posted by DJ_ValBec View Post
    Originally Posted by Miti View Post
    I used the program and it seemed to work!

    But the quality is not exactly the same.

    I think .mts is better that .mp4
    Hope this help.
    https://www.youtube.com/watch?v=u0J-ANZlyqM
    https://www.youtube.com/watch?v=ukyTLOybi3I
    It is not. Containers just contain, they don't determine the quality.

    Still waiting on MediaInfo to determine what needs done next.

    Scott
    Quote Quote  
  13. General
    ID : 0 (0x0)
    Complete name : D:\OB kampe\FFMPEG\Test\00139.MTS
    Format : BDAV
    Format/Info : Blu-ray Video
    File size : 1.98 GiB
    Duration : 53mn 15s
    Overall bit rate mode : Variable
    Overall bit rate : 5 319 Kbps
    Maximum Overall bit rate : 18.0 Mbps

    Video
    ID : 4113 (0x1011)
    Menu ID : 1 (0x1)
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 2 frames
    Format settings, GOP : M=2, N=13
    Codec ID : 27
    Duration : 53mn 15s
    Bit rate mode : Variable
    Bit rate : 4 842 Kbps
    Maximum bit rate : 16.0 Mbps
    Width : 1 440 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Bits/(Pixel*Frame) : 0.125
    Stream size : 1.80 GiB (91%)

    Audio
    ID : 4352 (0x1100)
    Menu ID : 1 (0x1)
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Format settings, Endianness : Big
    Codec ID : 129
    Duration : 53mn 15s
    Bit rate mode : Constant
    Bit rate : 256 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Delay relative to video : -80ms
    Stream size : 97.5 MiB (5%)

    Text
    ID : 4608 (0x1200)
    Menu ID : 1 (0x1)
    Format : PGS
    Codec ID : 144
    Duration : 53mn 15s
    Delay relative to video : -80ms


    I hope this is the info?
    Last edited by Miti; 15th Feb 2015 at 16:26.
    Quote Quote  
  14. Originally Posted by Cornucopia View Post
    Originally Posted by DJ_ValBec View Post
    Originally Posted by Miti View Post
    I used the program and it seemed to work!

    But the quality is not exactly the same.

    I think .mts is better that .mp4
    Hope this help.
    https://www.youtube.com/watch?v=u0J-ANZlyqM
    https://www.youtube.com/watch?v=ukyTLOybi3I
    It is not. Containers just contain, they don't determine the quality.

    Still waiting on MediaInfo to determine what needs done next.

    Scott
    Thx. for the info.
    Quote Quote  
  15. How are you watching it? What software? The smoothness is probably from your program automatically deinterlacing the transport stream, but not the MP4. Set it to "bob" deinterlace or "yadif 2x"
    Quote Quote  
  16. I am watching it in Media Player. The thing is I am making individual clips from the file to each athlete. It has to be "watchable" without to much hassle for them.
    Quote Quote  
  17. Are the athletes going to know what interlace is ? I'm going to avoid stereotyping but I'm going to say probably not

    25 frames per second interlaced is 50 fields per second. That's 50 moments in time per second represented. Each field is like a 1/2 sized frame. If you single rate deinterlace, you only see 25 moments in time per second. Only 1/2 the data is retained. The motion is choppy, not good for sports. If you double rate deinterlace, you see 50 moments in time per second. Much better

    WMP will double rate deinterlace interlaced transport streams automatically , but usually won't do it for other formats (except DV-AVI)

    If your requirement is MP4 container, you should probably deinterlace it. Many programs won't know to deinterlace it. But if you re-encode with a lossy format, you're going to lose quailty . The "best" option is to keep it interlaced and re-wrap it as MP4, and just activate the deinterlacer during playback. No quality loss, and the re-wrapping will be many times faster than re-encoding it. You watch with deinterlacer activated in other programs like VLC. Perhaps you can give instructions to the ahtletes. But what sports analysis program are you using? Can it handle interlaced MP4 ?
    Quote Quote  
  18. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    Then leave them as .mts

    You can trim losslessly with ffmpeg by cutting on I-frames and use stream copy. Save as .ts

    *Edit* If the players are going to watch the clips on their tablets, laptops or phones, then you might as well deintelace and save as mp4. Use Vidcoder, it's easy to use, just make sure to encode audio as aac.
    Last edited by racer-x; 15th Feb 2015 at 17:30.
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  19. Originally Posted by poisondeathray View Post
    Are the athletes going to know what interlace is ? I'm going to avoid stereotyping but I'm going to say probably not

    25 frames per second interlaced is 50 fields per second. That's 50 moments in time per second represented. Each field is like a 1/2 sized frame. If you single rate deinterlace, you only see 25 moments in time per second. Only 1/2 the data is retained. The motion is choppy, not good for sports. If you double rate deinterlace, you see 50 moments in time per second. Much better

    WMP will double rate deinterlace interlaced transport streams automatically , but usually won't do it for other formats (except DV-AVI)

    If your requirement is MP4 container, you should probably deinterlace it. Many programs won't know to deinterlace it. But if you re-encode with a lossy format, you're going to lose quailty . The "best" option is to keep it interlaced and re-wrap it as MP4, and just activate the deinterlacer during playback. No quality loss, and the re-wrapping will be many times faster than re-encoding it. You watch with deinterlacer activated in other programs like VLC. Perhaps you can give instructions to the ahtletes. But what sports analysis program are you using? Can it handle interlaced MP4 ?
    They will NOT know what interlace is for sure.....and I do not know either

    I need it to be MP4 in order for it to work, but whether or not it can handle interlaced MP4 I can not know for sure before trying. I am using Sideline Video Analyzer through XPS Network.

    I have an option to deinterlace in GOM - would you recommend that I try it? Right now the problem seems to be that the testing done with GOM gives lower quality in picture, but is smooth and the testing done with ffmpeg gives a good quality picture, but is laggy.
    Quote Quote  
  20. Originally Posted by Miti View Post

    I need it to be MP4 in order for it to work, but whether or not it can handle interlaced MP4 I can not know for sure before trying. I am using Sideline Video Analyzer through XPS Network.
    Try it out

    I have an option to deinterlace in GOM - would you recommend that I try it? Right now the problem seems to be that the testing done with GOM gives lower quality in picture, but is smooth and the testing done with ffmpeg gives a good quality picture, but is laggy.
    Well you can modify cornucopia's ffmpeg commandline to batch deinterlace and re-encode. It will be much much slower to process than "stream copying" the files, but end result should play smoother in all players if your device/computer can handle it

    I used -crf 16 in this example. Lower values give higher quality / larger filesizes; you can adjust it later until you are happy with the quality. Yadif is used to double rate deinterlace . It's resized to 1920x1080 "square pixels". Try it out on a few short clips first.
    Code:
    
    for %%a in ("*.mts") do ffmpeg -i "%%a" -vf yadif=mode=1:parity=tff -vcodec libx264 -s 1920x1080 -crf 16 -acodec copy "%%~na.mp4"
    
    pause
    Quote Quote  
  21. Well you can modify cornucopia's ffmpeg commandline to batch deinterlace and re-encode. It will be much much slower to process than "stream copying" the files, but end result should play smoother in all players if your device/computer can handle it

    I used -crf 16 in this example. Lower values give higher quality / larger filesizes; you can adjust it later until you are happy with the quality. Yadif is used to double rate deinterlace . It's resized to 1920x1080 "square pixels". Try it out on a few short clips first.
    Code:
    
    for %%a in ("*.mts") do ffmpeg -i "%%a" -vf yadif=mode=1:parity=tff -vcodec libx264 -s 1920x1080 -crf 16 -acodec copy "%%~na.mp4"
    
    pause

    Thank you very much. But I am a total newbie and the clips I have are all relatively large. I do not really care about the size of the outputfile (as long as it is under 10 gb), but more concerned with quality and ability to watch it on different devices without changing settings. Would "-crf 1" then theoretically give me the same quality mp4 as the original mts?
    Quote Quote  
  22. -crf 1 will be several times larger than the original . -crf 0 is lossless compression, but it won't be able to be played by some devices. You probably can't see the difference even around crf 10, unless you go frame by frame and zoom in

    If you need device compatibility, you may need to specify some other target settings. The reason is not all devices are "strong enough" to decode all types of compression and settings. Which typical devices will this be played on ?
    Quote Quote  
  23. Originally Posted by poisondeathray View Post
    -crf 1 will be several times larger than the original . -crf 0 is lossless compression, but it won't be able to be played by some devices. You probably can't see the difference even around crf 10, unless you go frame by frame and zoom in

    If you need device compatibility, you may need to specify some other target settings. The reason is not all devices are "strong enough" to decode all types of compression and settings. Which typical devices will this be played on ?
    I do not know exactly. I share the files through Dropbox, and some see them on their mobile devices while others use their laptops or computers.
    Quote Quote  
  24. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    If compatibility across multiple devices is a concern, I would go with this script instead:
    Code:
    SET PATH="C:\FFMpeg"
    for %%a in ("*.mts") do ffmpeg -i "%%a" -vf yadif=mode=1:parity=tff -s 1280x720 -c:v libx264 -level 41 -pix_fmt yuv420p -preset medium -crf 19 -c:a aac -strict experimental -ar 48000 -ab 256k -f mp4 "%%~na.mp4"
    
    pause
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  25. Originally Posted by racer-x View Post
    If compatibility across multiple devices is a concern, I would go with this script instead:
    Code:
    SET PATH="C:\FFMpeg"
    for %%a in ("*.mts") do ffmpeg -i "%%a" -vf yadif=mode=1:parity=tff -s 1280x720 -c:v libx264 -level 41 -pix_fmt yuv420p -preset medium -crf 19 -c:a aac -strict experimental -ar 48000 -ab 256k -f mp4 "%%~na.mp4"
    
    pause
    Since I am also concerned with quality, would it hurt compatibility if I put -crf 10 instead of 19? The players will not get the entire game, but only small bits so the overall size of the file is no issue.
    Quote Quote  
  26. One problem is some devices cannot handle high bitrates , certain encoding settings . Using a low crf value will result in high bitrates. You usually have to cap the bitrate with --vbv-bufsize and --vbv-maxrate. The settings differ between different target devices

    Some GUI's have presets for various devices e.g. handbrake/vidcoder , xmediarecode etc... It's impossible to give specific advice for such a vague scenario
    Quote Quote  

  27. I used -crf 16 in this example. Lower values give higher quality / larger filesizes; you can adjust it later until you are happy with the quality. Yadif is used to double rate deinterlace . It's resized to 1920x1080 "square pixels". Try it out on a few short clips first.
    Code:
    
    for %%a in ("*.mts") do ffmpeg -i "%%a" -vf yadif=mode=1:parity=tff -vcodec libx264 -s 1920x1080 -crf 16 -acodec copy "%%~na.mp4"
    
    pause

    How long would you expect it to take to run files through this? I am trying it out now and there is a something in the .bat file called "time". If this refers to the point in the video it is currently working at, it takes a very long time (so far 45 min and 4 minutes out of 78). I do not know if the "time" slot in the .bat file is connected to the time in the video or not.
    Quote Quote  
  28. The time is the running time duration in a single video of the batch. (e.g. if it's a 60min video, and it says 45min, then you are 3/4 done of that single video)

    It was mentioned re-encoding would take much longer than re-wrapping. Not only do you incur quality loss, but much slower when you re-encode with a lossy format.

    The speed depends on your computer specifics. Faster computer will convert it faster. If it's too slow for you, you can use a faster encoding preset e.g. -preset:v veryfast . The quality is slightly reduced and compression will be lower. Currently it's at "medium" which is the default. There are slower presets as well

    There are "better", higher quality , slower deinterlacers in avisynth you could use too. But there is a bit of a learning curve
    Quote Quote  
  29. Originally Posted by poisondeathray View Post
    The time is the running time duration in a single video of the batch. (e.g. if it's a 60min video, and it says 45min, then you are 3/4 done of that single video)

    It was mentioned re-encoding would take much longer than re-wrapping. Not only do you incur quality loss, but much slower when you re-encode with a lossy format.

    The speed depends on your computer specifics. Faster computer will convert it faster. If it's too slow for you, you can use a faster encoding preset e.g. -preset:v veryfast . The quality is slightly reduced and compression will be lower. Currently it's at "medium" which is the default. There are slower presets as well

    There are "better", higher quality , slower deinterlacers in avisynth you could use too. But there is a bit of a learning curve
    Ok thank you. Just to make sure - if the original files are about 3 gb, what would you expect the new outputfile to be at with the current settings?
    Quote Quote  
  30. Originally Posted by Miti View Post
    Just to make sure - if the original files are about 3 gb, what would you expect the new outputfile to be at with the current settings?
    Impossible to say

    The only thing you can say for certain, is lower CRF values will yield larger filesizes

    When you use crf encoding, it's 1 pass "quality" based, and the bitrate will depend on content complexity

    Usually, if you have complex content (difficult to compress), eg. lots of motion, lots of noise, filesizes will be larger
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!