Log in

View Full Version : Using ImageSource() for a 5-second MKV to show a picture, can't merge MKVs now


BlueToast
6th November 2014, 15:04
I am using this to create a 5-second MKV that displays picturea.png for 5 seconds at 30fps.
ImageSource("static.png", end = 150, use_DevIL=true

At the moment I am at work so I am presently unable to reveal the line before it, but it would be that usual line that would load ffmpeg or something.

I have three other MKVs -- part1.mkv (original aac demuxed audio + .264 RAWAVC re-encode that I did to get the original out of an untamed format), part3.mkv, and part4.mkv. I named the 5-second MKV I made "part2.mkv".

Using mkvmerge GUI (mmg.exe), I am able to string part1.mkv, part3.mkv, and part4.mkv together into one longer MKV video. But when I include part2.mkv, I get errors about there not being a track and so it doesn't merge anything at all and quits. :(

"Error: The file no. 0 ('part1.mkv') does not contain a track with the ID X, or that track is not to be copied. Therefore no track can be appended to it. The argument for '--append-to' was invalid."
(I replaced the actual track ID# with 'X' because I can't remember if it was 0, 1, or 2)

colours
7th November 2014, 09:18
This is really an mkvtoolnix support query, not an Avisynth one!

I'm no expert there, and while there are options to append tracks with different indices from different files (probably?), it might be easier to just mux all your part*.mkv files so that the video track is first and the audio track is second, after which there shouldn't be any difficulties appending them with mkvmerge.

Also note that you may need to specify certain options in your H.264 encoder in order for the resulting H.264 streams to be stitchable (like --stitchable for x264).

BlueToast
7th November 2014, 19:12
Ah, nevermind. I wasn't able to find a solution to my problem.

One of the parts was made purely using ImageSource(). If I did not include that in the APPEND, mkvmerge is successful in joining together MKV video files. If I included it, it would not be successful. Yes, I also made sure that the ImageSource() avs + resulting MKV were using the same framerate and resolution as the other MKV parts.

I did try to find the best forum to post this thread under but I'm not too great at doing that. :( I don't spend my days lurking these forums.

In the end what I wound up doing was uploaded each part (except the ImageSource() part) to YouTube. I then used YouTube's video editor to join together all the parts and upload+insert a static image set for a duration of exactly 5 seconds. After YouTube finished processing the video for 1080p30, I used a Mozilla Firefox plugin (forgot name) to download only the audio as an .ac3 from the 1080p30 version. I had to re-encode the track into an MP4 / .m4a audio file due to problems I discovered later when trying to mux things together and get it working in Windows Media Player, VLC Player, and SMPlayer (it worked fine in the latter two, but WMP was only able to play the video without audio).

Stringing together the videos was still a PITA because of the ImageSource() part, which I needed to include so that audio from YouTube would synchronize correctly. Fortunately, I only needed to focus on video. I wound up muxing all the .264 video files into MP4 containers. I can't quite remember what I did next but somehow I got all the videos joined and had to do the unthinkable of re-encoding it into a new, single .264 video file that contained all the parts joined together. THEN I was able to mux the new .264 video file with the MP4/m4a audio track (attained by re-encoding YouTube audio track) into an MP4 container. MKV was a no-go because Windows Media Player doesn't support it.

With this, I was able to use my original video footage at the highest possible quality with a very high quality audio track from YouTube. Basically, I used YouTube to join together the audio from each video part all because mkvmerge had issues with ONE part that was created using only ImageSource(). If mkvmerge didn't have that problem, I would have had the highest possible quality for both video and audio in the final publishable container.

TheFluff
8th November 2014, 01:05
I gotta give you some credit for thinking creatively and trying to solve your own problems, but you remind me of a customer we had at former job who gave us feedback on the website we were developing for them by printscreening said website, saving the printscreen to a Word document, printing it out, writing comments and notes on it with a ballpoint pen and scanning the result to a PDF which they emailed to us.

Your actual problem seems to be that you tried to append MKV's with different track layouts, since you don't mention creating an audio track for your imagesource()'d AVS anywhere. That naturally won't work, and mkvmerge is telling you exactly what the problem is: you're telling it to append a track that doesn't exist. When trying to solve a problem, don't get tunnel vision. ImageSource() might be unique to this particular input file but the actual problem has nothing to do with Avisynth at all.