Automatically Add Intro to Videos

Questions and answers on how to get the most out of FFAStrans
diesus
Posts: 17
Joined: Sun Sep 04, 2016 3:23 pm

Automatically Add Intro to Videos

Post by diesus »

It's me once again!

I would love inputs on my workflow. I am totally new to ffmpeg and avisynth. I am currently reading their wikis and manuals but somehow, I can't grasp how my workflow should look like. I'm not a video encoder or programmer (though I wish that I was either) so please forgive my ignorance.

My current workflow goes like this:

I have a common folder where I dump video files once in a while. These are either MKV or MP4 files depending on what the people in the office give me. My task is to put the intro video for each video that they produce then output it as MP4 that is web (video on demand) friendly. These are tutorials so we also need to get 1080p, 720p, 480p, 360p, and 240p resolutions since not all students have fast internet connections.

What I do right now is very lame for some of you. I open up Wondershare. Load up the source files, join them them produce 5 resolutions. I'm crying as I type this.

What I formed in FFAStrans is like this:

1. Watch Folder - this is where the video files are saved/dumped

2. MP4 encode process - to normalize the file type to MP4 since I understand that the merge function works best if the file types and codec of the two files are the same.

3. A/V Decoder process - to prep the file for adding the intro video file

4. Insert Media Filter process - joins the lecture video with the intro video

5. Output Folder - Uploaded to FTP for on demand streaming

************
Unfortunately, it stops at Insert Media. What am I doing wrong? :shock:
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Automatically Add Intro to Videos

Post by admin »

When you write "it stops at Insert Media", do you mean like an error message or that the job just halts? Anyway, you're doing it the wrong way and you'll only end up with a useless file:

1. Watch Folder
2. A/V Decoder
3. Insert Media Filter
4. MP4 encode
5. Output

This should be the correct workflow. You never encode before adding filters. That's just wasting time and quality. Also, you should make your intro video uncompressed AVI. This is natively supported in AviSynth which the filter is based upon.

-steinar
diesus
Posts: 17
Joined: Sun Sep 04, 2016 3:23 pm

Re: Automatically Add Intro to Videos

Post by diesus »

Okay. Thanks for the inputs steinar! Here is my current workflow. However, it seems that the audio channels I'm working with isn't matching. Where do you think is the mismatch coming from? i.e., the intro and tutorial footages' codecs are not matching?

I'm inserting an uncompressed 1080p AVI intro into a 1080p A/V Decoded MP4 video.
Screen Shot 2016-09-07 at 8.55.49 AM.png
Screen Shot 2016-09-07 at 8.55.49 AM.png (106.38 KiB) Viewed 14697 times
Screen Shot 2016-09-07 at 8.55.26 AM.png
Screen Shot 2016-09-07 at 8.55.26 AM.png (52.78 KiB) Viewed 14697 times
diesus
Posts: 17
Joined: Sun Sep 04, 2016 3:23 pm

Re: Automatically Add Intro to Videos

Post by diesus »

So I checked the audio channels, the intro says 2 channels (stereo) while the other end of the file is a 2 channel only. Does this mean this is a 2 channel mono?
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Automatically Add Intro to Videos

Post by admin »

Ok, the "A/V media"-decoder will always conform the input media to 32 channels in one track. However, the "Insert media"-filter does not adapt very well to the audio configuration. So you must either make sure your intro has 32 audio channels in one track, or you can add the "Channel mapper" prior to the "Insert media"-filter in order to restrict to 2 channels. That should work. I'm sorry but I did not think about this issue in my last reply.

-steinar
diesus
Posts: 17
Joined: Sun Sep 04, 2016 3:23 pm

Re: Automatically Add Intro to Videos

Post by diesus »

The workflow has now completed! But it really took some time. I'm reading into the ffmpeg concat function. Maybe it'll be a bit faster if I do that and force the video producers to give me an .mp4 format under x264 and AAC. Will update this forum for my own notes and for the benefit of others.
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Automatically Add Intro to Videos

Post by admin »

Yes, the (lack of) speed is partly due to AviSynth and to the nature of FFAStrans execution model. Concat will always be faster if you learn to muster it ;)

-steinar
diesus
Posts: 17
Joined: Sun Sep 04, 2016 3:23 pm

Re: Automatically Add Intro to Videos

Post by diesus »

Yeah. Trying to learn ffmpeg right now LoL.

So I came up with this option on the custom ffmpeg encode:
-i "concat:%s_original_name%burn.mp4|5.mp4" -c copy %s_original_name%-APnl.mp4

But it returns this:

Encoding failed - no video or audio found in media

Out of curiosity, I tried to use A/V media decode before it as well as trying to feed the same video to a MP4 encode node. I guess I ruled out the fact that nothing is wrong with the source MP4 file.

Any idea on how I can move this forward? :)
diesus
Posts: 17
Joined: Sun Sep 04, 2016 3:23 pm

Re: Automatically Add Intro to Videos

Post by diesus »

Ah it seems that I need to convert the mp4 to a decompressed mpeg as per ffmpeg wiki. But I get the same error when I burn subs into the video. Need to decompress it too?
diesus
Posts: 17
Joined: Sun Sep 04, 2016 3:23 pm

Re: Automatically Add Intro to Videos

Post by diesus »

**Update**

I'll try to install ffmpeg into my system and make use of the command executor node. Hopefully this bit would work.
Post Reply