Page 1 of 1

How can Prepend a 10second still image to video

Posted: Fri Feb 07, 2020 8:50 pm
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 6886 times

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

Posted: Fri Feb 07, 2020 11:10 pm
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

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

Posted: Fri Feb 07, 2020 11:31 pm
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

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

Posted: Sat Feb 08, 2020 12:04 am
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"

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

Posted: Sat Feb 08, 2020 12:09 am
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.

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

Posted: Sat Feb 08, 2020 1:48 am
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"!