0

I am using a karaoke authoring program (karafun) that lets me select the resolution and FPS but it outputs the video as raw and the audio as IMA ADPCM and places it in an AVI container.

PS C:\bin> .\ffprobe.exe -i '.\JEZ-092 - Megan - Thot.avi'
[avi @ 0000026820d002c0] non-interleaved AVI
Input #0, avi, from '.\JEZ-092 - Megan - Thot.avi':
  Duration: 00:03:10.30, start: 0.000000, bitrate: 885289 kb/s
  Stream #0:0: Video: rawvideo, bgr24, 1280x720, 884852 kb/s, 40 fps, 40 tbr, 40 tbn
  Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 44100 Hz, 2 channels, s16p, 352 kb/s

I would like to upload this content to youtube maintaining the current resolution and FPS. What is the full ffmpeg command line that will encode the video as h.264 and the audio as mp3 and then place it in an mp4 container? In your response, for the input path you can just type INPUT_FILE. You don't have to use my file name.

Thank you

2 Answers 2

0

YouTube doesn't really care what you give it, so recommendation is to provide the highest quality that isn't too big or annoying to upload.

What you asked for

H.264 + MP3 in MP4:

ffmpeg -i input.avi -c:v libx264 -crf 18 -preset slow -c:a libmp3lame -q:a 2 output.mp4
  • Your local player/device/browser won't like the file but YouTube will, and the YouTube version will work on anything. If you want it to work in everything add -vf format=yuv420p.

  • If it's too slow to encode use a faster -preset.

  • See FFmpeg Wiki: H.264 and FFmpeg Wiki: MP3.

What I would do

HEVC + Opus in Matroska:

ffmpeg -i input.avi -c:v libx265 -crf 22 -preset slow -c:a libopus -b:a 192k output.mkv
  • libx265 (or libx264rgb) instead of libx264 to preserve the RGB colorspace of your input and make YouTube deal with the RGB to YUV colorspace conversion (they might use something different for the colorspace conversion so it might look better, but I never bothered to compare).
  • If libx265 is too slow use a faster -preset or use libx264rgb or libx264 instead.
  • Opus instead of MP3 because it is more efficient. Or use -c:a flac if you want lossless compression, but file will be bigger.
  • See FFmpeg Wiki: HEVC and Hydrogen Audio: Opus.
0

Step 1: Get Video from AVI and transcode to video.h264

ffmpeg -i input.avi -c:v libx264 -crf 1  -b:v 884852k -maxrate  884852K -bufsize 8M   -movflags -faststart  -preset veryfast -an only_video.mp4

Step 2: Get Audio from AVI and convert into mp3 file

 ffmpeg -i input.avi -vn only_audio.mp3

Step 3: Video And Audio in MP4 FILE

ffmpeg -i only_video.mp4 -c:a mp3 -i only_audio.flac  -c copy -map 0:v -map 1:a:0  -strict -2 -sn -dn -map_metadata -1 -map_chapters -1  -movflags faststart final_file.mp4  

Note: YouTube will to encode your video to their standards, so, if you upload final_file.mp4 or '.\JEZ-092 - Megan - Thot.avi' directly, will be the same.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .