VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 34
  1. Please forgive me if I am asking a question that has been asked so many times before.

    I needed to convert a .mts file from a camcorder to a .mp4 so that it would be easier for people to play when viewing from my cloud server.

    I have not done this for many years, so I just downloaded the last version of mkvtomp4 used all default settings except setting it to mp4 and did the re-wrap.
    To my surprise I saw that it changed the bit rate of my audio from 256 to 185 khz and it changed the frame rate of my video from 30 to 60 fps.

    Can anyone tell me how to set mkvtomp4 so that nothing changes that does not need to change ?

    If not, can someone recommend a different free program to re-wrap .mts files to .mp4 that will change nothing that does not need to be changed ?

    TIA
    Quote Quote  
  2. I thought, based on reading other posts, that Handbrake always re-encodes ?
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by NewTwoVideo View Post
    I thought, based on reading other posts, that Handbrake always re-encodes ?
    Handbrake does. Try MKVtoolnix GUI to re-wrap to an mkv
    Quote Quote  
  4. I am trying to re-wrap to .mp4.
    I do not see any option for .mp4 in the MKVtoolnix program.

    I found an AAC quality option setting in mkvtomp4 that I can bump up to change the Audio Bitrate, but I am still mystified about the Video frame rate change.
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Perhaps Avidemux? I can do a "copy" of video and audio to the mp4 format (assuming it's compatible)

    It might help others to answer your question if your provide a MediaInfo report (text view) of your source file
    https://www.videohelp.com/software/MediaInfo
    Quote Quote  
  6. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    +1


    My understanding is that .mts is the AVCHD container format.


    You will read of tons of programs that will 'convert' from mts to mp4 but a simple, and free, program might do it.


    Failing that a simple ffmpeg line should do it or try one of the gui's


    If you have a short, original, clip you can also upload it here as an attachment and we can also try software.
    Quote Quote  
  7. Here is the MediaInfo of the source .mts file and the re-wrapped .mp4 file.

    I think that I am just not setting something correctly.
    Image Attached Thumbnails Click image for larger version

Name:	Source.jpg
Views:	79
Size:	223.9 KB
ID:	60281  

    Click image for larger version

Name:	rewrapped_file.jpg
Views:	39
Size:	226.7 KB
ID:	60282  

    Quote Quote  
  8. Post a mediainfo report of your mts file here.
    Maybe the codecs are mp4 compatible, so a simple remux should solve the case.
    Quote Quote  
  9. Use clever Ffmpeg-GUI. Load your mts, click main, click multiplex, deselect the sultitle stream, click target file and accept the proposed filename, set mp4 as container, click multiplex. Done.
    Quote Quote  
  10. Thank you.
    I will give it a try.
    Quote Quote  
  11. Try
    Code:
    ffmpeg.exe -i "your.mts" -c:v copy -c:a copy "your.mp4"
    Quote Quote  
  12. Image
    [Attachment 60283 - Click to enlarge]


    Sorry, Bob is not my uncle.

    See jpeg.

    The frame rate is just the same as with mkvtomp4 so that oddity/problem still exists.
    Also, it did not convert the audio to AAC so there is no sound.
    Quote Quote  
  13. Originally Posted by Sharc View Post
    Try
    Code:
    ffmpeg.exe -i "your.mts" -c:v copy -c:a copy "your.mp4"
    No apparent file generated.
    Quote Quote  
  14. Originally Posted by NewTwoVideo View Post
    Originally Posted by Sharc View Post
    Try
    Code:
    ffmpeg.exe -i "your.mts" -c:v copy -c:a copy "your.mp4"
    No apparent file generated.
    You have to replace "your.mts" with the path to your source file.
    Save the code below as a text file and name it rewrap.cmd or rewrap.bat
    Code:
    ffmpeg.exe -i "your.mts" -c:v copy -c:a copy "your.mp4"
    pause
    Now double-click on the file to run it. Do you get error messages in the console output?

    Or upload a short sample of your source.
    Last edited by Sharc; 11th Aug 2021 at 16:41.
    Quote Quote  
  15. Image
    [Attachment 60284 - Click to enlarge]


    It is the same result as the gui ffmpeg.

    Later tonight I will shoot a few seconds of a blank wall with the camcorder and then upload the mts file.
    Quote Quote  
  16. Originally Posted by NewTwoVideo View Post
    Image
    [Attachment 60284 - Click to enlarge]


    It is the same result as the gui ffmpeg.

    Later tonight I will shoot a few seconds of a blank wall with the camcorder and then upload the mts file.
    Shoot a scene with a structure in the picture and movement, or a camara panning so we can se whether the source is interlaced or not. Static blank wall pictures are not helpful.
    Quote Quote  
  17. If you put MediaInfo in Text mode you'll see that your mts video is field sequential. It's very common for programs to double the frame rate when remuxing. I think you just need to force the frame rate to 29.97 when you remux. I don't have such a file for testing but try adding -r 29.97 to the ffmpeg command line. I think one of these will work:

    Code:
    ffmpeg.exe -r 29.97 -i "your.mts" -c:v copy -c:a copy "your.mp4"
    Code:
    ffmpeg.exe -i "your.mts" -r 29.97 -c:v copy -c:a copy "your.mp4"
    Quote Quote  
  18. Source is definitely interlaced.

    I will try the revised command line later tonight.

    But how would I get it to convert ac3 to aac ?
    Quote Quote  
  19. Originally Posted by NewTwoVideo View Post
    But how would I get it to convert ac3 to aac ?
    Change "-c:a copy" to "-c:a aac". Some builds include a better(?) aac encoder. Use "ffmpeg -codecs" to get a list of supported codecs for the version you're using.
    Quote Quote  
  20. Originally Posted by jagabo View Post
    Originally Posted by NewTwoVideo View Post
    But how would I get it to convert ac3 to aac ?
    Change "-c:a copy" to "-c:a aac". Some builds include a better(?) aac encoder. Use "ffmpeg -codecs" to get a list of supported codecs for the version you're using.
    I tried the changes both with -r 29.97 and also with -r 30000/1001
    Neither one made any change in the reported frame rate.
    Here are the text versions of MediaInfo...
    Image Attached Thumbnails Click image for larger version

Name:	ffmpeg_Command_Line_Force_Attempt_29-97.jpg
Views:	31
Size:	263.3 KB
ID:	60285  

    Click image for larger version

Name:	ffmpeg_Command_Line_Force_Attempt_30000-1001.jpg
Views:	24
Size:	256.5 KB
ID:	60286  

    Quote Quote  
  21. Here is an original .mts recorded at 60 interlaced like the one I have been trying to re-wrap.
    Image Attached Thumbnails Click image for larger version

Name:	60_Interlaced_00052-MTS.jpg
Views:	24
Size:	258.7 KB
ID:	60288  

    Image Attached Files
    Quote Quote  
  22. Here is an mts recorded at 60 progressive for comparison.
    Image Attached Thumbnails Click image for larger version

Name:	60_Progressive_00054-MTS.jpg
Views:	45
Size:	250.3 KB
ID:	60290  

    Image Attached Files
    Quote Quote  
  23. I have a batch file in my SendTo folder so I can right click on any video and select Send To -> RemuxToMp4.bat for a quick remux:

    Code:
    ffmpeg -fflags +genpts -i "%~1" -vcodec copy -acodec copy  -movflags faststart "%~dpn1.mp4"
    The MP4 video made from your MTS file played at the correct speed in Windows Media Player, Windows Movies and TV, MPCHC, VLC, PotPlayer, KMPlayer, and SMPlayer. "-movflags faststart" shouldn't make any difference but maybe the "+fflags +genpts" was the key. Remuxed video attached.

    By the way, shooting a clock with a moving second hand was a good choice!
    Image Attached Files
    Quote Quote  
  24. Originally Posted by jagabo View Post
    I have a batch file in my SendTo folder so I can right click on any video and select Send To -> RemuxToMp4.bat for a quick remux:

    Code:
    ffmpeg -fflags +genpts -i "%~1" -vcodec copy -acodec copy  -movflags faststart "%~dpn1.mp4"
    The MP4 video made from your MTS file played at the correct speed in Windows Media Player, Windows Movies and TV, MPCHC, VLC, PotPlayer, KMPlayer, and SMPlayer. "-movflags faststart" shouldn't make any difference but maybe the "+fflags +genpts" was the key. Remuxed video attached.

    By the way, shooting a clock with a moving second hand was a good choice!
    Thank you for your efforts on my behalf and for the compliment. Some days my brain works good.

    Please see attached jpg of the text output of MediaInfo when I run it on the mp4 you posted.
    The problem / odditity still shows up.

    If when you examine the mp4 file on your computer, you see the correct framerate, then I am thinking that maybe MediaInfo is doing something non-standard on my PC.
    If that is the case can you recommend a similar freeware program for me to try to use to examine the files.
    Image Attached Thumbnails Click image for larger version

Name:	MediaInfo_On_52-mp4_you_posted.jpg
Views:	38
Size:	298.6 KB
ID:	60293  

    Quote Quote  
  25. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    If when you examine the mp4 file on your computer, you see the correct framerate, then I am thinking that maybe MediaInfo is doing something non-standard on my PC.
    If that is the case can you recommend a similar freeware program for me to try to use to examine the files.
    I'm interested in that too. I did a "intelligent" convert of that MTS with VideoRedo and now Mediainfo is showing it as BFF, when it looks like TFF in Virtual Dub.
    Quote Quote  
  26. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    This seems to point to a bug/feature/interpretation in the ffmpeg mp4 muxer and its exposure in Mediainfo.
    https://video.stackexchange.com/questions/12156/how-can-i-convert-mts-file-avchd-to-mp...-v/17194#17194

    Perhaps that is what is going on here.


    Scott
    Quote Quote  
  27. Even the simple commandline of post #12 produces an interlaced TFF output which plays correctly at 29.97fps here (using MPC-HC), and it plays correctly when I stream it to my TV, whereas vdub2 plays it at 59.94fps. DGIndexNV reports the framerate as 29.97fps.
    And yes, Media Info reports the frame rate as 59.94fps and the Original framerate as 29.97fps. Probably container vs stream framerate.
    I don't know whether one can live with this or whether it causes issues with certain players .....
    Last edited by Sharc; 12th Aug 2021 at 02:13.
    Quote Quote  
  28. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Not sure if this was also done but I did a stream copy of the video and audio with avidemux.


    Result was a 19.5 mb video. Mediainfo actually reports a variable frame rate of 12 - 59.94


    Clock appears to be running normally
    Quote Quote  
  29. Originally Posted by NewTwoVideo View Post
    Please see attached jpg of the text output of MediaInfo when I run it on the mp4 you posted.
    The problem / odditity still shows up.
    Yes, I see the same thing in MediaInfo. And some editors have a problem with it too. My rudimentary understanding is that with "separated fields" interlaced video in MP4 the frame rate flag is supposed to be set to the field rate -- and that is what ffmpeg is doing. The editors (like VirtualDub2) are probably at fault here. Players probably deal with this correctly because they use the timestamps embedded with each frame in the video stream, not the frame rate in the header.
    Quote Quote  



Similar Threads

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