Merge Audio and Video Files

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

Merge Audio and Video Files

Post by abul »

Hi Team,

I hope someone can pick this up and give me some support as I am working on a project for University and want to complete this as soon as possible.

I am using FFAStrans to pick up 2 audio files from one folder and one video file from another folder and be able to merge them together to create a wrapped video output in the .mxf wrapper.

What i need to do initially is be able to merge the video file with no audio with its either one stereo audio file or 2 left and right audio file together and get an output of .mxf file.

If this works with ffmpeg then i can figure out the part of watch folders by trial and error and see other answers to see if people have done this before.

However i cant seem to find anywhere where people have done merging of audio and video file together without re-encoding. just want to put audio and video into a wrapper. (transwrap them)


any help would be appreciated.


ABUL
momocampo
Posts: 592
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Merge Audio and Video Files

Post by momocampo »

Hello Abul,

Well I succeed to do that but maybe there is easier way or better but...Anyway, I upload a workflow to do this.
Please you have to change all the delivery folder.
To resume :
1/ catch a video file and change his name to "video"
2/ catch an audio file and change his name to "audio"
3/ use hold node to check all files are here
4/ use a custom ffmpeg to merge "video" and "audio" and map them (you have to check what you want)
5/ Delivery

That's it
Hope you succeed.
;)

Benjamin
Attachments
Merge A+V.xml
(15.15 KiB) Downloaded 426 times
abul
Posts: 54
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul »

Thanks so much, i will have a look at this and see if it helps
abul
Posts: 54
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul »

Hi Benjamin,

I appropriate the help, however i tried to configure and set it to my documents and files and doesn't give me the desired output.

it copies the audio and video file and puts it into the merge folder than it deletes the audio in the original location and nothing appears in my output folder.

Do you know why its not outputting a video.mxf file and is there anyway the video and audio it picks up checks to see if they are matching name and not just take any random audio and video from the in folder .

Kind Regards,

Abul
momocampo
Posts: 592
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Merge Audio and Video Files

Post by momocampo »

Hello,

Can you upload your workflow please? I'm pretty sure it's the paths.
Thanks ;)

B.
abul
Posts: 54
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul »

Attached
Attachments
Merge A+V.xml
(15.89 KiB) Downloaded 368 times
momocampo
Posts: 592
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Merge Audio and Video Files

Post by momocampo »

Ok thanks,
So, first you video file is m2v so obviously your output file will be the same m2v because you want a transwrap.
Second, can you try to execute the ffmpeg command in dos to check a m2v file can be merge. If it works, we could find why the merge didn't start.
Put your wav+m2v in ffmpeg folder, type your command <ffmpeg -i "video.m2v" -i "audio.wav" -c copy -map 0:0 -map 1:0>
Last, I choose .mxf in custom ffmpeg node because I believed your input file was mxf.

Let me know.

;)
abul
Posts: 54
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul »

Thank you for the quick replies :D

This is the response i get

ffmpeg -i video.m2v -i audio.wav -c map 0:0 -map 1:0
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
Trailing options were found on the commandline.
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
[NULL @ 0000019f347eec40] Unable to find a suitable output format for '0:0'
0:0: Invalid argument






I've tried this before and gives me the output needed but i cannot get a .mxf output from it only mp4

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

if i do output.mxf the file is corrupted and wont play
momocampo
Posts: 592
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Merge Audio and Video Files

Post by momocampo »

you have to specify your output so :
<ffmpeg -i "video.m2v" -i "audio.wav" -c copy -map 0:0 -map 1:0 output.mxf>
(Sorry I forgot)

EDit:
But without encode I doubt you can have an mxf reliable.
You can transwrap mxf to mxf but m2v to mxf....I don't think so
abul
Posts: 54
Joined: Wed Sep 11, 2019 12:45 pm

Re: Merge Audio and Video Files

Post by abul »

same error even with doing output.mxf.

do you know what other format i can use for the video so i can wrap it in mxf

so that way i can try and see if the unwrapping thats done gives a different format
Post Reply