{"action":"created","issue":{"url":"https://api.github.com/repos/donmelton/video_transcoding/issues/14","labels_url":"https://api.github.com/repos/donmelton/video_transcoding/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/donmelton/video_transcoding/issues/14/comments","events_url":"https://api.github.com/repos/donmelton/video_transcoding/issues/14/events","html_url":"https://github.com/donmelton/video_transcoding/issues/14","id":75969166,"number":14,"title":"Feature Request: Write to tmp file during transcode","user":{"login":"alanwsmith","id":845049,"avatar_url":"https://avatars.githubusercontent.com/u/845049?v=3","gravatar_id":"","url":"https://api.github.com/users/alanwsmith","html_url":"https://github.com/alanwsmith","followers_url":"https://api.github.com/users/alanwsmith/followers","following_url":"https://api.github.com/users/alanwsmith/following{/other_user}","gists_url":"https://api.github.com/users/alanwsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/alanwsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanwsmith/subscriptions","organizations_url":"https://api.github.com/users/alanwsmith/orgs","repos_url":"https://api.github.com/users/alanwsmith/repos","events_url":"https://api.github.com/users/alanwsmith/events{/privacy}","received_events_url":"https://api.github.com/users/alanwsmith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-13T12:31:53Z","updated_at":"2015-05-13T13:14:01Z","closed_at":null,"body":"I'm transcoding a batch of mkv files. My process is:\r\n\r\n1. Put a bunch of .mkv files in a directory.\r\n\r\n2. Manually run `detect-crop` on each one to get the \"transcode-video\" recommendations.\r\n\r\n3. Create a transcode.bash script in the source directory with a line for each transcode call. For example:\r\n        \r\n        #!/bin/bash\r\n        \r\n        transcode-video --mp4 --crop 0:0:0:0 PrettyGoodMovie.mkv\r\n        transcode-video --mp4 --crop 132:132:0:0 AwesomeMovie.mkv\r\n        # etc...\r\n\r\n4. Run the script overnight to process as many movies as possible.\r\n\r\n5. Stop the script in the morning when I have to go to work. \r\n\r\n6. Figure out which movie was only partially transcoded. \r\n\r\n7. Delete the partial file so the next time the script is run the full movie gets transcoded. \r\n\r\n---\r\n\r\nMy suggestion is to update the 'transcode-video' script to write the output file to a temporary location (e.g. \"AwesomeMovie.mp4.tmp\") during the transcoding. Then, when the transcoding is complete, rename it to its final name (e.g. \"AwesomeMovie.mp4\"). \r\n\r\nAside from batch runs, this will also help avoid confusion for simple calls if the transcoding chokes or is stopped before finishing. It'll be evident by the fact that the file still has a temporary extension that the process didn't complete. \r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/donmelton/video_transcoding/issues/comments/101659272","html_url":"https://github.com/donmelton/video_transcoding/issues/14#issuecomment-101659272","issue_url":"https://api.github.com/repos/donmelton/video_transcoding/issues/14","id":101659272,"user":{"login":"alanwsmith","id":845049,"avatar_url":"https://avatars.githubusercontent.com/u/845049?v=3","gravatar_id":"","url":"https://api.github.com/users/alanwsmith","html_url":"https://github.com/alanwsmith","followers_url":"https://api.github.com/users/alanwsmith/followers","following_url":"https://api.github.com/users/alanwsmith/following{/other_user}","gists_url":"https://api.github.com/users/alanwsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/alanwsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanwsmith/subscriptions","organizations_url":"https://api.github.com/users/alanwsmith/orgs","repos_url":"https://api.github.com/users/alanwsmith/repos","events_url":"https://api.github.com/users/alanwsmith/events{/privacy}","received_events_url":"https://api.github.com/users/alanwsmith/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T13:14:01Z","updated_at":"2015-05-13T13:14:01Z","body":"I made a version that writes to a temporary file then does the rename at the end. It's here:\r\n\r\nhttps://github.com/alanwsmith/video_transcoding/tree/transcode-to-tmp\r\n\r\nLet me know if you're interested and I'll open a pull request. "}}