Merge Audio and Video Files

Questions and answers on how to get the most out of FFAStrans
abul
Posts: 31
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul » Fri Sep 20, 2019 3:15 pm

Ah i see, oky that help alot, did not know you could use the equal function that was with *.
i did the == and was getting errors but now i see.

thanks Steinar


Abul

emcodem
Posts: 369
Joined: Wed Sep 19, 2018 8:11 am

Re: Merge Audio and Video Files

Post by emcodem » Sat Sep 21, 2019 4:29 pm

Just to mention, regex will allow you to specify multiple conditions as well by just using the OR symbol |

For example like that:

Code: Select all

$regext("%s_original_name%","(.+)_High|(.+)P2High")

abul
Posts: 31
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul » Mon Sep 23, 2019 8:19 am

emcodem wrote:
Sat Sep 21, 2019 4:29 pm
Just to mention, regex will allow you to specify multiple conditions as well by just using the OR symbol |

For example like that:

Code: Select all

$regext("%s_original_name%","(.+)_High|(.+)P2High")
Oh Wow, Thanks, this eliminates few nodes for me.

abul
Posts: 31
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul » Mon Sep 23, 2019 8:52 am

Hi Guys,

Do you know what could be wrong with this command, I ran it normally on CMD ffmpeg and it works, but when i try run it from FFAStrans, it freezes at 4/7 nodes 42.2% and doesn't even show the console even tho that box is ticked.

%comspec% c/ ""%s_ffmpeg%" -i "D:\Abul\Documents\Projects\Trans-Wrapping\merge\audio.wav" -i "D:\Abul\Documents\Projects\Trans-Wrapping\merge\video.m2v" "[1]amix=inputs=1[a]" -map 0:v -map "[a]" -c:v copy "D:\Abul\Documents\Projects\Trans-Wrapping\TestOut\out.mp4""



Abul

emcodem
Posts: 369
Joined: Wed Sep 19, 2018 8:11 am

Re: Merge Audio and Video Files

Post by emcodem » Mon Sep 23, 2019 10:18 am

abul wrote:
Mon Sep 23, 2019 8:52 am
%comspec% c/ ..."
should be like

Code: Select all

%comspec% /c ...
if the cmd window dont show up, you can also do

Code: Select all

%comspec% /K ...
also see possible options for cmd:
cmd /?

abul
Posts: 31
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul » Tue Sep 24, 2019 1:41 pm

Been trying these still it freezes and does not move :(

APerson
Posts: 12
Joined: Wed Sep 18, 2019 11:13 am

Re: Merge Audio and Video Files

Post by APerson » Tue Sep 24, 2019 1:45 pm

Hello all,

I found that i can change the extension with ffmpeg of a file and now, im having an issue. does anyone know why im getting this weird error, i can in admin mode and i did the thing with the read and write and i have full access yet i get this error.

using the command from before ffmpeg -i video.mpeg -i audio.wav -c copy -map 0:0 -map 1:0 out.mxf i did it with the new file

but it says this:

[mxf @ 000001b5e48f9680] could not get mpeg2 profile and level
av_interleaved_write_frame(): Operation not permitted

Ash Person

emcodem
Posts: 369
Joined: Wed Sep 19, 2018 8:11 am

Re: Merge Audio and Video Files

Post by emcodem » Tue Sep 24, 2019 7:53 pm

@abul i am not certain that exactly this ffmpeg line you posted works as ypu specify -map 0:v but your first input file does not comtain a video track. Please post exactly the command you enter on a commandline that is working for you AND exactly the contents of your commandline processor :)

@APerson please do not spam other users post with unrelated problems but open a new topic instead. Your problem is not related to ffastrans at all but o ly to ffmpeg. In that case just google for the error message as a first try

abul
Posts: 31
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul » Wed Sep 25, 2019 8:24 am

Hi,

this is the command i did in cmd (the filter complex is added on command executor in ffastrans, i forgot to type it in here)

ffmpeg -i video.m2v -i audio.wav -i audio.wav -filter_complex "[1]amix=inputs=1[a]" -map 0:v -map "[a]" -c:v copy output.mp4

and the output is

ffmpeg version N-94821-g976617c7d2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 35.100 / 56. 35.100
libavcodec 58. 56.101 / 58. 56.101
libavformat 58. 32.104 / 58. 32.104
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.102 / 7. 58.102
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpegvideo, from 'video.m2v':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mpeg2video (High), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'audio.wav':
Duration: 00:07:36.16, bitrate: 1536 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Guessed Channel Layout for Input Stream #2.0 : stereo
Input #2, wav, from 'audio.wav':
Duration: 00:07:36.16, bitrate: 1536 kb/s
Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #1:0 (pcm_s16le) -> amix
Stream #0:0 -> #0:0 (copy)
amix -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf58.32.104
Stream #0:0: Video: mpeg2video (High) (mp4v / 0x7634706D), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1200k tbn, 1200k tbc
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.56.101 aac
[mp4 @ 000001bb9d7030c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mp4 @ 000001bb9d7030c0] pts has no value
Last message repeated 241 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:00:09.68 bitrate=40296.5kbits/s speed=18.8x
Last message repeated 248 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:00:19.62 bitrate=42740.9kbits/s speed=19.3x
Last message repeated 257 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:00:29.96 bitrate=43609.0kbits/s speed=19.5x
Last message repeated 95 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:00:33.80 bitrate=43432.2kbits/s speed=16.6x
Last message repeated 169 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:00:40.60 bitrate=43699.3kbits/s speed= 16x
Last message repeated 234 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:00:50.00 bitrate=43956.3kbits/s speed=16.3x
Last message repeated 231 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:00:59.28 bitrate=44009.1kbits/s speed=16.6x
Last message repeated 221 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:08.16 bitrate=44029.1kbits/s speed=16.7x
Last message repeated 234 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:17.56 bitrate=44181.9kbits/s speed=16.9x
Last message repeated 220 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:26.40 bitrate=44273.2kbits/s speed=16.9x
Last message repeated 216 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:35.08 bitrate=44113.4kbits/s speed=16.9x
Last message repeated 133 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:40.44 bitrate=44097.8kbits/s speed=16.4x
Last message repeated 5 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:40.69 bitrate=44091.0kbits/s speed= 15x
Last message repeated 1 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:40.77 bitrate=44095.3kbits/s speed=13.8x
Last message repeated 8 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:41.12 bitrate=44112.4kbits/s speed=12.9x
Last message repeated 37 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:42.65 bitrate=44126.5kbits/s speed=12.3x
Last message repeated 4 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:42.84 bitrate=44125.7kbits/s speed=11.1x
Last message repeated 7 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:43.16 bitrate=44131.1kbits/s speed=10.3x
Last message repeated 6 times
[mp4 @ 000001bb9d7030c0] pts has no valueB time=00:01:43.44 bitrate=44134.4kbits/s speed=9.68x
Last message repeated 88 times
frame= 3630 fps=270 q=-1.0 Lsize= 772383kB time=00:02:25.19 bitrate=43578.5kbits/s speed=10.8x
video:770028kB audio:2273kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.010503%
[aac @ 000001bb9d705b80] Qavg: 395.849


i have reduce the number of time it says last message so there is not too much text.


edit: This was the updated line in ffastrans
%comspec% /c ""%s_ffmpeg%" -i "D:\Abul\Documents\Projects\Trans-Wrapping\merge\video.m2v" -i "D:\Abul\Documents\Projects\Trans-Wrapping\merge\audio.wav" -filter_complex "[1]amix=inputs=1[a]" -map 0:v -map "[a]" -c:v copy "D:\Abul\Documents\Projects\Trans-Wrapping\TestOut\out.m2v""

emcodem
Posts: 369
Joined: Wed Sep 19, 2018 8:11 am

Re: Merge Audio and Video Files

Post by emcodem » Wed Sep 25, 2019 9:40 am

Hey abul,

the command you enter in the cmd node was this:

Code: Select all

%comspec% /c ""%s_ffmpeg%" -i "D:\Abul\Documents\Projects\Trans-Wrapping\merge\video.m2v" -i "D:\Abul\Documents\Projects\Trans-Wrapping\merge\audio.wav" -filter_complex "[1]amix=inputs=1[a]" -map 0:v -map "[a]" -c:v copy "D:\Abul\Documents\Projects\Trans-Wrapping\TestOut\out.m2v""
In this very special case, the ffmpeg command does not work because you use -filter_complex and -map [a] to map an Audio stream into the Output but your Output is specified to be m2v which by Definition is an elementary mpeg2 stream, video only (no Audio possible because it is an elementary Video stream). Same command would most likely work using an Output Extension from some Container like .mp4, .mov, .mxf, .avi...

Post Reply