I have a bunch of m4v files in a folder (can be made mp4 if necessary) that I want to add a cover to, same one to all files. How can I do this? I figured out how to do it using MKVToolNix but that obviously only works for MKV files. I don't really understand scripting and stuff so I can't just whip together an FFMPEG script or anything, does anyone have a script that would work for this or some other way of doing it in one go? I don't want to have to do it manually.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 9 of 9
Thread
-
-
This should work:
Code:md New for %%F in (*.m4v) do ( ffmpeg -i "%%~dpnxF" -i thumbnail.png -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic "%%~dpF\New\%%~nF.m4v" )
-
Thanks for the code, this didn't seem to work on my computer though. It just creates a folder with loads of 0 byte video files. In the cmd windows it said:
Code:Tag text incompatible with output codec id '100359' ([0][0][0][0]) Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input Error initializing output stream 0:3 --
Also would this script re-encode the files? For the MKV one it just added them without copying or anything, is that not possible with mp4/m4v? -
No it shouldn't re-encode, it does however remux to an output file.
This can be issue when you just want to modify header tags on large files (ex: 3GB), in which case an in-place operation may be preferable (if it is possible).
I've used mp4v2\mp4art.exe for this type of thing in the past.
Converting your mkv to mp4 with ffmpeg may also work. -
-
When I tested the batch file I used MP4 files -- since MP4 and M4V files are the same container. When I posted it I just changed the instances of MP4 to M4V and assumed it would work. As it turns out the M4V muxer is for Mpeg 4 Part 2 (Divx, Xvid, etc.) elementary streams. Thanks go to Apple for commandeering an existing extension for their own use.
So yes, just change the output spec to MP4. And rename to M4V later if necessary:
Code:md New for %%F in (*.m4v) do ( ffmpeg -i "%%~dpnxF" -i thumbnail.png -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic "%%~dpFNew\%%~nF.mp4" move "%%~dpFNew\%%~nF.mp4" "%%~dpFNew\%%~nF.m4v" )
Last edited by jagabo; 21st May 2021 at 08:16.
-
Thanks, they were allm4v as that's what handbrake seems to default to, I'm not sure why lol it's Apple's standard isn't it?
That script didn't seem to work if the png was changed to a jpg, I managed to use the loop script and another thumbnail script I found to make this which seems to work with jpg, is there any real difference in the outcome? I know some of the arguments are a bit different but idk what they mean.
Code:@echo off md New for %%F in (*.m4v) do ( ffmpeg -i "%%~dpnxF" -i cover.jpg -map 1 -map 0 -c copy -disposition:0 attached_pic "%%~dpF\New\%%~nF.mp4" ) pause
Similar Threads
-
Add blur to cover the video defect in ripping
By hintlou in forum DVD RippingReplies: 15Last Post: 24th Feb 2020, 05:33 -
DVD: Can You Add .SRT To A VIDEO_TS Folder/Files?
By SetoTitan in forum SubtitleReplies: 9Last Post: 6th Jan 2018, 06:30 -
Batch Remove Cover From Multiple MKV Files
By MohamedYousri in forum Newbie / General discussionsReplies: 4Last Post: 5th Oct 2017, 13:27 -
How to add icon (cover) in a thumbnail of a video?
By LoverOfLove in forum EditingReplies: 2Last Post: 30th Jul 2017, 04:32 -
How to add new subtitles to an existing Blu-ray folder
By Ryugen in forum SubtitleReplies: 2Last Post: 6th Jun 2016, 22:20