How can Prepend a 10second still image to video

Questions and answers on how to get the most out of FFAStrans
Post Reply
gdpodesta
Posts: 48
Joined: Tue Mar 26, 2019 6:11 pm

How can Prepend a 10second still image to video

Post by gdpodesta »

We transcode a variety of video files into a standard format using a Custom FFMpeg encoder.
I'd like to prepend 10seconds of a still image (png?) to the final output mp4, but can't get the sequence correct.
All jobs are submitted with the API (if that is relevant).

Current Workflow: CustomFFmpeg->DeliverToFolder
I started with just the InsertMedia processor, specifying the PNG file and duration, but it gave errors about needing "Use AV Media Decoder"
I've tried these, but all end with no output or an error about "Use A/V media", or "moov atom not found":
  1. CustomFFmpeg->InsertMedia->A/V Media Decoder->DeliverToFolder
  2. InsertMedia->A/V Media Decoder->CustomFFmpeg->DeliverToFolder
  3. A/V Media Decoder->InsertMedia->CustomFFmpeg->DeliverToFolder
In another post, I saw this, but it was relative to prepending a video.
Your workflow would look like this: Monitor->A/V Decode->InsertMedia->Encode->Deliver
I should add that the final video MUST go through the Custom FFMpeg process, we can't just tack on the generated video. Have tried that in the past, and our broadcast server won't play the MP4. Currently, we do a series of FFMPEG commands to arrive a the finish product, then do a final re-encode. Apparently whether there is audio or or not, we had to have an audio track in the final file.
Workflow, Settings, and Monitor Error
Workflow, Settings, and Monitor Error
2-7-2020 2-10-52 PM.jpg (121.24 KiB) Viewed 6880 times
momocampo
Posts: 595
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: How can Prepend a 10second still image to video

Post by momocampo »

Hello gdpodesta,

There is no reason why it should fail. I tried something similar and it works well.
You must know that you need to use A/V media BEFORE each filter so workflow 3 is the good one.
Anyway, in my opinion maybe the problem is your custom ffmpeg node, can you show me what is the command inside please?
;)

Benjamin
gdpodesta
Posts: 48
Joined: Tue Mar 26, 2019 6:11 pm

Re: How can Prepend a 10second still image to video

Post by gdpodesta »

That's what I keep saying, yet it doesn't! lol. Heres the FFMPEG command.
Also, had already determined #3 was the way to go. It continues to end in "moo atom not found". Have also been tyring an .avi instead, and it's the same error.

Code: Select all

-ac 2 -crf 23 -r 29.97 -c:a aac -b:a 384k -ar 48000 -rematrix_maxval 1.0 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" -c:v libx264 -preset medium -pix_fmt yuv420p -movflags faststart -map 0:v:0? -map_chapters 0 -sn -map 0:a? -map_metadata 0 -f mp4
gdpodesta
Posts: 48
Joined: Tue Mar 26, 2019 6:11 pm

Re: How can Prepend a 10second still image to video

Post by gdpodesta »

I've since removed all the ffmpeg custom options and replaced it with the below (as noted in the very light font next to the Audio Code field":
Audio Codec is aac, and Video Codec libx264

Code: Select all

-map_channel 0.0.1
The new error in the ffmpeg processor is "No video or audio found in media"
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: How can Prepend a 10second still image to video

Post by emcodem »

hey, welcome to the nightshift :-)
Can you please enable logging in the workflow properties->maintenance->keep work folders on completion? I am mostly interested in the file that has ffreport in its name. It will carry the ffmpeg output that you are interested in. E.g. when trying to reproduce your very last issue, i am seeing the error

Code: Select all

#0.0 is not an audio stream.
Sorry that its so hard currently to geht this information, in V1, you can easily find the error using the webinterface :)

Anyway, in general, if i was you i would as a first thing try to get it just working. It should work if you replace your custom ffmpeg command by a built-in node like xdcamhd encoder. Then investigate the ffreport mentioned above, copy the ffmpeg command as described here
viewtopic.php?f=5&t=849#p3641

So, you have a working starting point and just need to replace the encoding params and enhance the filtering params in your style.
emcodem, wrapping since 2009 you got the rhyme?
gdpodesta
Posts: 48
Joined: Tue Mar 26, 2019 6:11 pm

Re: How can Prepend a 10second still image to video

Post by gdpodesta »

Firstly, THANK you for your attention in getting this resolved.
After much trial and error (and thank God for Google), I found/added -map_channel 0.1.1 to the ffmpeg options.
I have no earthly idea what that means, but with the generated AVI file having no audio, that seems to be what was causing it to fail.
So, one more item to add to my ffmpeg vocabulary, and ffastrans "thinking"!
Post Reply