the original file was 1.avi, so I ran the following commandnow I need the sound from 1.avi to be muxed with the video file 2.265 and this is where I'm stuck. I tried the following commandsCode:ffmpeg -i 1.avi -pix_fmt yuv420p -f yuv4mpegpipe - | x265 --y4m -o 2.265Code:ffmpeg -i 1.avi -vn -c:a libvo_aacenc sound.aacbut no luck. What am I doing wrong? Also, I would rather output the file as an mkv if possible, and last question: do I need to have enough space on my hard drive for the intermediate y4m file which would be very large created by ffmpeg or does the piping process avoid that problem? thanks.Code:ffmpeg -i 2.265 -i sound.aac -map 0 - map 1:a -c copy 2.mp4
This is all much simpler with libx265 but I would rather use the standalone x265.exe from multicoreware for the video encoding. I don't have the internet at home, so that is easier for me to update.
+ Reply to Thread
Results 1 to 6 of 6
-
-
ffmpeg -i 2.265 -i sound.aac -map 0:0 -map 1:0 -c:v copy -c:a copy -bsf:a aac_adtstoasc 2.mp4
or 2.mkv if you want mkv
or use mkvmerge since you want mkv
last question: do I need to have enough space on my hard drive for the intermediate y4m file which would be very large created by ffmpeg or does the piping process avoid that problem? -
One last thing, is there anyway to put everything in one command? Thanks!
I have this so far, which covers the first two parts:
ffmpeg -i 1.avi -vn -c:a libvo_aacenc sound.aac | ffmpeg -i 1.avi -pix_fmt yuv420p -f yuv4mpegpipe - | x265 --y4m -o 2.265 -Last edited by ezcapper; 19th Oct 2014 at 18:34.
-
Not really the way you want to, because you are using x265cli, not libx265 with ffmpeg
When you use x265, you have a physical output , an elementary video stream (ie. it' s not piped) . And obviously x265 doesn't encode audio
So you can do all those operations as a single batch file, which can also delete the temporary .265 elementary stream, but they would technically separate commands -
Thanks! I will definitely look up how to create a batch file. Deleting the temp .265 and .aac streams would be really helpful
edit: got it. Wow, that was really neat, thanks for the help. If someone else is new to this as well, it's done as follows (assuming ffmpeg and x265 are installed in the same parent directory that the DOS prompt opens up to. If not, use cd/Users/ etc etc):
1. Open up notepad.
2. Assuming you want 320kbps audio, in the first line type
ffmpeg -i 1.avi -vn -c:a libvo_aacenc -b:a 320000 sound.aac | ffmpeg -i 1.avi -pix_fmt yuv420p -f yuv4mpegpipe - | x265 --y4m -o 2.265 -
1.avi is my input file, replace that with the name of your input file.
3. Hit enter, then in the 2nd line type
ffmpeg -i 2.265 -i sound.aac -map 0:0 -map 1:0 -c:v copy -c:a copy -bsf:a aac_adtstoasc 2.mp4
2.mp4 is the name of the final output file, replace that how you wish.
4. Hit enter, then in the 3rd line, type
DEL *.265 | DEL *.aac
This will delete all .265 and .aac files in the folder
6. Close and save as a *.bat file (example: myfile.bat)
7. double click on the file and it will encode your original file to a h.265 mp4 file.
To change the input and output files, right click on the bat file and select edit, it will open the file in notepad to change the input file and name of the output file.
In the file, you can add any x265 paramaters after "x265" such as --crf 37 or
--bitrate 1500. The way it is written in step one, it will use the default crf of 28.
The attachment is the bat file I use on my computer.
https://drive.google.com/file/d/0B695hmOChptNamc1Tzg5UHNPUGc/view?usp=sharing
you will have to edit it to make it work for you (drive letter, etc).Last edited by ezcapper; 20th Oct 2014 at 18:14.