YouTube Video Downloader avatar
YouTube Video Downloader

Pricing

Pay per event

Go to Store
YouTube Video Downloader

YouTube Video Downloader

Developed by

Streamers

Streamers

Maintained by Apify

Use YouTube Video Downloader to download YouTube videos in MP4, MP3, avi, and other formats directly to your cloud storage service. Just add a YouTube video URL and get the converted video in a few seconds.

4.6 (4)

Pricing

Pay per event

13

Total users

501

Monthly users

237

Runs succeeded

60%

Issues response

34 days

Last modified

3 days ago

WW

Fails on Post-Processing/Remuxing

Open

wrinkled_woodcut opened this issue
2 days ago

Bug Description: The actor fails when instructed to produce an audio file (e.g., mp3 or m4a) if a preferredQuality (e.g., "480p") is also specified in the input. The actor log shows that it successfully downloads a video file (.mp4), but then consistently fails during the "post-processing" or "remuxing" step where it attempts to convert the video into the requested audio format. This results in the actor producing no dataset items, despite the run often being marked as "Succeeded."

Steps to Reproduce: Use any valid Apify account with access to proxies. Run the actor with an input that specifies both a preferredFormat of m4a (or mp3) and a preferredQuality.

{ "videos": [ { "url": "https://www.youtube.com/watch?v=CdQFrz31j2s" } ], "preferredFormat": "m4a", "preferredQuality": "480p", "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": [ "RESIDENTIAL" ] } }

Expected Behavior: The actor should download the audio from the video, convert it to the specified .m4a format, and produce a dataset item containing a link to the final audio file. Actual Behavior: The actor downloads the video as an .mp4 file, attempts to convert it to .m4a, and then fails. The run produces zero dataset items. Evidence from Actor Log: The log clearly shows the successful download of the .mp4 and the subsequent failure point: Generated code [Merger] Merging formats into "/tmp/CdQFrz31j2s_test_Short.mp4" ... [VideoRemuxer] Remuxing video from mp4 to m4a; Destination: /tmp/CdQFrz31j2s_test_Short.m4a ... ERROR: Postprocessing: Error opening output files: Invalid argument Use code with caution. This exact same Postprocessing error occurs whether the requested format is m4a or mp3.

Analysis & Hypothesis: The root cause appears to be a bug in the actor's internal video conversion logic (likely an ffmpeg command). Specifying a preferredQuality forces the actor to download a full video stream. The subsequent attempt to remux this video into a pure audio format fails with an "Invalid argument" error, suggesting the conversion command is malformed or its underlying tools are misconfigured.

Suggested Workaround for Other Users: To successfully download an audio file, do not specify preferredQuality in the input. By only providing preferredFormat: "m4a", the actor correctly downloads the native audio-only stream from YouTube, which requires no conversion, and the run succeeds.