Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[Feature request] Add a possibility to use ffmpeg (instead of AtomicParsey) to embed thumbnail in downloaded video #24882
Comments
|
This would also be great for embedding thumbnails in container formats besides mp3 and mp4a/mp4 (e.g., Matroska mkv). |
|
Also because $ curl -qs $(youtube-dl https://www.dailymotion.com/video/x5qpdm --get-thumbnail) | file -b -
JPEG image data
$ curl -qs $(youtube-dl https://www.youtube.com/watch?v=s13q9GhousM --get-thumbnail) | file -b -
JPEG image data, JFIF standard 1.01
$ AtomicParsley Bug2000__hls-380-0__x5qpdm__dailymotion.mp4 --artwork Bug2000__hls-380-0__x5qpdm__dailymotion.jpg --overWrite
AtomicParsley error: Bug2000__hls-380-0__x5qpdm__dailymotion.jpg
image file is not jpg/png and cannot be embedded.
$ convert -verbose Bug2000__hls-380-0__x5qpdm__dailymotion.jpg Bug2000__hls-380-0__x5qpdm__dailymotion__NEW.jpg
Bug2000__http-380-1__x5qpdm__dailymotion.jpg JPEG 1440x1080 1440x1080+0+0 8-bit DirectClass 81.3KB 0.040u 0:00.050
Bug2000__http-380-1__x5qpdm__dailymotion.jpg=>Bug2000__hls-380-0__x5qpdm__dailymotion__NEW.jpg JPEG 1440x1080 1440x1080+0+0 8-bit DirectClass 81.9KB 0.060u 0:00.059
$ file Bug2000__hls-380-0__x5qpdm__dailymotion.jpg Bug2000__hls-380-0__x5qpdm__dailymotion__NEW.jpg
Bug2000__hls-380-0__x5qpdm__dailymotion.jpg: JPEG image data
Bug2000__hls-380-0__x5qpdm__dailymotion__NEW.jpg: JPEG image data, JFIF standard 1.01
$ AtomicParsley Bug2000__hls-380-0__x5qpdm__dailymotion.mp4 --artwork Bug2000__hls-380-0__x5qpdm__dailymotion__NEW.jpg --overWrite
Started writing to temp file.
Progress: =======================================================>100% |
Finished writing to temp file. |
|
BTW : The AtomicParsley issue #48 has been reported since December 2016. |
|
@sebma : You do have a valid argument here The Windows binary of yt-dl, BTW, FFmpeg 4.x.x can also embed artwork as cover to ffmpeg -v 16 -stats -i "audio-only.m4a" -i "cover.jpg" -map 0 -map 1 -disposition:v attached_pic -c copy "audio+cover.m4a"... so I'd say it could probably replace fully AP for MOV/MP4/M4A tagging/artwork-embedding; and since yt-dl already depends on FFmpeg (for muxing elementary media streams into compatible containers and for cases where the native HLS downloader fails), one can kill two birds with one stone, by getting rid of AP altogether... ... However, the most wise move would be to retain AP support as an option, for those users that can't run the latest FFmpeg 4 Windows binaries (XP+Vista); I haven't checked, but what is the usage share of SailfishOS compared to the combined figure for XP+Vista? FWIW, a kind person I know does compile and offer FFmpeg n4.3-dev Windows builds from forked FFmpeg code patched to make them run on XP SP3 (and SSE+ CPUs), but let's cross that bridge when we find it...
If wez has left the AP project to rot away, either you or Logan Fleur can always fork the project and implement needed patches, can you not? Then the yt-dl community here would need a volunteer to compile the forked AP code for at least Windows x86 (targetting XP+)... |
|
@Vangelis66 I can fork & patch the GitHub project, but not compile it for Windows. I'll do that later tonight when I'm done with work. |
|
@effleurager wrote:
(Do you actually mean the Bitbucket original one by Wez, that uses mercurial version control?)
... such a pity, though... For anyone else that may volunteer, (cross)compilation instructions for Windows 32-bit are described/linked in https://bitbucket.org/jonhedgerows/atomicparsley/wiki/Building%20for%20Windows Best wishes |
|
@Vangelis66 The GitHub one is severely outdated compared to the Mercurial one, so I've used Bitbucket as the source instead. |
According to https://ffmpeg.zeranoe.com/builds/ : ffmpeg can run on Win7. If it does run on Win7, can it not run on Vista ?
Unfortunately, I'm a better "scripter" than developer : I don't know anything about cross-compiling except doing somethig like this (to build AP for SailfishOS) : dest=arm-linux-gnueabihf
export CC=$dest-gcc
time ./configure --prefix=$HOME/build/jolla --host=$dest
time makeIf I knew more, I would have succeeded building AP on SailfishOS.
You're absolutely right However, can we also consider the possiblity to have a new
|
I also noticed addSubtitles2media ()
{
local inputVideo=$1
test $# -le 1 && {
echo "=> Usage: $FUNCNAME inputVideo subFile1 subFile2 subFile3 ..." 1>&2
return 1
}
local extension=${inputVideo/*./}
case $extension in
mp4 | m4a | m4b | mov)
subTitleCodec=mov_text
;;
webm | mkv | mka)
subTitleCodec=webvtt
;;
*)
subTitleCodec=not_known_or_not_yet_supported
;;
esac
local outputVideo=${inputVideo/.$extension/_NEW.$extension}
shift
local numberOfSubtitles=$#
( printf "ffmpeg -hide_banner -i $inputVideo "
printf -- "-i %s " "$@"
printf -- "-map 0:a? -map 0:v? "
printf -- "-map %d " $(seq $numberOfSubtitles)
printf -- "-c copy -c:s $subTitleCodec $outputVideo\n" ) | sh -x
local retCode=$?
sync
sleep 1
touch -r "$inputVideo" "$outputVideo"
[ $retCode = 0 ] && echo && \mv -vf "$outputVideo" "$inputVideo" && \rm "$@"
}I haven't tried it on Matroska contained streams but I can say it works like a charm on m4a files
|
Checklist
Description
Hi,
Since version 4,
ffmpegis able to embed thumbnail in mp4 files : See https://www.ffmpeg.org/ffmpeg.html#Main-options and : https://stackoverflow.com/q/54717175/5649639I cannot build/find
AtomicParsleyfor SailfishOS, can you please add the possibility to useffmpeg(instead ofAtomicParsley) to embed thumbnail in downloaded video ?Thanks a lot to your team for your great amount of work for this great tool I use everyday (along with
mpv:-) )