VideoHelp Forum
+ Reply to Thread
Page 2 of 3
FirstFirst 1 2 3 LastLast
Results 31 to 60 of 63
Thread
  1. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    The files seem to play fine so no big deal. Thanks.
    Quote Quote  
  2. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Sneaker I have another challenge. How do I compress the file size of an mkv converting to mp4? This is very strange, but I have an mkv file around 9GB that I am using vidcoder to convert to mp4 at a target size of 2900MB. The MKV is 1920x800 and has great playback but when I encode to mp4 the picture is very choppy/pixelated. I tried many different settings and used handbrake with no luck but I dropped the mkv onto the bat file and the mp4 played great so I'm wanting to do this but don't want a 9GB file but instead one around 2900MB.
    Quote Quote  
  3. That's a very old version of FFMPEG.
    Quote Quote  
  4. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Not following you by "That's a very old version of FFMPEG"
    Quote Quote  
  5. He is responding that ffmpeg log, that you used 2013 ffmpeg version.

    Make sure vidcoder does not change frame rate and also check 2pass encoding if targeting volume. Do not use 1pass ABR.

    Or simply calculated bitrate to squeeze video more than 2x is not enough for that video, pixelating is a typical "symptom" for that.
    Quote Quote  
  6. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I hear you but I have been using the same settings for hundreds of mkv's I've encoded to mp4 and not only has the picture been fine but the video and audio quality playing on my 50" Panasonic Plasma going through my Yamaha receiver has been stunning in my opinion. I have tweaked the vidcoder advanced settings for high quality. Sure as hell taxes my processor.
    Quote Quote  
  7. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I have a dilemma that I just noticed with the mp4 files remuxed with the second audio. When I play the file through my Apple TV 3 which is connected to my Yamaha receiver, the audio that is being played is the 2 channel pro logic audio instead of the 6 channel ac3 audio. This only happens with the files that I add the 2nd audio with by remuxing them. In regards to the mp4 files encoded with Handbrake that originate from mkv files, I never have any issues with my Yamaha receiver sensing and playing the 6 channel ac3. Does anyone know why this is happening and what I can do to fix it?
    Quote Quote  
  8. Can you not switch audio tracks in the Apple TV? Can you show MediaInfo of both types of files (those that Apple TV chooses 2ch and those that it chooses 6ch with)?

    Differences I could think of:
    - different track order
    - disabled flag
    - different "Alternate Group" flags
    Quote Quote  
  9. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    The audio settings in the ATV are set to Dolby Digital as on which means as long as an mp4 has ac3 audio in it, my Yamaha detects and plays it. I have uploaded two files (mediainfo). Pretty Pink is the one that doesn't play ac3 that was remuxed with ffmpeg and Tears was Handbrake encoded.
    Image Attached Files
    Quote Quote  
  10. HandBrake creates "tref" box. While support within ffmpeg does seem to exist I don't know if it's possible to call via CLI.
    Quote Quote  
  11. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I have no idea what your last reply meant. That's beyond my understanding of all this. Please explain.
    Quote Quote  
  12. I don't know if there is an ffmpeg command that can replicate what HandBrake is doing.
    Quote Quote  
  13. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Ok, so that means the only way to add a second audio to the first ac3 is to re-encode it?
    Quote Quote  
  14. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I found a solution for this problem finally after looking on the web for solutions. Here is the process: First I load the .mp4 file in vidcoder and re-encode so I have a second audio (usually AAC from the ac3 5.1) and set very low quality settings to encode with so it only takes between 8-10 minutes. I then use My MP4Box GUI to demux the ac3 and aac files and the video from the original .mp4 file. I then use My MP4Box GUI to mux the video and two audio files together to make the final .mp4 file. Here is the trick: Under options you have to check Apple Friendly and Apple Friendly v2 before you mux the final .mp4. This seems to enable the Apple TV to recognize the ac3 audio and now I get Dolby Digital surround through my Yamaha receivcer. Without these options checked I have the same problem of the aac audio playing.
    Quote Quote  
  15. It doesn't seem to set tref/fall so maybe there is hope after all. MyMP4BOX GUI is just a calling mp4box so we could add it to the ffmpeg batch. Try (drag&drop files on it):
    Code:
    @ECHO OFF
    PUSHD %~dp0
    if [%1]==[] goto :eof
    :loop
    ffmpeg -y -i %1 -map 0:a -vn -sn -c:a aac -ac 2 "%~dpn1.aac"
    mp4box -ipod -add "%~1#video:name=video" -add "%~1#audio:group=1:name=AC3" -add "%~dpn1.aac:group=1:disabled:name=AAC" -new "%~dp1new_%~n1.mp4"
    shift
    if not [%1]==[] goto loop
    pause
    Quote Quote  
  16. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    That script did work. It created and saved a separate aac file that I then demuxed an muxed with mp4box. The bitrate for the aac created is 132 kb/s. How can I get it to make an aac 160 kb/s?
    Quote Quote  
  17. Add -b:a 160k (I also added a line to auto-delete the .aac):
    Code:
    @ECHO OFF
    PUSHD %~dp0
    if [%1]==[] goto :eof
    :loop
    ffmpeg -y -i %1 -map 0:a -vn -sn -c:a aac -b:a 160k -ac 2 "%~dpn1.aac"
    mp4box -ipod -add "%~1#video:name=video" -add "%~1#audio:group=1:name=AC3" -add "%~dpn1.aac:group=1:disabled:name=AAC" -new "%~dp1new_%~n1.mp4"
    del "%~dpn1.aac"
    shift
    if not [%1]==[] goto loop
    pause
    Originally Posted by maverickluke View Post
    that I then demuxed an muxed with mp4box.
    You don't mean manually, do you? The script should do all that automatically.
    Quote Quote  
  18. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    The script did not demux and mux a new mp4. The only thing it did was create a separate AAC file.
    Quote Quote  
  19. Do you have mp4box.exe (and required .dll files) at the location of the .bat (or in %PATH%)?
    Quote Quote  
  20. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I didn't have mp4box and the .dll files in the same location. Do all the files have to be in the same folder as the bat or can I put them in a folder that is in the folder of the .bat? The reason is because there are a lot of files.
    Quote Quote  
  21. If you put them in a different folder you either have to put that into %PATH% or adapt the script. E.g. for a subfolder "mp4box-folder":
    Code:
    @ECHO OFF
    PUSHD %~dp0
    if [%1]==[] goto :eof
    :loop
    ffmpeg -y -i %1 -map 0:a -vn -sn -c:a aac -b:a 160k -ac 2 "%~dpn1.aac"
    mp4box-folder\mp4box -ipod -add "%~1#video:name=video" -add "%~1#audio:group=1:name=AC3" -add "%~dpn1.aac:group=1:disabled:name=AAC" -new "%~dp1new_%~n1.mp4"
    del "%~dpn1.aac"
    shift
    if not [%1]==[] goto loop
    pause
    You can also use absolute paths. (Google "absolute paths", "relative paths" and "%PATH%" for more info)
    Quote Quote  
  22. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I put everything from the gpac folder into the folder with the bat file, dropped a video file on the bat and nothing.....no AAC file anymore and no new mp4. This is too complicated for me. I don't have the time to google paths and figure all that stuff out. This script is not working with all the mp4box files in the folder anyway.
    Quote Quote  
  23. Not sure what to tell you. It's working fine here. Copy&paste any error messages/log here.
    Quote Quote  
  24. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I will try it again but I am not seeing a log that is being created. Does your latest script have the command for a log?
    Quote Quote  
  25. No. Can't you read or at least copy&paste what you see in the terminal window?

    Anyways, this should create two log files:
    Code:
    @ECHO OFF
    PUSHD %~dp0
    if [%1]==[] goto :eof
    :loop
    ffmpeg -y -i %1 -map 0:a -vn -sn -c:a aac -b:a 160k -ac 2 "%~dpn1.aac"
    mp4box -lf "%~nx1.log1.txt" -logs all@debug -ipod -add "%~1#video:name=video" -add "%~1#audio:group=1:name=AC3" -add "%~dpn1.aac:group=1:disabled:name=AAC" -new "%~dp1new_%~n1.mp4" > "%~nx1.log2.txt" 2>&1
    del "%~dpn1.aac"
    shift
    if not [%1]==[] goto loop
    pause
    Quote Quote  
  26. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Didn't work again. Here are the log files.
    Image Attached Files
    Quote Quote  
  27. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Tried it again. Updated logs.
    Image Attached Files
    Quote Quote  
  28. Are you using latest mp4box? Looks like mp4 file is corrupted/invalid or mp4box bug. mp4box can't read mkv. But hopefully it is just this one file and will work for others.

    But then the question would be: why would MyMP4BOX GUI work on the same file (does it?)? It is just a GUI. If you believe the file is not invalid you should report to mp4box developers.

    Last resort would be remux to mp4 first but I cannot guarantee it will work:
    Code:
    @ECHO OFF
    PUSHD %~dp0
    if [%1]==[] goto :eof
    :loop
    ffmpeg -y -i %1 -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:v copy -c:a:0 copy -c:a:1 aac -b:a:1 160k -ac:a:1 2 "%~dpn1_temp.mp4"
    mp4box-folder\mp4box -ipod -add "%~dpn1_temp.mp4#1:name=video" -add "%~dpn1_temp.mp4#2:group=1:name=AC3" -add "%~dpn1_temp.mp4#3:group=1:name=AAC" -new "%~dp1new_%~n1.mp4"
    del "%~dpn1_temp.mp4"
    shift
    if not [%1]==[] goto loop
    pause
    Quote Quote  
  29. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Not sure why. Besides doing things in one step is there any benefit to using this script as opposed to doing this the way I described above? Occasionally, when I mux the new .mp4 the audio and video are out of sync even though in the original file they are not. In that case I use Vidcoder to add the AAC audio and no problem.
    Quote Quote  
  30. Sync should always be preserved with the script of post #58.

    If you want to continue using your manual method but with keeping sync try (will only create .aac, nothing else):
    Code:
    @ECHO OFF
    PUSHD %~dp0
    if [%1]==[] goto :eof
    :loop
    ffmpeg -y -i %1 -map 0:a:0 -af aresample=async=1 -c:a aac -b:a 160k -ac 2 "%~dpn1.aac"
    shift
    if not [%1]==[] goto loop
    pause
    Originally Posted by maverickluke View Post
    Besides doing things in one step is there any benefit to using this script as opposed to doing this the way I described above?
    No. (except maybe sync with scripts of #58 + #60)


    One last thing:
    If MyMp4boxGUI works but manual does not you could look if the command it uses is different or just the mp4box version. Then adapt the script or switch the versions.
    Quote Quote  



Similar Threads

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