h264 MP4

Questions and answers on how to get the most out of FFAStrans
admin
Site Admin
Posts: 1658
Joined: Sat Feb 08, 2014 10:39 pm

Re: h264 MP4

Post by admin »

Ok, let's see if I get this straight:

You have created one video file without audio:
X:\some_path\your_file.m4v
You have created one audio file without video:
X:\some_path\your_file.m4a

Both within the same workflow. Is this correct? If so, your normal ffmpeg command to merge the two files would be:
X:\my_ffmpeg_folder\ffmpeg.exe -i "X:\some_path\your_file.m4v" -i "X:\some_path\your_file.m4a" -c:v -copy -c:a copy "X:\output_path\your_file.mp4"

This is common ffmpeg usage and has nothing to do with FFAStrans. Implemented using the "Command executor"-node:
%comspec% /c ""X:\my_ffmpeg_folder\ffmpeg.exe" -i "X:\some_path\your_file.m4v" -i "X:\some_path\your_file.m4a" -c:v -copy -c:a copy "X:\output_path\your_file.mp4""

Another approach would be to create a new workflow monitoring *.m4v and add the "Custom FFmpeg"-preset from previous post:
-i "%s_original_path%\%s_original_name%.m4a" -c:v -copy -c:a copy
Remember to specify mp4 as extension in your preset.

In either cases you will probably need to use variables like %s_original_name% and %s_original_path% in order to get most out of your workflow. Learning how to use variables is the key to the power of FFAStrans ;-)

-steipal
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Re: h264 MP4

Post by vijm1972 »

I have created workflow as per below.

1) Monitor folder watching for mxf source file

2) Custom FFMPEG to create m4v
-c:v libx264 -s 640x480 -aspect 4:3 -b:v 512000 -minrate 512000 -maxrate 512000 -bufsize 512000 -pix_fmt yuv420p -coder 1 -flags +loop -cmp chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method 4 -subq 6 -me_range 16 -g 15 -keyint_min 1 -bf 0 -intra -refs 4 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -direct-pred 1 -fast-pskip 1 -movflags +faststart -vprofile main -vlevel 4.0 -an "D:\Test\Temp\%s_original_name%.m4v"

3) Custom FFMPEG to create m4a
-vn -c:a aac -b:a 128000 -ar 48000 -ac 2 "D:\Test\Temp\%s_original_name%.m4a"

Please find below screen shot for your reference.
Workflow.jpg
Workflow.jpg (25.56 KiB) Viewed 7113 times
Question: Is it possible to create both the files in one Custom FFMPEG option? Or can I use other FFMPEG to create m4a file?

4) In Command executor I have used below command
%comspec% /c ""D:\FFMPEG\ffmpeg\ffmpeg.exe" -i "D:\Test\Temp\%s_original_name%.m4v" -i "D:\Test\Temp\%s_original_name%.m4a" -c:v copy -c:a copy "D:\Test\Outbox\%s_original_name%.mp4""

Please let me know if I am doing something wrong.

If I use below command I am not getting final output, but if I remove "-" from "-copy" I am getting output but asking for overwrite. It's creating two files.

%comspec% /c ""X:\my_ffmpeg_folder\ffmpeg.exe" -i "X:\some_path\your_file.m4v" -i "X:\some_path\your_file.m4a" -c:v -copy -c:a copy "X:\output_path\your_file.mp4""

Please suggest.

Vijay
admin
Site Admin
Posts: 1658
Joined: Sat Feb 08, 2014 10:39 pm

Re: h264 MP4

Post by admin »

I'm sorry but I have misinformed you. "-copy" is an invalid options so the correct is just "copy". So you've already figured that out. To overwrite files in ffmpeg use "-y" prior to the output filename:

%comspec% /c ""X:\my_ffmpeg_folder\ffmpeg.exe" -i "X:\some_path\your_file.m4v" -i "X:\some_path\your_file.m4a" -c:v copy -c:a copy -y "X:\output_path\your_file.mp4""


Other than that you should be able to output to several outputs. Please read documentation for ffmpeg. http://www.ffmpeg.org/ffmpeg-all.html
Anyway, I would try this in one ffmpeg preset:

-c:v libx264 -s 640x480 -aspect 4:3 -b:v 512000 -minrate 512000 -maxrate 512000 -bufsize 512000 -pix_fmt yuv420p -coder 1 -flags +loop -cmp chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method 4 -subq 6 -me_range 16 -g 15 -keyint_min 1 -bf 0 -intra -refs 4 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -direct-pred 1 -fast-pskip 1 -movflags +faststart -vprofile main -vlevel 4.0 -an "D:\Test\Temp\%s_original_name%.m4v" -c:a aac -b:a 128000 -ar 48000 -ac 2-vn "D:\Test\Temp\%s_original_name%.m4a"

-steipal
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Re: h264 MP4

Post by vijm1972 »

Thanks will try.
Post Reply