VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 17 of 17
  1. Hi!

    Youtube has this idiotic thing of not letting you uploading an audio file. They recommend using a thrid-party tool, even though they have a slideshow creator. Of course you can't add your own audio for that. What morons...

    Anyway. I want a quick way of adding a valid video stream, so that youtube doesn't fail on conversion. It can be whatever, a still image, or even just empty video as long as it can be done fast (no long tinkering, or conversion/upload times) and youtube can handle it.

    Does anyone have an idea?
    Quote Quote  
  2. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by mzso View Post
    ...Does anyone have an idea?
    Yes, FFmpeg will create a video.mp4 from an image.jpg and a filename.mp3
    Code:
    ffmpeg -loop 1 -i image.jpg -i filename.mp3 -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart video.mp4
    Quote Quote  
  3. Originally Posted by bat999 View Post
    Originally Posted by mzso View Post
    ...Does anyone have an idea?
    Yes, FFmpeg will create a video.mp4 from an image.jpg and a filename.mp3
    Code:
    ffmpeg -loop 1 -i image.jpg -i filename.mp3 -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart video.mp4
    I tried that one. It converted horribly slowly, even though I set a ridiculously low framerate, so there wouldn't be many frames to encode or to take up space.

    I think this might have been the command line:
    Code:
    ffmpeg -loop 1 -r 0.0000001 -i -i -shortest -acodec copy -vcodec libx264 -tune stillimage -crf 0 -g 1 -pix_fmt yuvj444p out.mkv
    Never figured out why it took more than an hour (I think) to encode even though there were only a few frames encoded for a three hour video.
    Quote Quote  
  4. Member
    Join Date
    Jan 2007
    Location
    United States
    Search Comp PM
    Well your thinking backwards
    What you do is create the video stream the same length as the audio file aka run time..playing time
    Then you add the audio to the video
    He processes is called muxing ,
    After all it is YouTube video not an audio website
    Quote Quote  
  5. If you have the audio in a DVD-compliant format, then make a still image BMP at DVD resolution (720x480/576 and add the BMP and the audio into Muxman to create a DVD with the still image lasting as long as the audio. Then upload the resulting VOB file to YouTube.
    Quote Quote  
  6. Reading this I wonder, wouldn't it be easier to multiplex the audio and an image into an mp4 file?
    Code:
    MP4Box -add "C:\Users\Selur\Desktop\Elysian_Bailey_-_01_-_Come_Home.mp3"#audio:lang= -itags cover="C:\Users\Selur\Desktop\Elysian_Bailey.jpg" -tmp "H:\Temp" -new "H:\Output\imageAndSound.mp4"
    or doesn't YouTube support such content? (ffplay and nearly all a/v players out there would show the image while playing the sound)

    I guess instead of mp4box one could also use ffmpeg, but since I don't know the ffmpeg command line directly, I prefer MP4Box.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  7. Member
    Join Date
    Jul 2014
    Location
    Denmark
    Search Comp PM
    Don't know if you have found your way but FFQueue has a tool for creating a video from images with an optional sound track, screenshot here: http://ffqueue.bruchhaus.dk/gfx/Screen10.png If you do not want to create your own preset you can copy the preset below and paste it to FFQ:

    Code:
    //8YAQAAeNpNjk9PwzAMxe+R8h12n4Wc0EGZ5EO5cUQcEaq81B
    vR+mck6WDfHqtSBQc/W34/P/n9kiRL+bAmdrRt3vqA+blpmhS+
    VV5rHYmsGXkQehn4JHlTps01djJZs7Q2TJ0E6uPhxz9U1pzl1h
    6T8pkAAKFCFVzhr5n7WG6E8LgDBzuv4p0ST7iyTmGeu/gv+Tq1
    zEHGsDqJi5DztV4DrMu/7FojjpxLLpwKOWvK5zwcMi3xcBlPS/
    eIWlDBPegv6uHe4R7xDhF/AR35Ud8=
    I'm the developer behind FFQueue. My posts might reflect this! ;-)
    Quote Quote  
  8. Originally Posted by theewizard View Post
    Well your thinking backwards
    What you do is create the video stream the same length as the audio file aka run time..playing time
    Then you add the audio to the video
    He processes is called muxing ,
    After all it is YouTube video not an audio website
    I'm most certainly not. Whether you add the video to the audio or vice-versa is a matter of prerspective. Muxing is just joining two streams.
    Quote Quote  
  9. I tried this.
    Code:
    ffmpeg -loop 1 -r 0.07 -i <image> -i <audio> -shortest -acodec copy -r 0.07 -vcodec libx264 -tune stillimage -crf 15 -g 10000 -pix_fmt yuvj444p out.mkv
    Lower framerates for some reason don't work on playback. Get some invalid timestamp errors.

    I uploaded some on youtube, but the videos got stuck at 95% processing...
    Quote Quote  
  10. did you try the mp4 method I proposed?
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  11. Member
    Join Date
    Jul 2014
    Location
    Denmark
    Search Comp PM
    Originally Posted by mzso View Post
    Lower framerates for some reason don't work on playback.
    Did you try FFQueue? The image2 format used by ffmpeg uses -framerate and not -r. For a framerate of 1 frame pr. 5 seconds, try:

    Code:
    ffmpeg -loop 1 -framerate 1/5 -i <image> -i <audio> -shortest -acodec copy -r 25 -vcodec libx264 -tune stillimage -crf 15 -g 10000 -pix_fmt yuvj444p out.mkv
    EDIT: Output frame rate changed to 25 in the command.
    Last edited by TorBru; 29th Dec 2015 at 12:34.
    I'm the developer behind FFQueue. My posts might reflect this! ;-)
    Quote Quote  
  12. Originally Posted by Selur View Post
    did you try the mp4 method I proposed?
    I think I tried this before, but anyway I tried adding cover art with mkvmerge instead. Video players show it without a problem, youtube can't process it.
    Quote Quote  
  13. Originally Posted by TorBru View Post
    Originally Posted by mzso View Post
    Lower framerates for some reason don't work on playback.
    Did you try FFQueue? The image2 format used by ffmpeg uses -framerate and not -r. For a framerate of 1 frame pr. 5 seconds, try:

    Code:
    ffmpeg -loop 1 -framerate 1/5 -i <image> -i <audio> -shortest -acodec copy -r 25 -vcodec libx264 -tune stillimage -crf 15 -g 10000 -pix_fmt yuvj444p out.mkv
    EDIT: Output frame rate changed to 25 in the command.
    I use ffmpeg directly. So you mean at the input I should use -framerate? It's surprising, because it seemed to have worked normally until I got too low and something got messed up. (Maybe it's just the players can't handle too small framerates)

    What's point of -r 25 for output? That will just add a lot more frames to encode, doesn't it?
    Quote Quote  
  14. Member
    Join Date
    Jul 2014
    Location
    Denmark
    Search Comp PM
    Originally Posted by mzso View Post
    I use ffmpeg directly. So you mean at the input I should use -framerate? It's surprising, because it seemed to have worked normally until I got too low and something got messed up. (Maybe it's just the players can't handle too small framerates)

    What's point of -r 25 for output? That will just add a lot more frames to encode, doesn't it?
    You must use -framerate as input framerate for images. If not 25 will be assumed: https://www.ffmpeg.org/ffmpeg-formats.html#image2-1

    -framerate and -r are not the same and they behave differently as input option and output option: https://www.ffmpeg.org/ffmpeg.html#Video-Options

    You must use a target frame rate that is commonly supported (at least by ffmpeg and youtube). If you do not your video might fail to encode or produce ill behaviour: https://support.google.com/youtube/answer/1722171?hl=en

    You can force a larger GOP-size to lower the file size. Assuming you encode to 25 FPS I would set max. GOP-size to 10 seconds (-g 250) and min. GOP-size to one second (-keyint_min 25).
    I'm the developer behind FFQueue. My posts might reflect this! ;-)
    Quote Quote  
  15. Originally Posted by TorBru View Post
    Originally Posted by mzso View Post
    I use ffmpeg directly. So you mean at the input I should use -framerate? It's surprising, because it seemed to have worked normally until I got too low and something got messed up. (Maybe it's just the players can't handle too small framerates)

    What's point of -r 25 for output? That will just add a lot more frames to encode, doesn't it?
    You must use -framerate as input framerate for images. If not 25 will be assumed: https://www.ffmpeg.org/ffmpeg-formats.html#image2-1

    -framerate and -r are not the same and they behave differently as input option and output option: https://www.ffmpeg.org/ffmpeg.html#Video-Options

    You must use a target frame rate that is commonly supported (at least by ffmpeg and youtube). If you do not your video might fail to encode or produce ill behaviour: https://support.google.com/youtube/answer/1722171?hl=en

    You can force a larger GOP-size to lower the file size. Assuming you encode to 25 FPS I would set max. GOP-size to 10 seconds (-g 250) and min. GOP-size to one second (-keyint_min 25).
    I see. It was not my experience though for "-r". When I set it as an input nothing else for framerate, I got identical behavior. And an encode that had the appropriate framerate.

    You seem to be right for framerate. when I didn't use 25 processing got stuck. Previously youtube didn't have such problems. I could upload a 3 hour video file with some extremely small framerate.

    Too bad there isn't just a simple tool that lets you quickly add an image or slideshow, apparently it's impossible. I imagine the best would be encoding as a single keyframe and all p-frames that reference this frame. (if possible)

    Oh well one can dream. I was (ATM) only interested in downloading an ~hour long audio file to see if I can get youtube to do voice-recognition/subtitling. (The answer is no, the option doesn't appear for long videos)

    Anyway I succeded in uploading with your settings. But it seems like the high enough input framerate is still necessary, with 1/25 the video gets stuck. I got a blank grey video though. Limiting gop to 250 didn't help
    Quote Quote  
  16. Member
    Join Date
    Jul 2014
    Location
    Denmark
    Search Comp PM
    Sometimes ffmpeg seems to mess up the PTS in the video if you use odd frame rates. You can often get about this by using the setpts filter to set the PTS for each frame:

    Code:
    ffmpeg ... -vf "setpts=PTS+(XXX/TB)" ...
    where XXX is the time each frame is displayed declared as seconds.milliseconds (5½ seconds would be 5.5).
    I'm the developer behind FFQueue. My posts might reflect this! ;-)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!